SetPVarInt question.
#1

Hey there. I`m stuck here, if anyone could help me, I would appreciate it.

Is there any way to set a pvar + 1 ?

Like:
pawn Код:
SetPVarInt( playerid, "blabla", GetPVarInt( playerid, "blabla" ) + 1 )
Thank you.
Reply
#2

You actually have it correct. Why don't you test it out

OR, you can use this macro:
pawn Код:
#define UpdatePVarInt(%0,%1,%2) SetPVarInt(%0, %1, GetPVarInt(%0, %1) %2)

UpdatePVarInt(playerid, "blabla", + 1);
- My 1,000th post D:
Reply
#3

Quote:
Originally Posted by [L3th4l]
Посмотреть сообщение
You actually have it correct. Why don't you test it out

OR, you can use this macro:
pawn Код:
#define UpdatePVarInt(%0,%1,%2) SetPVarInt(%0, %1, GetPVarInt(%0, %1) %2)

UpdatePVarInt(playerid, "blabla", + 1);
- My 1,000th post D:
Damn, I just realised I did something wrong when I tested it earlier, before posting the topic. Fixed it now and it works. Thanks for the define thingy, I will use it. Sorry for the stupid thread.

ps: Congratz on your 1,000th post.
Reply
#4

And, thanks for the macros, i will use it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)