mo7taref2014 Posted July 20, 2015 Share Posted July 20, 2015 hello, how to cancelEvent when player hit the colShape and he can't use weapon on the colShape Best,Regards Link to comment
koeno100 Posted July 20, 2015 Share Posted July 20, 2015 function cancelColShapeHit() cancelEvent() end addEventHandler("onColShapeHit", getRootElement(), cancelColShapeHit) And you mean you want to prevent him using weapons in the colshape? Link to comment
mo7taref2014 Posted July 20, 2015 Author Share Posted July 20, 2015 function cancelColShapeHit() local SafeA = createColRectangle ( 1607.28125, 1829.31506, 64, 64) cancelEvent() end addEventHandler("onColShapeHit", getRootElement(), cancelColShapeHit) like this ? not work Link to comment
Buffalo Posted July 20, 2015 Share Posted July 20, 2015 For a free-fire zone local SafeA = createColRectangle ( 1607.28125, 1829.31506, 64, 64) function addRestriction(element) if getElementType(element) ~= 'player' then return end togglePlayerRestrictionless(element,false) setPedWeaponSlot(element,0) end addEventHandler("onColShapeHit", SafeA , addRestriction) function remRestriction(element) if getElementType(element) ~= 'player' then return end togglePlayerRestrictionless(element,true) end addEventHandler("onColShapeLeave", SafeA , remRestriction) function togglePlayerRestrictionless(player,toggle) toggleControl(player,'fire',toggle) toggleControl(player,'aim_weapon',toggle) toggleControl(player,'next_weapon',toggle) toggleControl(player,'previous_weapon',toggle) toggleControl(player,'vehicle_fire',toggle) toggleControl(player,'vehicle_secondary_fire',toggle) end 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