SA-MP Forums Archive
How to add god mode in Game Mode - 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: How to add god mode in Game Mode (/showthread.php?tid=581069)



How to add god mode in Game Mode - 4ss4ssin - 10.07.2015

Hi,
how to add god mode in Game Mode I Add One God Mode but That One Has many Bugs
Pls Help me


Re: How to add god mode in Game Mode - Mouiz - 10.07.2015

Quote:
Originally Posted by 4ss4ssin
Посмотреть сообщение
Hi,
how to add god mode in Game Mode I Add One God Mode but That One Has many Bugs
Pls Help me
pawn Код:
#include <zcmd>
new God[MAX_PLAYERS];
CMD:god(playerid,params[])
{
    if(God[playerid] == 0)
    {
    SetPlayerHealth(playerid, 99999);
    GameTextForPlayer(playerid,"~g~godmod ~w~on",4500,3);
    God[playerid] = 1;
    }
    else if(God[playerid] == 1)
    {
    SetPlayerHealth(playerid, 100);
    GameTextForPlayer(playerid,"~g~godmod ~w~off",4500,3);
    God[playerid] = 0;
    }
    return 1;
}



Re: How to add god mode in Game Mode - 4ss4ssin - 10.07.2015

it's true buy we don't Support like this
Quote:

CMD:god(playerid,params[])
{
if(God[playerid] == 0)
{
SetPlayerHealth(playerid, 99999);
GameTextForPlayer(playerid,"~g~godmod ~w~on",4500,3);
God[playerid] = 1;
}
else if(God[playerid] == 1)
{
SetPlayerHealth(playerid, 100);
GameTextForPlayer(playerid,"~g~godmod ~w~off",4500,3);
God[playerid] = 0;
}
return 1;
}

we Support Like this
Quote:

if(!strcmp(cmd, "/god", true))

can you give me like this code?


Re: How to add god mode in Game Mode - notime - 10.07.2015

Quote:
Originally Posted by 4ss4ssin
Посмотреть сообщение
it's true buy we don't Support like this

we Support Like this

can you give me like this code?
Bro, not to be a dick, but, thats basically changing the strcmp like with the CMD:god line, placing it under OnPlayerCommandText.


Re: How to add god mode in Game Mode - 4ss4ssin - 10.07.2015

I Don't know What Am I do Please help me like that one I have Please Please Please


Re: How to add god mode in Game Mode - Vicky69 - 10.07.2015

PHP код:
new godmode[MAX_PLAYERS]; // Add this to the top of your script under the includes.
//The god command made using OnPlayerCommandText.Just copy paste this code.
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/god"cmdtexttrue10) == 0)
    {
        if(
godmode[playerid] == 0)
        {
            
SetPlayerHealth(playerid100000);
            
GameTextForPlayer(playerid,"~w~God Mode ~g~enabled!"50006);
            
godmode[playerid] = 1;
        }
        else if(
godmode[playerid] == 1)
        {
            
SetPlayerHealth(playerid100);
            
GameTextForPlayer(playerid,"~w~God Mode ~r~disabled!"50006);
            
godmode[playerid] = 1;
        }
        return 
1;
    }
    return 
0;




Re: How to add god mode in Game Mode - DRCharlie - 10.07.2015

Plus if your gamemode has a headshot system don't forget to ignore the headshot if the player is in godmode.