PVarInts
#2

In my experience, when adding to the value of a PVar, you need to first retrieve the current value, then add the value you're trying to add (that could get confusing). Here's an example:

Instead of doing this:
pawn Код:
SetPVarInt(playerid, "(...)", Value++);
or perhaps this:
pawn Код:
SetPVarInt(playerid, "(...)", GetPVarInt(playerid, "(...)")++);
you need to do this:
pawn Код:
SetPVarInt(playerid, "(...)", GetPVarInt(playerid, "(...)")+iValue);
That's one of the various reasons I tend not to use PVar's for values that are accessed very often.
Reply


Messages In This Thread
PVarInts - by Snowman12 - 10.01.2012, 21:21
Re: PVarInts - by Scenario - 10.01.2012, 21:45
Re: PVarInts - by Snowman12 - 10.01.2012, 22:02
Re: PVarInts - by Norck - 10.01.2012, 22:07
Re: PVarInts - by Snowman12 - 10.01.2012, 22:11
Re: PVarInts - by Snowman12 - 11.01.2012, 00:05
Re: PVarInts - by Scenario - 11.01.2012, 01:15
Re: PVarInts - by Snowman12 - 11.01.2012, 01:16
Re: PVarInts - by Scenario - 11.01.2012, 11:26

Forum Jump:


Users browsing this thread: 1 Guest(s)