Jump to content

Solve: Limited Location


Hadif

Recommended Posts

Posted (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 by Guest
Posted

If you want specifically Los Santos, I'd suggest:

getZoneName 

It's much easier than creating col sphere

Posted
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!

Posted

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!

  • MTA Team
Posted
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) 

Posted
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... :roll::roll::roll:

Posted
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!

Posted
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) 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...