11.12.2014, 17:47
So, declare new global variable for all players, example:
Don't forget to reset this variable when player connect.
Код:
new PlayerUsedCommandTimes[MAX_PLAYERS];
Код:
CMD:vheal(playerid) { if(pInfo[playerid][pVipLevel] >= 4) { if(PlayerUsedCommandTimes[playerid] == 2) { //When player used this command 2 times. return 1; } PlayerUsedCommandTimes[playerid]++; new string[300], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); format(string,sizeof string,"{00C0FF}%s {F3FF02}Has Used VIP SURVIVAL PACK {B20000}+25 Health",pName); SendClientMessageToAll(0xFFFFFFAA,string); new Float:hp; GetPlayerHealth(playerid,hp); SetPlayerHealth(playerid, hp + 15); } return 1; }