SetPVarInt
#1

Hey,

Why isn't this working?

pawn Код:
SetPVarInt(playerid, "tries", ++);
PHP код:
: error 029: invalid expression, assumed zero
: error 022: must 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)