timer help
#2

First you need to make and array for a player.
pawn Код:
new UsedHealth[MAX_PLAYERS] = 0;
Than you make a command what will give you health and start a timer.

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;
}
And then you make what will happen when timer finishes.
pawn Код:
forward BoughtHealth(playerid);
public BoughtHealth(playerid)
{
    UsedHealth[playerid] = 0;
    return 1;
}
Reply


Messages In This Thread
timer help - by tanush - 19.02.2011, 12:39
Re: timer help - by xRyder - 19.02.2011, 13:05
Re: timer help - by tanush - 19.02.2011, 13:15
Re: timer help - by xRyder - 19.02.2011, 13:20
Re: timer help - by Mokerr - 19.02.2011, 13:22
Re: timer help - by tanush - 19.02.2011, 13:39
Re: timer help - by xRyder - 19.02.2011, 13:51
Re: timer help - by tanush - 19.02.2011, 13:55

Forum Jump:


Users browsing this thread: 1 Guest(s)