increment numeric variable

player startscript if ($name(#playerid#)$ = Squiggle ) then inc <hp[playerid]; 9900>

if anybody can find a fault in that, please correct it for me, coz it wont work... very odd. i might have $name(#playerid#)$ written wrong...

Where did you get #playerid#? I know of userid, which is an array. So it's %userid%. Such as $name(%userid%)$

Alex said its not userid its playerid but is it a string or a numeric variable? i dunno

It's playerid??? Now i'm confused... It should be a %% since it's a number.

yeah but i want it to find the player name not the player ID. i dont know, see what alex/Al/CW/ITID has to say lol, they're far more better than i

Check the manual. It says it is $name(userid)$
not playerid and there are no ## or %%.
just something like dec <health[userid];2>

yeah thats when decrementing a numberic variable belonging to the player, im just trying to see if the player name is set to squiggle before i give it godly powers.

Actually I said it WAS USERID NOT PLAYERID!

no u didnt!! lol. I showed you the code and asked why it wouldnt work, it said userid in it and you said "it needs playerid" lol.

Anyway, Alex, could you please correct my code so it will work, thanks for the help 8)

No, you had userid in one part and playerid in the other. See:


[23:46:49] !!!!PrOuD tO: i cant even get this right...
[23:46:50] !!!!PrOuD tO: player startscript if ( $name(%userid%)$ =
Squiggle ) then inc <hp[playerid]; 9900>
[23:46:50] Alex: duno...
[23:47:06] Alex: well it's userid not playerid .....



What code needs correcting now? Can't you try and work it out yourself for once... perhaps read the manual.........

see then completely confused me.... im supposedto change <hp[playerid]; 9900> to <hp[userid]; 9900>

that's what I thought to begin with. Are there %'s? I don't think so, but I would like confirmation.

no %s for the number vars in an array.

Right. But you can use %userid% by itself in a msg or something, I think.

$name(%userid%)$ displays the player name

S1aY3R wrote:Where did you get #playerid#? I know of userid, which is an array. So it's %userid%. Such as $name(%userid%)$


lol, I was right the first time. I was sooo confused by what you guys said. Oh well. At least we know now. Besides, since when am I right? Almost never, lol!