2 new problems
#9

Quote:
Originally Posted by emokidx111
Посмотреть сообщение
try this

global var
pawn Код:
new timerid[MAX_PLAYERS];
pawn Код:
CMD:god(playerid, params[])
    {
        if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, [color], "Not Authorized to use this command");

        format(string, sizeof(string), "ADMIN-SPEC: %s has used /god", pname);
        SentMessageToAdmins(COLOR_GREY, string);

        if(GodMode[playerid] == 0)
        {
            timerid[playerid] = SetTimerEx("Health", 1000, true, "d", playerid);
            GodMode[playerid] = 1;
            GivePlayerWeapon(playerid, 22, 5000);
            GivePlayerWeapon(playerid, 5, 1);
            GivePlayerWeapon(playerid, 29, 5000);
            format(string, sizeof(string), "Administrator %s(ID:%d) has turn on his/her God Mode!", pname, playerid);
            SendClientMessageToAll(COLOR_GREEN, string);
            SendClientMessage(playerid, COLOR_GREEN, "| - God Mode ON! - |");
            PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
        }
        else
        {
            GodMode[playerid] = 0;
            SetPlayerHealth(playerid, 100.0);
            SetPlayerArmour(playerid, 100.0);
            format(string, sizeof(string), "Administrator %s(ID:%d) has turn off his/her God Mode!", pname, playerid);
            SendClientMessageToAll(COLOR_RED, string);
            SendClientMessage(playerid, COLOR_RED, "| - God Mode OFF! - |");
            PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
            KillTimer(timerid[playerid]);
        }

        return 1;
    }
pawn Код:
forward Health(playerid);
public Health(playerid)
{
    SetPlayerHealth(playerid, 1000);
    return 1;
}
Thanks men it work rep+ for you
Reply


Messages In This Thread
2 new problems - by L0zaix - 18.02.2012, 12:46
Re: 2 new problems - by deltapro - 18.02.2012, 15:47
Re: 2 new problems - by Twisted_Insane - 18.02.2012, 15:52
Re: 2 new problems - by aRoach - 18.02.2012, 15:54
Re: 2 new problems - by L0zaix - 19.02.2012, 00:07
Re: 2 new problems - by L0zaix - 19.02.2012, 02:34
Re: 2 new problems - by JhnzRep - 19.02.2012, 04:32
Re: 2 new problems - by emokidx - 19.02.2012, 04:41
Re: 2 new problems - by L0zaix - 19.02.2012, 04:55
Re: 2 new problems - by JhnzRep - 19.02.2012, 05:27

Forum Jump:


Users browsing this thread: 1 Guest(s)