ad help
#2

SetPlayerChatBubble will help you for the text above a player.
concerning the /ad usage: make a variable, and if it got "written", lets say, a 1, into it, deny the command execution. so first, include a check - if it fails (not used), then make sure that the next check will trigger the return. simple stuff hehe
pawn Код:
CMD:ad(playerid, params[])
{
if(GetPVarInt(playerid,"PillsTaken")>0)
{
return 1;//player has used the command already
}
SetPVarInt(playerid,"PillsTaken",1);//this line becomes obsolete, as soon you want to limit each player to more than 1 /ad. then you will like this:
//SetPVarInt(playerid,"PillsTaken",GetPVarInt(playerid,"PillTaken")+1);
    new Float:health;GetPlayerHealth(playerid,health);
    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; // 10 seconds
    }
    return 1;
}
the non-indented lines are the fresh ones ^^
Reply


Messages In This Thread
ad help - by Ananisiki - 21.02.2013, 22:39
Re: ad help - by Babul - 21.02.2013, 22:47
Re: ad help - by Ananisiki - 22.02.2013, 00:37
Re: ad help - by Ananisiki - 22.02.2013, 03:31
Re: ad help - by Ananisiki - 22.02.2013, 03:40
Re: ad help - by Babul - 22.02.2013, 10:45

Forum Jump:


Users browsing this thread: 1 Guest(s)