increment numeric variable

GameBoy
02 Dec 2003, 00:10
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...

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

GameBoy
02 Dec 2003, 00:23
Alex said its not userid its playerid but is it a string or a numeric variable? i dunno

Cryophile
02 Dec 2003, 00:24
It's playerid??? Now i'm confused... It should be a %% since it's a number.

GameBoy
02 Dec 2003, 00:36
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

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

GameBoy
02 Dec 2003, 08:30
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.

Alex
02 Dec 2003, 12:35
Actually I said it WAS USERID NOT PLAYERID!

GameBoy
02 Dec 2003, 12:40
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)

Alex
02 Dec 2003, 17:14
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.........

GameBoy
02 Dec 2003, 17:35
see then completely confused me.... im supposedto change <hp[playerid]; 9900> to <hp[userid]; 9900>

Cryophile
02 Dec 2003, 19:46
that's what I thought to begin with. Are there %'s? I don't think so, but I would like confirmation.

kewldude606
02 Dec 2003, 20:57
no %s for the number vars in an array.

Cryophile
02 Dec 2003, 21:25
Right. But you can use %userid% by itself in a msg or something, I think.

GameBoy
03 Dec 2003, 01:10
$name(%userid%)$ displays the player name

Cryophile
03 Dec 2003, 18:48
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!