25.08.2013, 11:23
How can I make a player actually have godmode? Not like setting their health to 99999 cause that can eventually go down
COMMAND:godmode(playerid, params[])
{
#define INFINITY (Float:0x7F800000)
SendClientMessage(playerid, 0xFFFFFFFF,"Godmode has been actived.");
SetPlayerHealth (playerid,INFINITY);
return 1;
}
new GodModeOn[MAX_PLAYERS+1];
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/god", cmdtext, true, 10) == 0)
{
if (GodModeOn[playerid] == 0)
{
GodModeOn[playerid] = 1;
SendClientMessage(playerid, -1, "God Mode is turned ON");
}
else
{
GodModeOn[playerid] = 0;
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, -1, "God Mode is turned OFF");
}
return 1;
}
return 0;
}
public OnPlayerUpdate(playerid)
{
if (IsPlayerConnected(playerid) == 1 && GodModeOn[playerid] == 1 && GetPlayerHealth(playerid) < 99999)
{
SetPlayerHealth(playerid, 99999);
}
return 1;
}
public OnPlayerDisconnect(playerid)
{
GodModeOn[playerid] = 0;
return 1;
}
#define INFINITY (Float:0x7F800000)
pawn Код:
pawn Код:
pawn Код:
pawn Код:
|
Don't use the above method.
Use this which is pure god no matter what the player do, You still alive. pawn Код:
Note: Yes this code is the same with Namer, But i'm lazy to check for pure god script in my script so i copy his code since that's the code i'm using in JakAdmin's /god. |
Don't use the above method.
Use this which is pure god no matter what the player do, You still alive. pawn Код:
Note: Yes this code is the same with Namer, But i'm lazy to check for pure god script in my script so i copy his code since that's the code i'm using in JakAdmin's /god. |