Infinity health cmd ! pls help
#1

i have this cmd

Код:
new AdminDuty[MAX_PLAYERS];
and

Код:
	if(strcmp(cmd, "/aod", true) == 0)
	{
		if (PlayerInfo[playerid][pAdmin] >= 1)
	   	{
		    if(AdminDuty[playerid] == 1)
		    {
                       GetPlayerName(playerid, sendername, sizeof(sendername));
			           format(string, sizeof(string), "Admin %s is now off duty.", sendername,playerid);
                       SendClientMessageToAll(COLOR_DBLUE,string);
   				       AdminDuty[playerid] = 0;
				       SetPlayerHealth(playerid,100);
				       SetPlayerArmour(playerid,0);
				       SetPlayerToTeamColor(playerid);
            }
		    else
		    {
                GetPlayerName(playerid, sendername, sizeof(sendername));
		    	format(string, sizeof(string), "Admin %s is now on duty.",sendername,playerid);
				SendClientMessageToAll(0xFAAFBEFF,string);
   				AdminDuty[playerid] = 1;
			        SetPlayerHealth(playerid,100);
			        SetPlayerArmour(playerid,100);         
                SetPlayerColor(playerid,0xFAAFBEFF);
				for(new i = 0; i < MAX_PLAYERS; i ++)
                {
		                if(IsPlayerConnected(i))
				        {
					      SetPlayerMarkerForPlayer( i,playerid,0xFAAFBEFF );
					    }
		        }
		    }
		}
		else
		{
			SendClientMessage(playerid,COLOR_GREY,"Your not an admin !");
		}
		return 1;
	}
how cand i make this cmd when i'm on duty to have infinity health or more than 100 ... like 99999 or idk..

Can someone tell me how to do this? thx
Reply
#2

PHP код:
    new hp// top
    
if(strcmp(cmd"/aod"true) == 0)
    {
        if (
PlayerInfo[playerid][pAdmin] >= 1)
           {
            if(
AdminDuty[playerid] == 1)
            {
                       
GetPlayerName(playeridsendernamesizeof(sendername));
                       
format(stringsizeof(string), "Admin %s is now off duty."sendername,playerid);
                       
SendClientMessageToAll(COLOR_DBLUE,string);
                          
AdminDuty[playerid] = 0;
                       
SetPlayerHealth(playerid,100);
                       
SetPlayerArmour(playerid,0);
                       
SetPlayerToTeamColor(playerid);
                       
KillTimer(hp);
            }
            else
            {
                
GetPlayerName(playeridsendernamesizeof(sendername));
                
format(stringsizeof(string), "Admin %s is now on duty.",sendername,playerid);
                
SendClientMessageToAll(0xFAAFBEFF,string);
                   
AdminDuty[playerid] = 1;
                
SetPlayerHealth(playerid,100);
                
SetPlayerArmour(playerid,100);
                
hp SetTimer("Infinity"5001); // <-----------------
                
SetPlayerColor(playerid,0xFAAFBEFF);
                for(new 
0MAX_PLAYERS++)
                {
                        if(
IsPlayerConnected(i))
                        {
                          
SetPlayerMarkerForPlayeri,playerid,0xFAAFBEFF );
                        }
                }
            }
        }
        else
        {
            
SendClientMessage(playerid,COLOR_GREY,"Your not an admin !");
        }
        return 
1;
    }
    
forward Infinity(playerid);
    public 
Infinity(playerid)
    {
        
SetPlayerHealth(playerid10000);
        
SetPlayerArmour(playerid10000);
    } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)