Search the Community
Showing results for tags 'safezone'.
-
Já testei várias áreas verdes! E com todas elas consigo atirar do veículo usando o realdriveby ou com qualquer outro script de atirar do veículo! Alguém conhece alguma área verde que bloquear o realdriveby, ou sabe como programar uma para isso ? Também já coloquei o vehicle_fire em todas elas e não consegui.
- 23 replies
-
- area-verde
- safezone
-
(and 12 more)
Tagged with:
-
first of all its my firs topic in forums. I'm having problem with my safezone script which i wrote all of it (nearly, took hints from wiki) the problem is, when i enter the zone, it says 'you entered safezone' , but after a few seconds, 'you left the safezone' text appears. I couldnt solve the problem with my knowledge so im looking for help. only problem is; it says i left safezone after a few seconds, other functions working fine. clientside: safezones = { {1578.2421875, 1801.248046875, 10.8203125, 58, 61, 100}, {1996.958984375, -1450.9560546875, 13.5546875, 100, 55, 100}, {-2740.775390625, 577.9326171875, 14.5546875, 150, 100, 100}, } function createthings () for i, v in ipairs (safezones) do x, y, z, w, d, h = unpack(v) safezone = createColCuboid(x, y, z - 30, w, d, h) radar = createRadarArea(x, y, w, d, 0, 200, 0, 50) addEventHandler("onClientColShapeHit", safezone, hit) addEventHandler("onClientColShapeLeave", safezone, Leave) end end addEventHandler("onClientResourceStart", resourceRoot, createthings) function no() cancelEvent () end function disableproof() removeEventHandler ("onPlayerDamage",localPlayer,no) end function hit(element) if source == safezone then setPedWeaponSlot (element,0) if (getElementType (element) == "vehicle") then exports.GTWvehicleshop:saveAndRemoveVehicle(element,true) exports.GTWtopbar:dm("You can't drive vehicle inside safezone",200,50,50) toggleControl ("next_weapon",false) toggleControl ("previous_weapon",false) toggleControl ("fire",false) addEventHandler ("onPlayerDamage",localPlayer,no) addEventHandler("onPedWasted", localPlayer, disableproof) elseif (getElementType (element) == "player") then exports.GTWtopbar:dm("You entered the safezone, all weapons are forbidden.",200,50,50) toggleControl ("next_weapon",false) toggleControl ("previous_weapon",false) toggleControl ("fire",false) addEventHandler ("onPlayerDamage",localPlayer,no) addEventHandler("onPedWasted", localPlayer, disableproof) end end end function Leave(element) if source == safezone then exports.GTWtopbar:dm("You left the safezone.",200,50,50) toggleControl ("next_weapon",true) toggleControl ("previous_weapon",true) toggleControl ("fire",true) removeEventHandler ("onPlayerDamage",localPlayer,no) end end