How can i make a /god command for players?
#5

pawn Код:
CMD:godon(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1 && IsPlayerConnected(playerid))
    {
            Godmode[playerid] = 1;
            SetPlayerHealth(playerid, 99999);
            SetPlayerArmour(playerid, 99999);
            SendClientMessage(playerid, -1, "You have enabled the god mode");
            return 1;
    }
    else
    {
        SendClientMessage(playerid, -1, "You are not an admin");
    }
    return 1;
}
pawn Код:
CMD:godoff(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1 && IsPlayerConnected(playerid))
    {
            Godmode[playerid] = 0;
            SetPlayerHealth(playerid, 100);
            SetPlayerArmour(playerid, 0);
            SendClientMessage(playerid, -1, "You have disabled the god mode");
            return 1;
    }
    else
    {
        SendClientMessage(playerid, -1, "You are not an admin");
    }
    return 1;
}
i have checked this code and it worked for me now
Reply


Messages In This Thread
How can i make a /god command for players? - by Mckarlis - 06.03.2014, 21:50
Re: How can i make a /god command for players? - by Abagail - 06.03.2014, 21:56
Re: How can i make a /god command for players? - by XK - 06.03.2014, 21:59
Re: How can i make a /god command for players? - by Mckarlis - 06.03.2014, 22:05
Re: How can i make a /god command for players? - by XK - 06.03.2014, 22:07
Re: How can i make a /god command for players? - by XK - 06.03.2014, 22:10
Re: How can i make a /god command for players? - by Mckarlis - 06.03.2014, 22:10
Re: How can i make a /god command for players? - by Threshold - 07.03.2014, 01:19

Forum Jump:


Users browsing this thread: 1 Guest(s)