Jump to content

CancelEvent


Best-Killer

Recommended Posts

function onDmg(attacker, weapon, _, loss)
    if ( isElement ( attacker ) and weapon and attacker ~= source  ) then
	if getElementData ( source, "KillArrest") =="true" then
		cancelEvent()
	    end
	end
end
addEventHandler('onPlayerDamage',root,onDmg)

0 errors but still i can damage the player :v what is the problem guys 

Edited by Best-Killer
Link to comment

as IPrestege taught me before it's would be better to use the client side 

1 hour ago, iPrestege said:

Try with this ;

 


addEventHandler ( 'onClientPlayerDamage',localPlayer,
	function ( aAttacker,aWeapon )
		if ( aAttacker and aWeapon and aAttacker ~= source ) then
		if ( getElementData ( source,'KillArrest' ) == true ) then
			cancelEvent (		)
		end
	end
)

 

 

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