Just a quick question. (+REP to 1st to answer)
#1

I'm looking to give myself god mode in my script, but can't find the code. Can anyone help me? Thanks in advance.
Reply
#2

Quote:
Originally Posted by JonesyFoCoTDM
Посмотреть сообщение
I'm looking to give myself god mode in my script, but can't find the code. Can anyone help me? Thanks in advance.
You can easily set your health like this:-

pawn Код:
SetPlayerHealth(playerid, 999999); //this sets your health to 999999 i.e unlimited.
You can make a command and put the above function in it. For restoring the health you can always use the same function and use 100 instead of 999999.

Or if you are looking for something in your script, just use CTRL + F to find what ever you are looking for.

Hope this helps?

-FalconX
Reply
#3

Yeah, I thought of doing that myself. But I've been on other servers where they've had commands such as /god making them impossible to kill. Does "999999" do that then? Thanks for the quick response by the way.
Reply
#4

If you cant find it, you may do it by yourself.
When you are using ZCMD, then you may add this to your gamemode:

pawn Код:
CMD:god(playerid, params[])
{
        SetPlayerHealth(playerid, 999999);
        SetPlayerArmour(playerid, 999999);
        SendClientMessage(playerid, C_GREEN, "You are now in godmode, good luck!");
        SetPlayerColor(playerid, C_BLACK);
        return 1;
}
It is actually quite hard, to kill someone with this health.
Reply
#5

Quote:
Originally Posted by JonesyFoCoTDM
Посмотреть сообщение
Yeah, I thought of doing that myself. But I've been on other servers where they've had commands such as /god making them impossible to kill. Does "999999" do that then? Thanks for the quick response by the way.
Yes mate, "999999" makes your health unlimited which ultimately makes you GOD . If you are looking for someone to make a command then leave a reply I will help you.

EDIT:

I have edited Dan's command and added a thing which is useful.

pawn Код:
new IsEnabled[MAX_PLAYERS]; // on the beginning of your script

IsEnabled[playerid] = 0; // put this on OnPlayerConnect and OnPlayerDisconnect.

CMD:godmod(playerid, params[])
{
    if(IsEnabled[playerid] == 0)
    {
        SetPlayerHealth(playerid, 999999);
        SetPlayerArmour(playerid, 999999);
        SendClientMessage(playerid, -1, "You have enabled the GOD-MOD, type the command again to disable it.");
        IsEnabled[playerid] = 1;
    }
    else
    {
        SendClientMessage(playerid, -1, "You have disabled the GOD-MOD, type the command again to enable it.");
        IsEnabled[playerid] = 0;
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 0);
    }
    return 1;
}
-FalconX
Reply
#6

I've made the command, thanks for the help guys, much appreciated.
Reply
#7

Quote:
Originally Posted by JonesyFoCoTDM
Посмотреть сообщение
I've made the command, thanks for the help guys, much appreciated.
Anytime mate (:

-FalconX
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)