Cap variable value
#2

Well you are using
PlayerInfo[pLSPD][toplayerid] = rank;
So if you use /finvitelspd 1 3
the rank will be 3 not 7, because it overwrites the old data.
If you want players to not be able to use /finvitelspd 1 6 or higher, you should put a
pawn Код:
if(rank > 5) return SendPlayerMessage(playerid,-1,"Invalid rank amount.");
line above
PlayerInfo[pLSPD][toplayerid] = rank;

if you want it to increase the rank you should use
pawn Код:
PlayerInfo[pLSPD][toplayerid] += rank;
instead
pawn Код:
PlayerInfo[pLSPD][toplayerid] = rank;
And add a line above it like,
pawn Код:
if(PlayerInfo[pLSPD][toplayerid]+rank > 5) return   SendPlayerMessage(playerid,-1,"Invalid rank amount.");
Reply


Messages In This Thread
Cap variable value - by Lz - 13.12.2012, 11:37
Re: Cap variable value - by Roel - 13.12.2012, 11:42

Forum Jump:


Users browsing this thread: 1 Guest(s)