SetPVarInt
#1

Hey,

Why isn't this working?

pawn Код:
SetPVarInt(playerid, "tries", ++);
PHP код:
error 029invalid expressionassumed zero
error 022must be lvalue (non-constant
Reply
#2

pawn Код:
SetPVarInt(playerid, "tries", GetPVarInt(playerid, "tries") + 1);
Or you can use the function AddPVarInt

pawn Код:
AddPVarInt(playerid, "tries", 1);
Then you need this:

pawn Код:
stock AddPVarInt(playerid, varname[], int_value)
{
    SetPVarInt(playerid, varname, GetPVarInt(playerid, varname) + int_value);
}
Reply
#3

Thanks, work perfectly!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)