PDA

View Full Version : How to add god mode in Game Mode


4ss4ssin
10/07/2015, 01:40 PM
Hi,
how to add god mode in Game Mode I Add One God Mode but That One Has many Bugs
Pls Help me

Mouiz
10/07/2015, 01:46 PM
Hi,
how to add god mode in Game Mode I Add One God Mode but That One Has many Bugs
Pls Help me

#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;
}

4ss4ssin
10/07/2015, 02:28 PM
it's true buy we don't Support like this
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
if(!strcmp(cmd, "/god", true))
can you give me like this code?

notime
10/07/2015, 02:31 PM
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.

4ss4ssin
10/07/2015, 02:42 PM
I Don't know What Am I do Please help me like that one I have Please Please Please

Vicky69
10/07/2015, 03:07 PM
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(playerid, cmdtext[])
{
if (strcmp("/god", cmdtext, true, 10) == 0)
{
if(godmode[playerid] == 0)
{
SetPlayerHealth(playerid, 100000);
GameTextForPlayer(playerid,"~w~God Mode ~g~enabled!", 5000, 6);
godmode[playerid] = 1;
}
else if(godmode[playerid] == 1)
{
SetPlayerHealth(playerid, 100);
GameTextForPlayer(playerid,"~w~God Mode ~r~disabled!", 5000, 6);
godmode[playerid] = 1;
}
return 1;
}
return 0;
}

DRCharlie
10/07/2015, 03:19 PM
Plus if your gamemode has a headshot system don't forget to ignore the headshot if the player is in godmode.