mo7taref2014 Posted July 20, 2015 Posted July 20, 2015 hello, how to cancelEvent when player hit the colShape and he can't use weapon on the colShape Best,Regards
koeno100 Posted July 20, 2015 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?
mo7taref2014 Posted July 20, 2015 Author 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
Buffalo Posted July 20, 2015 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
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