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

My ingame nickname is Vaulthuntr.

Host a server?

CSGO_468x60.png

Join a server?

430x73_FFFFFF_FF9900_000000_000000.png

Posted

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

getZoneName 

It's much easier than creating col sphere

Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS.

Developer and owner of

https://projectbea.st - Project Beast
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!

My ingame nickname is Vaulthuntr.

Host a server?

CSGO_468x60.png

Join a server?

430x73_FFFFFF_FF9900_000000_000000.png

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!

My ingame nickname is Vaulthuntr.

Host a server?

CSGO_468x60.png

Join a server?

430x73_FFFFFF_FF9900_000000_000000.png

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

DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp

 
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:

My ingame nickname is Vaulthuntr.

Host a server?

CSGO_468x60.png

Join a server?

430x73_FFFFFF_FF9900_000000_000000.png

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!

My ingame nickname is Vaulthuntr.

Host a server?

CSGO_468x60.png

Join a server?

430x73_FFFFFF_FF9900_000000_000000.png

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) 

Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS.

Developer and owner of

https://projectbea.st - Project Beast

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...