GetPVarInt
#1

hi when Im not sure te pvar existe like that :

PHP код:
if(:::)
{
SetPVarInt()::::
}
// 
GetPVarInt Going to return what if not exist // 0??
Reply
#2

I'm not exactly sure and it isn't listed on the Wiki. You could do something like this though:

pawn Код:
if(!GetPVarType(playerid, "varname")) // checking if "varname" doesn't exist
{
    SetPVarInt(playerid, "varname", value); // it doesn't, let's set the PVar
}
else // ... but if it does
{
    new iValue = GetPVarInt(playerid, "varname"); // obtain the value of the PVar and store it into a variable
}
Reply
#3

ok thx;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)