19.02.2011, 12:39
can i make a cmd like forexample "buyhealth". if an person used it once they have to wwait 10minute again. HOW I DO THAT??
new UsedHealth[MAX_PLAYERS] = 0;
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;
}
forward BoughtHealth(playerid);
public BoughtHealth(playerid)
{
UsedHealth[playerid] = 0;
return 1;
}
forward BoughtHealth(playerid);
public BoughtHealth(playerid)
{
UsedHealth[playerid] = 0;
return 1;
}
D:\Users\Tanush\Desktop\SA-MP\filterscripts\Timer.pwn(88) : error 055: start of function body without function header
D:\Users\Tanush\Desktop\SA-MP\filterscripts\Timer.pwn(90) : error 010: invalid function or declaration
forward BoughtHealth(playerid);
public BoughtHealth(playerid);
{
UsedHealth[playerid] = 0;
return 1;
}
public BoughtHealth(playerid)
{
}