Kors Posted March 23, 2018 Share Posted March 23, 2018 How to set god mod on vehicle and players on safe zone Link to comment
Discord Moderators Pirulax Posted March 23, 2018 Discord Moderators Share Posted March 23, 2018 (edited) Hello, thers a function called setVehicleDamageProof() For the save zone thing u'll need local radarAreaForGod = createRadarArea(x, y, w, h)--> Replace x, y with the left top corners of the god area, and w, h with the width and height of it. addEventHandler("onClientPlayerDamage", localPlayer, function() if (isInsideRadarArea(radarAreaForGod, getElementPosition(localPlayer))) then cancelEvent() end end ) Edited March 23, 2018 by Pirulax Forgot an arg in isInsideRadarArea 1 Link to comment
Storm-Hanma Posted March 24, 2018 Share Posted March 24, 2018 Latest free roam have ability to use antiram , Use setVehicleDamageProof() & toggle control vehicle fire false (primary &secondary ) 1 Link to comment
Kors Posted March 24, 2018 Author Share Posted March 24, 2018 can u add thet ? i dont now how, safecol = createColCuboid ( -746.99713134766, 888.54418945313, 12, 255, 255, 255 ) safeZoneRadar = createRadarArea ( -746.99713134766, 888.54418945313, 150, 150, 153, 235, 255 ) setElementData (safeZoneRadar, "zombieProof", true) function enterZone(hitElement,thePlayer) if (getElementData (hitElement, "zombie") == true) then killPed (hitElement) else toggleControl (hitElement, "fire", false ) toggleControl (hitElement, "aim_weapon", false) toggleControl (hitElement, "vehicle_fire", false) end end addEventHandler( "onColShapeHit", safecol, enterZone ) function leaveZone(leaveElement, thePlayer) if (getElementData (leaveElement, "zombie") == true) then killPed (leaveElement) else toggleControl (leaveElement, "fire", true) toggleControl (leaveElement, "aim_weapon", true) toggleControl (leaveElement, "vehicle_fire", true) end end addEventHandler( "onColShapeLeave", safecol, leaveZone ) and how fix this errors? [2018-03-24 23:05:31] WARNING: anti-zombie-area.lua:11: Bad argument @ 'toggleControl' [Expected player at argument 1, got vehicle] [2018-03-24 23:05:33] WARNING: anti-zombie-area.lua:23: Bad argument @ 'toggleControl' [Expected player at argument 1, got vehicle] [2018-03-24 23:05:33] WARNING:anti-zombie-area.lua:24: Bad argument @ 'toggleControl' [Expected player at argument 1, got vehicle] [2018-03-24 23:05:33] WARNING: anti-zombie-area.lua:25: Bad argument @ 'toggleControl' [Expected player at argument 1, got vehicle] [2018-03-24 23:05:33] WARNING: anti-zombie-area.lua:9: Bad argument @ 'toggleControl' [Expected player at argument 1, got vehicle] [2018-03-24 23:05:33] WARNING: anti-zombie-area.lua:10: Bad argument @ 'toggleControl' [Expected player at argument 1, got vehicle] 15 hours ago, Khadeer143 said: Latest free roam have ability to use antiram , Use setVehicleDamageProof() & toggle control vehicle fire false (primary &secondary ) Link to comment
Dimos7 Posted March 24, 2018 Share Posted March 24, 2018 (edited) Use That Edited March 24, 2018 by Dimos7 Link to comment
Kors Posted March 24, 2018 Author Share Posted March 24, 2018 20 minutes ago, Dimos7 said: Use That you about warnings? use thet? replace toggleControl to thet? Link to comment
Dimos7 Posted March 24, 2018 Share Posted March 24, 2018 (edited) no i mean that safecol = createColCuboid ( -746.99713134766, 888.54418945313, 12, 255, 255, 255 ) safeZoneRadar = createRadarArea ( -746.99713134766, 888.54418945313, 150, 150, 153, 235, 255 ) setElementData (safeZoneRadar, "zombieProof", true) function enterZone(hitElement,thePlayer) if isElement(hitElement) and getElementType(hitElement) == "player" then if (getElementData (hitElement, "zombie") == true) then killPed (hitElement) else toggleControl (hitElement, "fire", false ) toggleControl (hitElement, "aim_weapon", false) toggleControl (hitElement, "vehicle_fire", false) end end end addEventHandler( "onColShapeHit", safecol, enterZone ) function leaveZone(leaveElement, thePlayer) if isElement(leaveElement) and getElementType(leaveElement) == "player" then if (getElementData (leaveElement, "zombie") == true) then killPed (leaveElement) else toggleControl (leaveElement, "fire", true) toggleControl (leaveElement, "aim_weapon", true) toggleControl (leaveElement, "vehicle_fire", true) end end end addEventHandler( "onColShapeLeave", safecol, leaveZone ) Edited March 24, 2018 by Dimos7 Link to comment
Discord Moderators Pirulax Posted March 28, 2018 Discord Moderators Share Posted March 28, 2018 local safecol = createColCuboid ( -746.99713134766, 888.54418945313, 12, 255, 255, 255 ) local safeZoneRadar = createRadarArea ( -746.99713134766, 888.54418945313, 150, 150, 153, 235, 255 ) setElementData (safeZoneRadar, "zombieProof", true, false)--> dont sync it. function enterZone(hitElement, matchingDim) if not matchingDim then return end if isElement(leaveElement) and getElementType(leaveElement) == "player" or getElementType(leaveElement) == "ped" then if (getElementData (hitElement, "zombie")) then--> its true if its not nil or false. killPed (hitElement) else toggleControl (hitElement, "fire", false ) toggleControl (hitElement, "aim_weapon", false) toggleControl (hitElement, "vehicle_fire", false) end end end addEventHandler( "onColShapeHit", safecol, enterZone ) function leaveZone(leaveElement, matchingDim) if not matchingDim then return end if isElement(leaveElement) and getElementType(leaveElement) == "player" or getElementType(leaveElement) == "ped" then if (getElementData (leaveElement, "zombie")) then--> I suppose a player cant be a zombie.. killPed (leaveElement) else toggleControl (leaveElement, "fire", true) toggleControl (leaveElement, "aim_weapon", true) toggleControl (leaveElement, "vehicle_fire", true) end end end addEventHandler( "onColShapeLeave", safecol, leaveZone ) 1 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