Hadif Posted July 25, 2015 Share Posted July 25, 2015 Script: (Server) function theLocator() local allLocation = {"Las Venturas", "San Fierro", "Whetstone", "Flint County", "Red County", "Los Santos"} local theLocation = getElementZoneName(source, true) for theKey, allLocation in ipairs(allLocation) do if (theLocation == allLocation) then killPed(source) end end end setTimer(theLocator, 1000, 0) Debug: Bad argument @ 'getElementZoneName' [Expected element at argument 1, got nil] Link to comment
Sande Posted July 25, 2015 Share Posted July 25, 2015 Try this ( untested ): function theLocator() local allLocation = {"Las Venturas", "San Fierro", "Whetstone", "Flint County", "Red County", "Los Santos"} local players = getElementsByType ( "player" ) for i, source in ipairs ( players ) do local theLocation = getElementZoneName(source, true) for theKey, allLocation in ipairs(allLocation) do if (theLocation == allLocation) then killPed(source) end end end end function startLocator() setTimer ( theLocator, 1000, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), startLocator ) Link to comment
Simple0x47 Posted July 25, 2015 Share Posted July 25, 2015 The error I think is it on the 2nd argument, where's going to show you only Cities no Villages, you can try this. function theLocator() local allLocation = {"Las Venturas", "San Fierro", "Whetstone", "Flint County", "Red County", "Los Santos"} local theLocation = getElementZoneName( source ) for theKey, allLocation in ipairs(allLocation) do if (theLocation == allLocation) then killPed(source) end end end setTimer(theLocator, 1000, 0) Link to comment
Hadif Posted July 25, 2015 Author Share Posted July 25, 2015 The error I think is it on the 2nd argument, where's going to show you only Cities no Villages, you can try this. function theLocator() local allLocation = {"Las Venturas", "San Fierro", "Whetstone", "Flint County", "Red County", "Los Santos"} local theLocation = getElementZoneName( source ) for theKey, allLocation in ipairs(allLocation) do if (theLocation == allLocation) then killPed(source) end end end setTimer(theLocator, 1000, 0) urmmm, ill try it! Link to comment
Hadif Posted July 25, 2015 Author Share Posted July 25, 2015 Try this ( untested ): function theLocator() local allLocation = {"Las Venturas", "San Fierro", "Whetstone", "Flint County", "Red County", "Los Santos"} local players = getElementsByType ( "player" ) for i, source in ipairs ( players ) do local theLocation = getElementZoneName(source, true) for theKey, allLocation in ipairs(allLocation) do if (theLocation == allLocation) then killPed(source) end end end end function startLocator() setTimer ( theLocator, 1000, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), startLocator ) alright! Link to comment
Hadif Posted July 25, 2015 Author Share Posted July 25, 2015 Try this ( untested ): function theLocator() local allLocation = {"Las Venturas", "San Fierro", "Whetstone", "Flint County", "Red County", "Los Santos"} local players = getElementsByType ( "player" ) for i, source in ipairs ( players ) do local theLocation = getElementZoneName(source, true) for theKey, allLocation in ipairs(allLocation) do if (theLocation == allLocation) then killPed(source) end end end end function startLocator() setTimer ( theLocator, 1000, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), startLocator ) thank you very very very much sande... i appreciate yr help , may god bless you and keep you! feel free to join my server soon! 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