DLmass Posted July 17, 2011 Share Posted July 17, 2011 (edited) x, y, size = 1844.5594482422, 1375.3376464844, 120 local greenzone = createColRectangle ( 1844.5594482422, 1375.3376464844, 284, 312.22 ) local greenzonemaparea = createRadarArea (1844.5594482422, 1375.3376464844, 284, 312.22, 0, 255, 0, 120) function greenzoneEnter ( thePlayer, matchingDimension ) if getElementType( thePlayer ) ~= "player" then return end triggerClientEvent(thePlayer, "zoneEnter", thePlayer) toggleControl ( thePlayer, "fire", false ) toggleControl ( thePlayer, "next_weapon", false ) toggleControl ( thePlayer, "previous_weapon", false ) setPedWeaponSlot ( thePlayer, 0 ) toggleControl ( thePlayer, "aim_weapon", false ) toggleControl ( thePlayer, "vehicle_fire", false ) toggleControl ( thePlayer, "vehicle_secondary_fire", false ) removeEventHandler ("onClientPlayerDamage", getRootElement(), cancelEventEvent) end addEventHandler ( "onColShapeHit", greenzone, greenzoneEnter ) function greenzoneExit ( thePlayer, matchingDimension ) if getElementType( thePlayer ) ~= "player" then return end triggerClientEvent(thePlayer, "zoneExit", thePlayer) toggleControl ( thePlayer, "fire", true ) toggleControl ( thePlayer, "next_weapon", true ) toggleControl ( thePlayer, "previous_weapon", true ) toggleControl ( thePlayer, "aim_weapon", true ) toggleControl ( thePlayer, "vehicle_fire", true ) toggleControl ( thePlayer, "vehicle_secondary_fire", true ) removeEventHandler ("onClientPlayerDamage", getRootElement(), triggerEvent) end addEventHandler ( "onColShapeLeave", greenzone, greenzoneExit ) i tried to add: removeEventHandler ("onClientPlayerDamage", getRootElement(), cancelEventEvent) but it diden't work... becouse players outside the greenzone can shoot players inside and that makes them die Edited July 17, 2011 by Guest Link to comment
Kenix Posted July 17, 2011 Share Posted July 17, 2011 addEventHandler ("onClientPlayerDamage" , getRootElement (), cancelEvent) Link to comment
Kenix Posted July 17, 2011 Share Posted July 17, 2011 x, y, size = 1844.5594482422, 1375.3376464844, 120 local greenzone = createColRectangle ( 1844.5594482422, 1375.3376464844, 284, 312.22 ) local greenzonemaparea = createRadarArea (1844.5594482422, 1375.3376464844, 284, 312.22, 0, 255, 0, 120) safe = false function greenzoneEnter ( thePlayer, matchingDimension ) if getElementType( thePlayer ) ~= "player" then return end safe = true triggerClientEvent(thePlayer, "zoneEnter", thePlayer) toggleControl ( thePlayer, "fire", false ) toggleControl ( thePlayer, "next_weapon", false ) toggleControl ( thePlayer, "previous_weapon", false ) setPedWeaponSlot ( thePlayer, 0 ) toggleControl ( thePlayer, "aim_weapon", false ) toggleControl ( thePlayer, "vehicle_fire", false ) toggleControl ( thePlayer, "vehicle_secondary_fire", false ) end addEventHandler ( "onColShapeHit", greenzone, greenzoneEnter ) function greenzoneExit ( thePlayer, matchingDimension ) if getElementType( thePlayer ) ~= "player" then return end safe = false triggerClientEvent(thePlayer, "zoneExit", thePlayer) toggleControl ( thePlayer, "fire", true ) toggleControl ( thePlayer, "next_weapon", true ) toggleControl ( thePlayer, "previous_weapon", true ) toggleControl ( thePlayer, "aim_weapon", true ) toggleControl ( thePlayer, "vehicle_fire", true ) toggleControl ( thePlayer, "vehicle_secondary_fire", true ) end addEventHandler ( "onColShapeLeave", greenzone, greenzoneExit ) addEventHandler ("onClientPlayerDamage", getRootElement(), function() if safe == true then cancelEvent() end end) this full code Link to comment
DLmass Posted July 17, 2011 Author Share Posted July 17, 2011 they are still getting hurted... 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