Simple help me please Godmode
#8

The code is weird.. ^_^

For such things, a "bool" var is good and has better performance.

pawn Код:
//Global Variable (On top of your script)
new bool:gGMEnabled[MAX_PLAYERS];

COMMAND:god(playerid, params[])
{
    if(Adminstrator[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "You're not an Adminstrator!");

    if(!gGMEnabled[playerid])
    {
        SetPlayerHealth(playerid, INFINITY);
        SendClientMessage(playerid, 0x00FF00FF, "Godmode ON");
    } else {
        SetPlayerHealth(playerid, 100);
        SendClientMessage(playerid, 0xFF0000FF, "Godmode OFF");
    }
    return 1;
}

//And add gGMEnabled[playerid] = false; on player connect/disconnect, as you wish.
EDIT: ahh, too late.. xD
Reply


Messages In This Thread
Simple help me please Godmode - by Davz*|*Criss - 02.08.2011, 10:51
Re: Simple help me please Godmode - by Wesley221 - 02.08.2011, 10:54
Re: Simple help me please Godmode - by Davz*|*Criss - 02.08.2011, 10:55
Re: Simple help me please Godmode - by Wesley221 - 02.08.2011, 10:57
Re: Simple help me please Godmode - by Davz*|*Criss - 02.08.2011, 10:58
Re: Simple help me please Godmode - by Wesley221 - 02.08.2011, 10:59
Re: Simple help me please Godmode - by Davz*|*Criss - 02.08.2011, 11:02
Re: Simple help me please Godmode - by iPLEOMAX - 02.08.2011, 11:04
AW: Simple help me please Godmode - by samtey - 02.08.2011, 11:12
Re: Simple help me please Godmode - by iPLEOMAX - 02.08.2011, 11:16

Forum Jump:


Users browsing this thread: 1 Guest(s)