Hadif Posted July 23, 2015 Share Posted July 23, 2015 (edited) How do I make a script that makes location limited? Example: If player get out from Los Santos, they will be kill or be warn. Any help will be appreciate, thank you! Edited August 3, 2015 by Guest Link to comment
LabiVila Posted July 23, 2015 Share Posted July 23, 2015 https://wiki.multitheftauto.com/wiki/CreateColSphere it can be done via this Link to comment
Hadif Posted July 23, 2015 Author Share Posted July 23, 2015 https://wiki.multitheftauto.com/wiki/CreateColSphereit can be done via this I'll try Link to comment
GTX Posted July 23, 2015 Share Posted July 23, 2015 If you want specifically Los Santos, I'd suggest: getZoneName It's much easier than creating col sphere Link to comment
Hadif Posted July 24, 2015 Author Share Posted July 24, 2015 If you want specifically Los Santos, I'd suggest: getZoneName It's much easier than creating col sphere this is much better and easier! Thanks bro! Link to comment
Hadif Posted July 24, 2015 Author Share Posted July 24, 2015 function theLocator(source) local allLocation = {"Los Santos", "Las Venturas"} local theLocation = getElementZoneName(source, true) for theKey, allLocation in pairs(allLocation) do if (theLocation == allLocation) then killPed(source) end end end function checkLocation() setTimer(theLocator(source), 1000, 0) end addEventHandler("onPlayerSpawn", getRootElement(), checkLocation) -- Test Command addCommandHandler("locator", theLocator) setTimer Problem! Link to comment
MTA Team 0xCiBeR Posted July 24, 2015 MTA Team Share Posted July 24, 2015 function theLocator(source) local allLocation = {"Los Santos", "Las Venturas"} local theLocation = getElementZoneName(source, true) for theKey, allLocation in pairs(allLocation) do if (theLocation == allLocation) then killPed(source) end end end function checkLocation() source = source setTimer(theLocator(source), 1000, 0) end addEventHandler("onPlayerSpawn", getRootElement(), checkLocation) -- Test Command addCommandHandler("locator", theLocator) Link to comment
Hadif Posted July 24, 2015 Author Share Posted July 24, 2015 function theLocator(source) local allLocation = {"Los Santos", "Las Venturas"} local theLocation = getElementZoneName(source, true) for theKey, allLocation in pairs(allLocation) do if (theLocation == allLocation) then killPed(source) end end end function checkLocation() source = source setTimer(theLocator(source), 1000, 0) end addEventHandler("onPlayerSpawn", getRootElement(), checkLocation) -- Test Command addCommandHandler("locator", theLocator) thanks dude! ill try... Link to comment
Hadif Posted July 24, 2015 Author Share Posted July 24, 2015 function theLocator(source) local allLocation = {"Los Santos", "Las Venturas"} local theLocation = getElementZoneName(source, true) for theKey, allLocation in pairs(allLocation) do if (theLocation == allLocation) then killPed(source) end end end function checkLocation() source = source setTimer(theLocator(source), 1000, 0) end addEventHandler("onPlayerSpawn", getRootElement(), checkLocation) -- Test Command addCommandHandler("locator", theLocator) STILL NOT WORKING! Link to comment
GTX Posted July 24, 2015 Share Posted July 24, 2015 function theLocator(source) local allLocation = {["Los Santos"]=true, ["Las Venturas"]=true} local theLocation = getElementZoneName(source, true) for i=1, #allLocation do if (allLocation[theLocation]) then killPed(source) end end end function checkLocation() source = source setTimer(theLocator, 1000, 0, source) end addEventHandler("onPlayerSpawn", getRootElement(), checkLocation) -- Test Command addCommandHandler("locator", theLocator) 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