2 way command
#3

pawn Код:
new GodMode[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    GodMode[playerid] = 0;
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/god", false))
    {
        if(IsPlayerAdmin(playerid))
        {
            if(GodMode[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_MAGENTA, "GOD MODE ON");
                SetPlayerArmour(playerid, INFINITY);
                SetPlayerHealth(playerid, INFINITY);
                GodMode[playerid] = 1;
            }
            else if(GodMode[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_MAGENTA, "GOD MODE OFF");
                SetPlayerHealth(playerid, 0);
                SetPlayerArmour(playerid, 0);
                GodMode[playerid] = 0;
            }
        }
        else SendClientMessage(playerid, COLOR_MAGENTA, "You are not an admin!"0;
    }
    return 0;
}
Reply


Messages In This Thread
2 way command - by willsuckformoney - 10.07.2010, 11:09
Re: 2 way command - by ViruZZzZ_ChiLLL - 10.07.2010, 11:21
Re: 2 way command - by TheInnocentOne - 10.07.2010, 11:25
Re: 2 way command - by Cameltoe - 10.07.2010, 11:27
Re: 2 way command - by ViruZZzZ_ChiLLL - 10.07.2010, 11:28
Re: 2 way command - by willsuckformoney - 10.07.2010, 11:30
Re: 2 way command - by Cameltoe - 10.07.2010, 11:40
Re: 2 way command - by ViruZZzZ_ChiLLL - 10.07.2010, 11:45
Re: 2 way command - by willsuckformoney - 10.07.2010, 11:47
Re: 2 way command - by Cameltoe - 10.07.2010, 11:50

Forum Jump:


Users browsing this thread: 1 Guest(s)