Jump to content

Players


developa

Recommended Posts

 

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

 

  • Like 1
Link to comment

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