I need help

I need help

Postby qpqpqp123 » 01 Jul 2013, 13:59

I want to add in code p.number
that will show me the number off something how I do that
qpqpqp123
 
Posts: 59
Joined: 29 Apr 2013, 12:51

Re: I need help

Postby HETAL » 01 Jul 2013, 14:02

What exactly do you mean?
YOU HAVENT SEEN THE LAST OF ME ISMELLIKE
HETAL
 
Posts: 397
Joined: 24 May 2013, 12:10

Re: I need help

Postby qpqpqp123 » 01 Jul 2013, 14:15

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;
}
qpqpqp123
 
Posts: 59
Joined: 29 Apr 2013, 12:51

Re: I need help

Postby HETAL » 01 Jul 2013, 14:21

I didn't understand tell me what it would say in chat
YOU HAVENT SEEN THE LAST OF ME ISMELLIKE
HETAL
 
Posts: 397
Joined: 24 May 2013, 12:10

Re: I need help

Postby HETAL » 01 Jul 2013, 14:34

If you want math problems try this link viewtopic.php?f=20&t=1981
YOU HAVENT SEEN THE LAST OF ME ISMELLIKE
HETAL
 
Posts: 397
Joined: 24 May 2013, 12:10

Re: I need help

Postby lucasds12 » 01 Jul 2013, 16:48

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
There is only one thing I do in life, that's contributing here.
lucasds12
 
Posts: 334
Joined: 17 Apr 2013, 16:17
Location: In the deep caves.

Re: I need help

Postby ismellike » 01 Jul 2013, 17:47

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.
What a beast...
User avatar
ismellike
Coder
 
Posts: 731
Joined: 31 Oct 2012, 04:04
Location: Kansas


Return to Help

Who is online

Users browsing this forum: No registered users and 6 guests

cron