developa Posted September 11, 2017 Share Posted September 11, 2017 Hello, how to download players using this feature? I need this to refresh the data for the players in the marker. function getElementsWithinMarker(marker) if (not isElement(marker) or getElementType(marker) ~= "marker") then return false end local markerColShape = getElementColShape(marker) local elements = getElementsWithinColShape(markerColShape) return elements end I tried this way: addEvent("buy" true) addEventHandler("buy", resourceRoot, function() local players = getElementsWithinMarker(marker) for i,v in ipairs(players) do outputChatBox(v) triggerClientEvent(v, "refresh", resourceRoot) end end) outputChatBox(v) - here is the warning - bad argument @ 'outputChatBox' [expected string at argument 1, got text] Help! Link to comment
Dimos7 Posted September 11, 2017 Share Posted September 11, 2017 function getElementsWithinMarker(marker) if (not isElement(marker) or getElementType(marker) ~= "marker") then return false end local markerColShape = getElementColShape(marker) local elements = getElementsWithinColShape(markerColShape) return elements end addEvent("buy" true) addEventHandler("buy", resourceRoot, function() local players = getElementsWithinMarker(marker) for i,v in ipairs(players) do outputChatBox(tostring(v)) triggerClientEvent(v, "refresh", resourceRoot) end end) 1 Link to comment
developa Posted September 11, 2017 Author Share Posted September 11, 2017 (edited) If I send it to the client side, it will update for the specified players in the marker or change it triggerClientEvent(v, "refresh", resourceRoot) on triggerClientEvent(tostring(v), "refresh", resourceRoot) ? Both versions do not work! The trigger does not send at all. What to do? Edited September 11, 2017 by developa Link to comment
developa Posted September 11, 2017 Author Share Posted September 11, 2017 (edited) It does not work, trigger does not send, no errors Edited September 11, 2017 by developa 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