infinity health variable issue
#1

hey, guys, I made a god command which looks kind of like this:
(I stored the player's current health so the command won'g get abused)

PHP код:
YCMD:god(playeridparams[], help)
{
    if(
godmode[playerid]==false)
    {
        
godmode[playerid]=true;
        
ResetPlayerWeapons(playerid);
        
GetPlayerHealth(playeridphealth[playerid]);
        
GetPlayerArmour(playeridparmor[playerid]);
        
SetPlayerHealth(playerid0x7F800000);
    }
    else
    {
        
godmode[playerid]=false;
        
SetPlayerHealth(playeridphealth[playerid]);
        
SetPlayerArmour(playeridparmor[playerid]);
    }
    return 
1;

The problem is, everytime I connect to my server, and type /god for the first time, I die.
After that first time, it works as it should. Does anyone know how can I solve this?
Reply


Messages In This Thread
infinity health variable issue - by HeLiOn_PrImE - 24.08.2014, 17:08
Re: infinity health variable issue - by nmader - 24.08.2014, 17:18
Re: infinity health variable issue - by zT KiNgKoNg - 24.08.2014, 17:19
Re: infinity health variable issue - by SanAndreasMP - 24.08.2014, 17:21
Re: infinity health variable issue - by HeLiOn_PrImE - 24.08.2014, 17:43
Re: infinity health variable issue - by mamorunl - 24.08.2014, 18:11
Re: infinity health variable issue - by HeLiOn_PrImE - 24.08.2014, 18:18
Re: infinity health variable issue - by mamorunl - 24.08.2014, 18:54

Forum Jump:


Users browsing this thread: 2 Guest(s)