SetPVarInt question
#1

Hello,

How do i increase a variable with SetPVarInt?

Normally i would do this:
Seconds[playerid] ++;

So how can i do that with SetPVarInt?
Reply
#2

yes
Reply
#3

Quote:
Originally Posted by Aleksandar_Zivanovci
yes
Lol what?
Dont reply if you dont fully understand what im saying :P
Reply
#4

My method is this, say you were creating a point system.

pawn Код:
stock GetPoints(playerid)
{
   return GetPVarInt(playerid, "points");
}

stock AddPoint(playerid)
{
  SetPVarInt(playerid, "points", GetPoints(playerid)+1);
  return true;
}
Obviously there must be a simpler method, but that is what is in my script and it works so I ripped it for you.
Reply
#5

I use it like this:
pawn Код:
SetPVarInt(playerid,"variable",GetPVarInt(playerid, "variable")+1);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)