Page 1 of 1

I need help

PostPosted: 01 Jul 2013, 13:59
by qpqpqp123
I want to add in code p.number
that will show me the number off something how I do that

Re: I need help

PostPosted: 01 Jul 2013, 14:02
by HETAL
What exactly do you mean?

Re: I need help

PostPosted: 01 Jul 2013, 14:15
by qpqpqp123
have player so I want add that to code exam:
player p ;
p.number=p.number+1;
if(p.number<10)
{
//do somethink
}
else
{
p.number=1;
}

Re: I need help

PostPosted: 01 Jul 2013, 14:21
by HETAL
I didn't understand tell me what it would say in chat

Re: I need help

PostPosted: 01 Jul 2013, 14:34
by HETAL
If you want math problems try this link viewtopic.php?f=20&t=1981

Re: I need help

PostPosted: 01 Jul 2013, 16:48
by lucasds12
Hmm, kind of a very confusing question because you haven't gave me some valid information about what exactly this particular system your talking about. Are you talking about [number] of [item], /money has a sort of source code that allows a sort of process to happen (hopefully it's the solution) and if you need more help, just reply.
-Lucas

Re: I need help

PostPosted: 01 Jul 2013, 17:47
by ismellike
Since Player p does not have an extension for number, you will have to make one yourself.
Here is a code to show you how.
Code: Select all
if(!p.ExtraData.ContainsKey("number"))
{
    p.ExtraData.Add("number",x);
}

If a player does not have the variable number, add a number with the value of x.
Then to call number you would do this
Code: Select all
p.ExtraData["number"]=(int)p.ExtraData["number"]+1;
p.ExtraData["number"]=(int)p.ExtraData["number"]/1;
p.ExtraData["number"]=(int)p.ExtraData["number"]*1;
p.ExtraData["number"]=(int)p.ExtraData["number"]-1;
p.ExtraData["number"]=1;

Then you can just do the if/else statement that you showed.