commands + HELP?
#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


Messages In This Thread
commands + HELP? - by sanrock - 08.06.2012, 10:10
Re: commands + HELP? - by Faisal_khan - 08.06.2012, 12:24

Forum Jump:


Users browsing this thread: 1 Guest(s)