commands + HELP?
#1

How do I make like

zcmd

heal <id> (so the id needs to be near you and it gives the player 35 health each time, also you need to wait 1 minute before you can use again?


How do I make it so that team_zombies can't use cmd:kill

and they have to get 1 kill without dying before they can become team_human?
Reply
#2

pawn Code:
//On Top
new HealedPlayerRecently[MAX_PLAYERS];

public OnGameModeInit()
{
    SetTimer("HealedPlayerRecently",120000,1);
    return 1;
}

//Put this in your /heal command


forward HealedPlayerRecent();
public HealedPlayerRecent()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(HealedPlayerRecently[i] == 1)
        {
            HealedPlayerRecently[i] = 0;

        }
    }
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/heal", cmdtext, true, 4) == 0)
    {
        if(GetPlayerTeam(team_humans))
        {
            if(HealedPlayerRecently[playerid] = 1)
            {
                SetPlayerHealth(playerid, 35);
            }
            else
            {
                HealedPlayerRecently[playerid] = 1;
                return 1;
            }
        }
        return 1;
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)