2 new problems
#3

Stop begging pity for rep! By the way, this godmode would NOT work, 'cause if somebody would shooting at you with e.g. a minigun, your health would be fucked up in a minute! Try mine, you need to update stuff:

PHP код:
 new HasGod[MAX_PLAYERS]; 
PHP код:
    CMD:god(playeridparams[])
    {
        if(
PlayerInfo[playerid][pAdmin] >= 8)
        {
            if(
HasGod[playerid] == 0)
            {
                
HasGod[playerid] = 1;
                
SendClientMessage(playerid, -1"God mode turned on!");
            }
            else if(
HasGod[playerid] == 1)
            {
                
HasGod[playerid] = 0;
                
SendClientMessage(playerid, -1"God mode turned off!");
            }
        }
        else return 
SendClientMessage(playerid, -1"You have to be level 8 to use that command!");
        return 
1;
    } 
PHP код:
    public OnPlayerConnect(playerid) {
              
HasGod[playerid] = 0;
   return 
1;

PHP код:
    public OnPlayerUpdate(playerid)
    {
        if(
HasGod[playerid] == 1)
        {
            
SetTimer("SetHealth"100true);
        }
        return 
1;
    } 
PHP код:
    forward SetHealth(playerid);
    public 
SetHealth(playerid//this is a callback
    
{
        
SetPlayerHealth(playerid100);
        return 
1;
    } 
Simple, and not too long!
Reply


Messages In This Thread
2 new problems - by L0zaix - 18.02.2012, 12:46
Re: 2 new problems - by deltapro - 18.02.2012, 15:47
Re: 2 new problems - by Twisted_Insane - 18.02.2012, 15:52
Re: 2 new problems - by aRoach - 18.02.2012, 15:54
Re: 2 new problems - by L0zaix - 19.02.2012, 00:07
Re: 2 new problems - by L0zaix - 19.02.2012, 02:34
Re: 2 new problems - by JhnzRep - 19.02.2012, 04:32
Re: 2 new problems - by emokidx - 19.02.2012, 04:41
Re: 2 new problems - by L0zaix - 19.02.2012, 04:55
Re: 2 new problems - by JhnzRep - 19.02.2012, 05:27

Forum Jump:


Users browsing this thread: 1 Guest(s)