Help Me :)
#2

So, declare new global variable for all players, example:
Код:
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;
}
Don't forget to reset this variable when player connect.
Reply


Messages In This Thread
Help Me :) - by samp_boy - 11.12.2014, 17:40
Re: Help Me :) - by Raweresh - 11.12.2014, 17:47
Re : Help Me :) - by samp_boy - 11.12.2014, 19:40

Forum Jump:


Users browsing this thread: 1 Guest(s)