[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(playerid, damagedid, Float:amount, weaponid, bodypart)
{
    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) == 0 && GetPlayerOrg(damagedid) == 0 && IsPlayerInRC(playerid))
    {
        
ShowPlayerDialog(playerid, 8724, DIALOG_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(playerid, 8724, DIALOG_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.0, playerid, damagedid)){
                if(
bodypart == 9){
                    if(
GetPlayerState(damagedid) == PLAYER_STATE_ONFOOT){
                        return 
InitHeadShot(playerid, damagedid);
                    }
                }
                
amount = 70.0;
            }
            else{
                
amount = 0.0;
                
SendClientMessage(damagedid, COLOR_YELLOW, "Dano Bloqueado, Sniper de perto й proibido!");
                
SendClientMessage(playerid, COLOR_YELLOW, "Dano Bloqueado, Sniper de perto й proibido!");
            }
            
TextDrawShowForPlayer(playerid, textXizinho);
        }
    }
     new
         
string[128]
     ;
     if(
weaponid == 29)
      {
           if(
IsPlayerInAnyVehicle(playerid) && GetPlayerState(damagedid) == PLAYER_STATE_ONFOOT)
        {
            
format(string, sizeof string, "Й proibido fazer DB neste servidor!", PlayerName(damagedid), damagedid);
             
SendClientMessage(playerid, COLOR_DBLUE, string);
            
SetPlayerArmedWeapon(playerid, 0);
            
amount = 0.0;
        }
    }
    
// /DM
    
DMSystem[playerid][damagedid]=true;
    
SetPVarInt(damagedid, "VarDano", gettime()+60);
//------------- Retirar Vida/Colete ------------------
    
PlayerPlaySound(damagedid, 17802,  0.0, 0.0, 0.0);
    new
        
Float:Life,
        
Float:Coleete,
        
Float:Dano
    
;
    
GetPlayerArmour(damagedid, Coleete);
    
GetPlayerHealth(damagedid, Life);
    if(
Coleete > 0)
    {
        if(
amount > Coleete)
        {
            
Dano = amount - Coleete;
            
Life = Life - Dano;
            if(
Life <= 0)
            {
                
setarhospital(damagedid);
                
SetPlayerVirtualWorld(damagedid, damagedid+1);
                
OnPlayerDeathEx(damagedid, playerid, weaponid);
                
pmorto[damagedid] = true;
            }
            
SetPlayerArmour(damagedid, 0.0);
            
SetPlayerHealth(damagedid, Life);
        }
        else
        {
            
Coleete = Coleete - amount;
            
SetPlayerArmour(damagedid, Coleete);
        }
    }
    else if(
Coleete < 1)
    {
        
Life = Life - amount;
        if(
Life <= 0)
        {
            
setarhospital(damagedid);
            
SetPlayerVirtualWorld(damagedid, damagedid+1);
            
OnPlayerDeathEx(damagedid, playerid, weaponid);
            
pmorto[damagedid] = true;
        }
        
SetPlayerHealth(damagedid, Life);
    }
//------------------------------------------------------------------------------
//playerid
    
format(string, 20, "{00FF00}+%.0f", amount);
     
Update3DTextLabelText(labelDano[playerid], 0xFFFFFFF6, string);
    
KillTimer(TempoMostrarLife[playerid]);
    
format(string,sizeof(string),"~>~ ~g~~h~%s~n~         ~g~~h~+%0.0f DMG~n~~p~Arma: ~w~~h~%s", NomePlayer(damagedid), amount, NomeArma(weaponid));
    
PlayerTextDrawSetString(playerid, textinfodamage[playerid][1], string);
    
PlayerTextDrawShow(playerid, textinfodamage[playerid][0]);
    
PlayerTextDrawShow(playerid, textinfodamage[playerid][1]);
    
TempoMostrarLife[playerid] = SetTimerEx("HideTextoLife", 600, 0, "i", playerid);
    
MostrandoVida[playerid] = 1;
//------------------------------------------------------------------------------
//Damagedid
    
format(string, 20, "{FF0000}-%.0f", amount);
     
Update3DTextLabelText(labelDano[damagedid], 0xFFFFFFF6, string);
    
KillTimer(TempoMostrarLife[damagedid]);
    
format(string,sizeof(string),"~>~ ~r~~h~%s~n~         ~r~~h~-%0.0f DMG~n~~p~Arma: ~w~~h~%s", NomePlayer(playerid), amount, NomeArma(weaponid));
    
PlayerTextDrawSetString(damagedid, textinfodamage[damagedid][1], string);
    
PlayerTextDrawShow(damagedid, textinfodamage[damagedid][0]);
    
PlayerTextDrawShow(damagedid, textinfodamage[damagedid][1]);
    
TempoMostrarLife[damagedid] = SetTimerEx("HideTextoLife", 600, 0, "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)