god,headshot
#1

i have problem with my command god for admin, when the player shot to head admin and admin die

this my command god


PHP код:
CMD:god(playeridparams[])  
{  
    
//new str3[128];  
    
new str1[128], str2[128], admin[MAX_PLAYER_NAME], p[MAX_PLAYER_NAME], idFloathealth1Float:health2;  
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid0xFF0000AA"You must be Admin to use this command");  
    
GetPlayerHealth(playeridhealth1);  
      
     
    if(
sscanf(params"d"id))  
    {                           
        if (
health1==0.0)  
        {  
        
SetPlayerHealth(playerid100.0);  
        return 
SendClientMessage(playerid,0x00FF00AA"Back to mortality.");  
        }  
        if (
health1>0.0)  
        {  
        
SetPlayerHealth(playeridFLOAT_INFINITY);  
        return 
SendClientMessage(playerid0x00FF00AA"You are god now!");  
        }  
    }  
    if(
IsPlayerConnected(id))  
    {  
        
GetPlayerName(playeridadminMAX_PLAYER_NAME);  
        
GetPlayerName(idpMAX_PLAYER_NAME);  
        
GetPlayerHealth(idhealth2);  
        if (
health2>0.0)  
        {  
            
SetPlayerHealth(idFLOAT_INFINITY);  
            
format(str2sizeof(str2), "You have successfully turned %s into god."p);  
            
SendClientMessage(playerid0x00FF00AAstr2);  
            
format(str1sizeof(str1), "Admin %s has turned you into god!"admin);  
            
SendClientMessage(id0x00FF00AAstr1);  
        }  
        if (
health2==0)  
        {  
            
SetPlayerHealth(id100.0);  
            
format(str2sizeof(str2), "You have turned god %s into human."p);  
            
SendClientMessage(playerid0x00FF00AAstr2);  
            return 
SendClientMessage(id0x00FF00AA"Back to mortality.");  
        }  
    }  
    else 
SendClientMessage(playerid0xFF0000AA"ERROR: Player is not connected.");  
    return 
1;  

and this the code headshot

PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart

    if(
issuerid != INVALID_PLAYER_ID && bodypart == 9
    { 
     if(
IsPlayerConnected(issuerid)) 
     { 
      if(
bodypart == && PlayerInfo[playerid][pAdmin] < || !IsPlayerAdmin(playerid)) 
          { 
             
SetPlayerHealth(playerid0.0); 
             new 
string[100], pname[24]; 
             
GetPlayerName(playeridheadshotsizeof(headshot)); 
             
GetPlayerName(issueridpnamesizeof(pname)); 
             
format(stringsizeof(string), "%s(%i) was shoot to the Head by %s(%i)"headshot,playeridpnameissuerid); 
             
GivePlayerMoney(issuerid100); 
             
SendClientMessageToAll(0x800000AA,string); 
             
GameTextForPlayer(issuerid,"~r~HeadShot",2000,1); 
             
PlayerPlaySound(issuerid178020.00.00.0); 
             
GameTextForPlayer(playerid,"~r~HeadShot",2000,1); 
             
ApplyAnimation(playerid"PED""ko2"4.1111111); // applying the dead guy animation tho you can one your own. 
             
PlayerPlaySound(playerid178020.00.00.0); 
          } 
     } 
    } 
  return 
1

help
Reply


Messages In This Thread
god,headshot - by crukk11 - 11.04.2017, 13:23
Re: god,headshot - by AndreiWow - 11.04.2017, 13:27
Re: god,headshot - by crukk11 - 11.04.2017, 13:35
Re: god,headshot - by AndreiWow - 11.04.2017, 13:36
Re: god,headshot - by crukk11 - 11.04.2017, 13:41
Re: god,headshot - by AndreiWow - 11.04.2017, 13:43
Re: god,headshot - by crukk11 - 11.04.2017, 13:50
Re: god,headshot - by AndreiWow - 11.04.2017, 14:13
Re: god,headshot - by crukk11 - 11.04.2017, 14:16
Re: god,headshot - by AndreiWow - 11.04.2017, 14:17

Forum Jump:


Users browsing this thread: 1 Guest(s)