Jump to content

healing players bug


Recommended Posts

Posted

Post what you tried, we can't help you without posting you're code.

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

  • Moderators
Posted

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.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted
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!

  • Moderators
Posted

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.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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...