SA-MP Forums Archive
SetPVarInt question. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SetPVarInt question. (/showthread.php?tid=238569)



SetPVarInt question. - antonio112 - 12.03.2011

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.


Re: SetPVarInt question. - [L3th4l] - 12.03.2011

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:


Re: SetPVarInt question. - antonio112 - 12.03.2011

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.


Re: SetPVarInt question. - OKStyle - 12.03.2011

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