[Ajuda] Dano Armas
#1

A Bazuka WEAPON == 35 e a granada WEAPON == 16, nгo estгo tirando dano no meu servidor.
Bom teoricamente й fбcil alterar, fui na Public OnPlayerGiveDamage e na Public OnPlayerTakeDamage, e nгo tinha nada lб zerando o dano destas duas armas. Tentei definir um dano pra essas armas e mesmo assim o dano continua zerado. O que pode ser que esteja acontecendo? Uma calback que eu nгo sei onde estб, estб zerando o dano delas? Ou, tem possibilidade de ser alguma include?
PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloat:amountweaponidbodypart)
{
    if((
pmorto[damagedid]))return 1;
    if((
PlayerInfo[damagedid][pAdmin]&&admtrampando[damagedid])||
    (
PlayerInfo[damagedid][pHelper]&&helpertrampando[damagedid]))return 1;
    if(
GetPVarInt(damagedid"HD"))return 1;
    if(
GetPlayerOrg(playerid) == && GetPlayerOrg(damagedid) == && IsPlayerInRC(playerid))
    {
        
ShowPlayerDialog(playerid8724DIALOG_STYLE_MSGBOX,
        
"{FFFFFF}» Proibido fazer {FF0000}Death-Match",
        
"{FFFFFF}» Vocк nгo pode bater em um civil proximo a{FF0000} Areas Neutras\n\
        {FFFFFF}Caso faзa novamente, serб {FF0000}Preso por um admin!"
"OK","");
        
ApplyAnimation(playerid,"PED","handscower",4.1,0,1,1,0,0);
        return 
1;
    }
    if(
PlayerInfo[playerid][pJailed] && PlayerInfo[damagedid][pJailed])
    {
        
ShowPlayerDialog(playerid8724DIALOG_STYLE_MSGBOX,
        
"{FFFFFF}» Proibido fazer {FF0000}Death-Match",
        
"{FFFFFF}» Vocк nгo pode bater em alguem enquanto estiver{FF0000} Na cadeia\n\
        {FFFFFF}Caso faзa novamente, serб {FF0000}Ajustado por um admin!"
"OK","");
        
ApplyAnimation(playerid,"PED","handscower",4.1,0,1,1,0,0);
        return 
1;
    }
    
//Dano das Armas
    
switch(weaponid)
    {
        case 
24:amount 22.0//Eagle
        
case 25:amount 35.0//Shotgun
        
case 26:amount 10.0//Sawnoff Shotgun
        
case 27:amount 12.0//Combat Shotgun
        
case 29:amount 5.0;  //MP5
        
case 30:amount 10.0//AK-47
        
case 31:amount 10.0//M4
        
case 32:amount 3.0;  //Tec-9
        
case 38:amount 0.0;  //Minigun
        
case 34:               //Sniper Rifle
        
{
              if(!
ProxDetectorS(50.0playeriddamagedid)){
                if(
bodypart == 9){
                    if(
GetPlayerState(damagedid) == PLAYER_STATE_ONFOOT){
                        return 
InitHeadShot(playeriddamagedid);
                    }
                }
                
amount 70.0;
            }
            else{
                
amount 0.0;
                
SendClientMessage(damagedidCOLOR_YELLOW"Dano Bloqueado, Sniper de perto й proibido!");
                
SendClientMessage(playeridCOLOR_YELLOW"Dano Bloqueado, Sniper de perto й proibido!");
            }
            
TextDrawShowForPlayer(playeridtextXizinho);
        }
    }
     new
         
string[128]
     ;
     if(
weaponid == 29)
      {
           if(
IsPlayerInAnyVehicle(playerid) && GetPlayerState(damagedid) == PLAYER_STATE_ONFOOT)
        {
            
format(stringsizeof string"Й proibido fazer DB neste servidor!"PlayerName(damagedid), damagedid);
             
SendClientMessage(playeridCOLOR_DBLUEstring);
            
SetPlayerArmedWeapon(playerid0);
            
amount 0.0;
        }
    }
    
// /DM
    
DMSystem[playerid][damagedid]=true;
    
SetPVarInt(damagedid"VarDano"gettime()+60);
//------------- Retirar Vida/Colete ------------------
    
PlayerPlaySound(damagedid17802,  0.00.00.0);
    new
        
Float:Life,
        
Float:Coleete,
        
Float:Dano
    
;
    
GetPlayerArmour(damagedidColeete);
    
GetPlayerHealth(damagedidLife);
    if(
Coleete 0)
    {
        if(
amount Coleete)
        {
            
Dano amount Coleete;
            
Life Life Dano;
            if(
Life <= 0)
            {
                
setarhospital(damagedid);
                
SetPlayerVirtualWorld(damagediddamagedid+1);
                
OnPlayerDeathEx(damagedidplayeridweaponid);
                
pmorto[damagedid] = true;
            }
            
SetPlayerArmour(damagedid0.0);
            
SetPlayerHealth(damagedidLife);
        }
        else
        {
            
Coleete Coleete amount;
            
SetPlayerArmour(damagedidColeete);
        }
    }
    else if(
Coleete 1)
    {
        
Life Life amount;
        if(
Life <= 0)
        {
            
setarhospital(damagedid);
            
SetPlayerVirtualWorld(damagediddamagedid+1);
            
OnPlayerDeathEx(damagedidplayeridweaponid);
            
pmorto[damagedid] = true;
        }
        
SetPlayerHealth(damagedidLife);
    }
//------------------------------------------------------------------------------
//playerid
    
format(string20"{00FF00}+%.0f"amount);
     
Update3DTextLabelText(labelDano[playerid], 0xFFFFFFF6string);
    
KillTimer(TempoMostrarLife[playerid]);
    
format(string,sizeof(string),"~>~ ~g~~h~%s~n~         ~g~~h~+%0.0f DMG~n~~p~Arma: ~w~~h~%s"NomePlayer(damagedid), amountNomeArma(weaponid));
    
PlayerTextDrawSetString(playeridtextinfodamage[playerid][1], string);
    
PlayerTextDrawShow(playeridtextinfodamage[playerid][0]);
    
PlayerTextDrawShow(playeridtextinfodamage[playerid][1]);
    
TempoMostrarLife[playerid] = SetTimerEx("HideTextoLife"6000"i"playerid);
    
MostrandoVida[playerid] = 1;
//------------------------------------------------------------------------------
//Damagedid
    
format(string20"{FF0000}-%.0f"amount);
     
Update3DTextLabelText(labelDano[damagedid], 0xFFFFFFF6string);
    
KillTimer(TempoMostrarLife[damagedid]);
    
format(string,sizeof(string),"~>~ ~r~~h~%s~n~         ~r~~h~-%0.0f DMG~n~~p~Arma: ~w~~h~%s"NomePlayer(playerid), amountNomeArma(weaponid));
    
PlayerTextDrawSetString(damagedidtextinfodamage[damagedid][1], string);
    
PlayerTextDrawShow(damagedidtextinfodamage[damagedid][0]);
    
PlayerTextDrawShow(damagedidtextinfodamage[damagedid][1]);
    
TempoMostrarLife[damagedid] = SetTimerEx("HideTextoLife"6000"i"damagedid);
    
MostrandoVida[damagedid] = 1;
//------------------------------------------------------------------------------
    
updatetextlife(damagedid);
    return 
1;

Reply


Messages In This Thread
Dano Armas - by ViniBnT - 22.08.2018, 20:13
Re: Dano Armas - by Raayzeck - 22.08.2018, 22:10
Re: Dano Armas - by ViniBnT - 22.08.2018, 22:34
Re: Dano Armas - by ViniBnT - 23.08.2018, 06:26
Re: Dano Armas - by Raayzeck - 23.08.2018, 11:12
Re: Dano Armas - by ViniBnT - 23.08.2018, 16:37
Re: Dano Armas - by Raayzeck - 23.08.2018, 21:50
Re: Dano Armas - by ViniBnT - 23.08.2018, 23:06

Forum Jump:


Users browsing this thread: 1 Guest(s)