19.02.2011, 13:05
First you need to make and array for a player.
Than you make a command what will give you health and start a timer.
And then you make what will happen when timer finishes.
pawn Код:
new UsedHealth[MAX_PLAYERS] = 0;
pawn Код:
COMMAND:buyhealth(playerid, params[])
{
if(UsedHealth[playerid] == 0)
{
SetPlayerHealth(playerid, 100.0);
UsedHealth[playerid] = 1;
SendClientMessage(playerid, YourCOLOR, "Your health has been set to 100.");
SetTimerEx("BoughtHealth",600000, false, "i", playerid);
}
else return SendClientMessage(playerid, YourCOLOR, "You need to wait for 10 minutes to buy health again");
return 1;
}
pawn Код:
forward BoughtHealth(playerid);
public BoughtHealth(playerid)
{
UsedHealth[playerid] = 0;
return 1;
}