Jump to content

[Ayuda] Quitar el daño de una caida


Ryuto

Recommended Posts

Posted

Buenas gente del forum, como dice el titulo quiero sacar el daño de una gran caida. Por ejemplo, si me tiro desde el edificio mas alto del mapa y cuando impacte con el suelo no me quite daño alguno, aquí daré otro ejemplo en este vídeo.

*La parte comienza en el segundo 0:20*

Muchas gracias por su atención.

Posted
function stopDamageFalling ( attacker, weapon, bodypart ) 
        if not attacker and not weapon then 
                if bodypart == 7 then 
                      cancelEvent() 
                end 
                if bodypart == 8 then 
                      cancelEvent() 
                end 
        end 
end 
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDamageFalling ) 

Eso no funcionaria, cuando alguien cae el dano no se produce en las piernas, utiliza esto:

addEventHandler('onClientPlayerDamage', localPlayer,  
   function (_, weapon) 
      if (weapon == 54) then 
         cancelEvent() 
      end 
   end 
) 

Posted
function stopDamageFalling ( attacker, weapon, bodypart ) 
        if not attacker and not weapon then 
                if bodypart == 7 then 
                      cancelEvent() 
                end 
                if bodypart == 8 then 
                      cancelEvent() 
                end 
        end 
end 
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDamageFalling ) 

Eso no funcionaria, cuando alguien cae el dano no se produce en las piernas, utiliza esto:

addEventHandler('onClientPlayerDamage', localPlayer,  
   function (_, weapon) 
      if (weapon == 54) then 
         cancelEvent() 
      end 
   end 
) 

Muchas gracias, ya ha funcionado. :)

Posted
Para no crear otro tema sobre esto, hay alguna manera de hacer que al caer haga una animación?
addEventHandler('onClientPlayerDamage', localPlayer, 
   function (_, weapon) 
      if (weapon == 54) then 
         setPedAnimation(localPlayer, "BLOCK", "ANIM") 
      end 
   end 
) 

Posted
Para no crear otro tema sobre esto, hay alguna manera de hacer que al caer haga una animación?
addEventHandler('onClientPlayerDamage', localPlayer, 
   function (_, weapon) 
      if (weapon == 54) then 
         setPedAnimation(localPlayer, "BLOCK", "ANIM") 
      end 
   end 
) 

Gracias, tengo una pregunta más... Se puede hacer que se active esto al usar un comando?

Necesito saber eso para terminar un script. :S

Posted
Para no crear otro tema sobre esto, hay alguna manera de hacer que al caer haga una animación?
addEventHandler('onClientPlayerDamage', localPlayer, 
   function (_, weapon) 
      if (weapon == 54) then 
         setPedAnimation(localPlayer, "BLOCK", "ANIM") 
      end 
   end 
) 

Gracias, tengo una pregunta más... Se puede hacer que se active esto al usar un comando?

Necesito saber eso para terminar un script. :S

Hacer la animación con el comando o activar que salga la animación al caerse?

Posted

Quiero que al escribir por ejemplo, /m, ya no te hagan daño las caidas, y luego si pones /m de nuevo, si te hagan daño

Posted
Quiero que al escribir por ejemplo, /m, ya no te hagan daño las caidas, y luego si pones /m de nuevo, si te hagan daño
local status = false 
  
addCommandHandler("m", function() status = not status end) 
  
addEventHandler('onClientPlayerDamage', localPlayer, 
   function (_, weapon) 
      if status and weapon == 54then 
            setPedAnimation(localPlayer, "BLOCK", "ANIM") 
      end 
   end 
) 

Posted
Quiero que al escribir por ejemplo, /m, ya no te hagan daño las caidas, y luego si pones /m de nuevo, si te hagan daño
local status = false 
  
addCommandHandler("m", function() status = not status end) 
  
addEventHandler('onClientPlayerDamage', localPlayer, 
   function (_, weapon) 
      if status and weapon == 54then 
            setPedAnimation(localPlayer, "BLOCK", "ANIM") 
      end 
   end 
) 

Gracias.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...