Jump to content

healing players bug


Recommended Posts

  • Moderators

By cancelling this effect.

https://wiki.multitheftauto.com/wiki/OnClientPedChoke

addEventHandler( "onClientPedChoke", root, 
    function (weapon) 
  
if weapon == 41 then 
        cancelEvent( ); 
end 
  
    end 
) 

This event is fired when a ped chokes due to the effect of a weapon such as tear gas grenades, fire extinguishers and spray cans.

You can also cancel the onClientPlayerDamage event with the same result.

Link to comment
By cancelling this effect.

https://wiki.multitheftauto.com/wiki/OnClientPedChoke

addEventHandler( "onClientPedChoke", root, 
    function (weapon) 
  
if weapon == 41 then 
        cancelEvent( ); 
end 
  
    end 
) 

This event is fired when a ped chokes due to the effect of a weapon such as tear gas grenades, fire extinguishers and spray cans.

You can also cancel the onClientPlayerDamage event with the same result.

onClientPedChoke never triggers on player..

  
addEventHandler('onClientPedChoke' , getRootElement() ,  
    function(wep) 
        --outputChatBox(wep) 
        if ( wep == 41 ) then 
            cancelEvent() 
        end 
    end 
) 
  

and cancelEvent() doesn't work on onClientPlayerWeaponFire and onPlayerDamage but it actually works on onClientPlayerDamage and it prevent player from shocking though. :D

Thanks!

Link to comment
  • Moderators

np.

oh My bad, it was onClientPlayerChoke. I was confused because some ped functions are also for players.

addEventHandler("onClientPlayerChoke",localPlayer, 
    function (weapon) 
  
if weapon == 41 then 
        cancelEvent( ); 
end 
  
    end 
) 

But I don't think you need it since you already use onClientPlayerDamage.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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