God mode
#1

How could i make a command like /god that when I activate it, i won't loose health? Sounds simple ish but not really sure.
Reply
#2

i dont know if you want it for admin or not but here

Код:
    if(strcmp(cmd, "/god", true) == 0)
    {
        GetPlayerName(playerid, AdminName, sizeof(playername));
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(PlayerInfo[playerid][pAOnDuty] == 0)
                {
                    SetPlayerColor(playerid, COLOR_LIGHTBLUE);
                    PlayerInfo[playerid][pAOnDuty] = 1;
                    SendClientMessage(playerid, COLOR_GRAD2, "You are now on-duty as an admin, Please do your best!.");
                    SetPlayerHealth(playerid, 100);
                    SetPlayerArmour(playerid, 100);
                    format(string, sizeof(string), "%s is now on-duty as an admin.", AdminName);
                    SendClientMessageToAll(COLOR_YELLOW, string);
                    return 1;
                }
                else
                {
                    SetPlayerColor(playerid, COLOR_INVIS);
                    PlayerInfo[playerid][pAOnDuty] = 0;
                    SendClientMessage(playerid, COLOR_GRAD2, "You are not longer on-duty as admin, notice to /reports please!.");
                    SetPlayerHealth(playerid, 100);
                    SetPlayerArmour(playerid, 0);
                    format(string, sizeof(string), "%s is no longer on-duty as admin.", AdminName);
                    SendClientMessageToAll(COLOR_YELLOW, string);
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
            }
        }
        return 1;
    }
And put this one top
Код:
    new AdminName[MAX_PLAYER_NAME];
Reply
#3

That isn't what i wanted..
Reply
#4

O_o then give more deatails please.
Reply
#5

Quote:
Originally Posted by grantism
Посмотреть сообщение
That isn't what i wanted..
I Hate this response .... so you ask for help without any suggestion and then you get mad..
Reply
#6

Quote:
Originally Posted by [A]ndrei
Посмотреть сообщение
O_o then give more deatails please.
I want a command that when you type /god you won't take damage.
Quote:
Originally Posted by axxelac
Посмотреть сообщение
I Hate this response .... so you ask for help without any suggestion and then you get mad..
If you read.. It says what i want, also, who said I was mad..
Reply
#7

Quote:
Originally Posted by grantism
Посмотреть сообщение
I want a command that when you type /god you won't take damage.


If you read.. It says what i want, also, who said I was mad..
Here..

Код HTML:
CMD:god(playerid, params[])
{
    if(GodMode[playerid] == 0) //god mode not set, lets set it
    {
        SetPlayerHealth(playerid, INFINITY);    //set the health to infinity
        GodMode[playerid] = 1;    //set godmode to true
        SendClientMessage(playerid, 0xFF0000FF, "God mode Enabled");

    }
    else if(GodMode[playerid] == 1) //god mode set .. lets unset it
    {
        SetPlayerHealth(playerid, 100.0);    //set health to 100%
        GodMode[playerid] = 0;    //set godmode to false
        SendClientMessage(playerid, 0xFF0000FF, "God mode Disabled");
    }
    return 1;
}
If you type /god it will disabled the God mode.
Reply
#8

Cheers mate. + rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)