SA-MP Forums Archive
CMD:ad - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: CMD:ad (/showthread.php?tid=417941)



CMD:ad - Ananisiki - 23.02.2013

^^^^^^^^


Re: CMD:ad - DaRk_RaiN - 23.02.2013

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;
}



Re: CMD:ad - Ananisiki - 23.02.2013

^^^^^^^^


Re: CMD:ad - DaRk_RaiN - 23.02.2013

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