God mode command
#1

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
Reply
#2

---- remove ----
Reply
#3

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.
Reply
#4

Is there a way you don't have to be on rcon?
Reply
#5

Yeah.

Do you already have an admin/registering system, or something that defines you are an admin?
Reply
#6

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 .
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)