Problem with Godmode
#1

I got a problem with the godmode.

pawn Код:
if (strcmp(cmd, "/godmode", true) == 0)
    {
        if (AccInfo[playerid][pVip] <=1)
        {
            if(AccInfo[playerid][God] == 0)
            {
            AccInfo[playerid][God] = 1;
            SetPlayerHealth(playerid, 35000);
            SendClientMessage(playerid,COLOR_GREEN, "* Godmode enabled.");
            }
            else
            {
            AccInfo[playerid][God] = 0;
            SetPlayerHealth(playerid, 100);
            SendClientMessage(playerid,red,"* Godmode disabled.");
            }
            return PlayerPlaySound(playerid, 1052, 0.0, 0.0, 10.0);
        }
        else return SendClientMessage(playerid,COLOR_WHITE,"* You're not a VIP to perform this command.");
    }
The code seems to be alright, the only problem is that I can still die when I'm falling from a building. The health refills only after few seconds.

What is wrong?
Reply
#2

pawn Код:
if (strcmp(cmd, "/godmode", true) == 0)
    {
        if (AccInfo[playerid][pVip] <=1)
        {
            if(AccInfo[playerid][God] == 0)
            {
            AccInfo[playerid][God] = 1;
            SetPlayerHealth(playerid, 9999999999);
            SendClientMessage(playerid,COLOR_GREEN, "* Godmode enabled.");
            }
            else if(AccInfo[playerid][God] == 1)
            {
            AccInfo[playerid][God] = 0;
            SetPlayerHealth(playerid, 100);
            SendClientMessage(playerid,red,"* Godmode disabled.");
            }
            return PlayerPlaySound(playerid, 1052, 0.0, 0.0, 10.0);
        }
        else return SendClientMessage(playerid,COLOR_WHITE,"* You're not a VIP to perform this command.");
    }
this will work :P also show us onplayerupdate
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)