CMD:ad
#1

^^^^^^^^
Reply
#2

pawn Код:
CMD:ad(playerid, params[])
{
    if(GetPVarInt(playerid,"PillsTaken")>0)return SendClientMessage(playerid, COLOR_RED, "You can only use /ad once in a life time.");
    new Float:health;
    GetPlayerHealth(playerid,health);
    SetPVarInt(playerid,"PillsTaken",1);
    SetPVarInt(playerid,"PillsTaken",GetPVarInt(playerid,"PillTaken")+1);
    if(isDead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Dead.");
    if(health == 100) return SendClientMessage(playerid, COLOR_RED, "Your Health Is Already Full, You Cannot Take /ad.");
    if(iCanUse[playerid]-gettime() > 0) return SendClientMessage(playerid, COLOR_RED, "Please Wait Before Taking Another Adrenaline Pill.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "You Have Taken An Adrenaline Pill.");
    SetPlayerHealth(playerid, 100.0);
{

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

^^^^^^^^
Reply
#4

Add this under OnPlayerDeath
pawn Код:
SetPVarInt(playerid,"PillsTaken",0);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)