2 new problems
#7

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GodMode[playerid] == 1)
    {
       GodTimer = SetTimer("God", 100, true);
    }
    return 1;
}
This is going to lag you so bad. Putting a timer under OnPlayerUpdate, that has 100 miliseconds(A tenth of a second) is just crazy.

pawn Код:
CMD:god(playerid, params[])
{
    new string[128],pname[MAX_PLAYERS];
    GetPlayerName(playerid, pname, sizeof(pname));
    if(PlayerInfo[playerid][Admin] > 1)
    {
        format(string, sizeof(string), "ADMIN-SPEC: %s has used /god", pname);
        SentMessageToAdmins(COLOR_GREY, string);
        if(GodMode[playerid] == 0)
        {
            SetPlayerHealth(playerid, 9999999);
            SetPlayerArmour(playerid, 9999999);
            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);
        }
    }
    return 1;
}
I recommend using this. If a person is shooting you with a minigun, then you might die..After a long time..Other than that your safe.
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)