21.07.2012, 14:26
Hello, I am looking for a god mode where you can not die when you enable it and when you disable it it will no longer work till re-enabled also i need it so only admins can use it. Thank you
if(!strcmp(cmdtext, "/godmode", true, 3)) // If typed /godmode
{ // then
if(IsPlayerAdmin(playerid)) //checks if is an admin (rcon)
SetPlayerHealth(playerid, 999999999); // set the health to 999999999
}
CMD:god(playerid,params[]) {
new God[MAX_PLAYERS];
if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You need to be RCON admin to use this command.");
if(God[playerid]==0) {
God[playerid]=1;
SetPlayerHealth(playerid, 999999999);
SendClientMessage(playerid,-1,"GODMODE: ON");
}
if(God[playerid]==1) {
God[playerid]=01;
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid,-1,"GODMODE: OFF");
}
return 1;
}