SA-MP Forums Archive
/god - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /god (/showthread.php?tid=364318)



/god - BenMArs - 30.07.2012

Hello can anyone script command /god for me? and /agate(admin gate)That opens gate u are near, for admins only.And if you could u can scriptnational guard factio.thanks.And also /fixveh it would fix car.


Re: /god - Devilxz97 - 30.07.2012

Edit again ;

pawn Код:
#include a_samp
#include zcmd

new GodMode[MAX_PLAYERS];

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

public OnPlayerDisconnect(playerid, reason)
{
    GodMode[playerid] = 0;
    return 1;
}

CMD:god(playerid, params[])
{
    if(GodMode[playerid] == 0)
    {
        SetPlayerHealth(playerid, 99999);
        SetPlayerArmour(playerid, 99999);
        GodMode[playerid] = 1;
    }
    else if(GodMode[playerid] == 1)
    {
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 100);
        GodMode[playerid] = 0;
    }
    return 1;
}
try this..


Re: /god - doreto - 30.07.2012

pawn Код:
CMD:god(playerid, params[])
{
    if(GodMode[playerid] == 0)
    {
        SetPlayerHealth(playerid, 99999);
        SetPlayerArmour(playerid, 99999);
        GodMode[playerid] = 1; // its shout be like that becose after you become "god" and use
      //command again you still will be and cant check if you are alredy or not
    }
    else if(GodMode[playerid] == 1)
    {
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 100);
    }
    return 1;
}



Re: /god - Devilxz97 - 30.07.2012

xD I forget to put that xD Fix