how to make 'Please wait before use command'
#7

No need for that. You can use Unixtime stamps:

pawn Код:
new
    iCanUse[MAX_PLAYERS];

dcmd_ad(playerid, params[])
{
    #pragma unused params

    if(iCanUse[playerid]-gettime() > 0) return SendClientMessage(playerid, 0xFF0000AA, "Please wait before using another Adrenaline Pill!");

    new
        Float:iHealth;

    GetPlayerHealth(playerid, iHealth);

    if(iHealth < 100)
    {
        SetPlayerHealth(playerid, iHealth + 100);
        SendClientMessage(playerid, 0x00FF00AA, "Adrenaline Pill has been utilized!");

        iCanUse[playerid] = gettime() + 60; // 60 seconds
    }
    return 1;
}
Reply


Messages In This Thread
how to make 'Please wait before use command' - by MWhite_005 - 14.07.2011, 01:40
Re: how to make 'Please wait before use command' - by [L3th4l] - 14.07.2011, 01:58
Re: how to make 'Please wait before use command' - by Ricop522 - 14.07.2011, 02:07
Re: how to make 'Please wait before use command' - by grand.Theft.Otto - 14.07.2011, 02:40
Re: how to make 'Please wait before use command' - by MWhite_005 - 14.07.2011, 03:16
Re: how to make 'Please wait before use command' - by MWhite_005 - 14.07.2011, 03:31
Re: how to make 'Please wait before use command' - by [L3th4l] - 14.07.2011, 04:20
Re: how to make 'Please wait before use command' - by hulitubolies - 14.07.2012, 18:29
Re: how to make 'Please wait before use command' - by hulitubolies - 14.07.2012, 18:47

Forum Jump:


Users browsing this thread: 2 Guest(s)