God mode command - 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 mode command (
/showthread.php?tid=361561)
God mode command -
Ryan_Michael - 21.07.2012
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
Re: God mode command -
Why - 21.07.2012
---- remove ----
Re: God mode command -
Chriham3 - 21.07.2012
pawn Код:
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
}
This only works if you are an RCON admin. Use /rcon login [password in server.cfg]
You'd practically be invulnerable unless someone shoots you 22727272 times with a deagle which would take around 28409090 seconds.
Re: God mode command -
Ryan_Michael - 21.07.2012
Is there a way you don't have to be on rcon?
Re: God mode command -
Chriham3 - 21.07.2012
Yeah.
Do you already have an admin/registering system, or something that defines you are an admin?
Re: God mode command -
Georgi166 - 21.07.2012
You need to have a custom admin system to be able to use it without Rcon, Or make it so when you type the command it asks for some password .
Re: God mode command -
Excel™ - 21.07.2012
use this pawn code.
Note: i used zcmd.
pawn Код:
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;
}
add rep if i helped u