~DarkRacer~ Posted March 25, 2014 Share Posted March 25, 2014 hey everyone, i'm making a script for medics and its working fine but there is one bug.. when i start to heal a player .. the player acts like shocking from the spraycan. how can i stop that? i tried canceling the event but nothing.. i'm using onClientPlayerWeaponFire event and i also tried onPlayerDamage Link to comment
-.Paradox.- Posted March 25, 2014 Share Posted March 25, 2014 Post what you tried, we can't help you without posting you're code. Link to comment
Moderators IIYAMA Posted March 25, 2014 Moderators Share Posted March 25, 2014 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
~DarkRacer~ Posted March 25, 2014 Author Share Posted March 25, 2014 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. Thanks! Link to comment
Moderators IIYAMA Posted March 25, 2014 Moderators Share Posted March 25, 2014 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now