Jump to content

Criar uma lista de uma acl


Recommended Posts

local all_players = getElementsByType("player")
for num,this_player in ipairs(all_players) do
		if getElementData(this_player,"Officer") then
        dxDrawText(num, x*696, y*230, x*913, y*268, tocolor(240, 240, 240, 200), 0.90, fonte, "center", "center", false, true, true, false, false)
end
end

Ex. in game: Officers Online: 3

Nessa dxDraw eu quero que apareça a quantidade de elementos que estão salvo na data 'Officer'. Não sei o que falta e não faço ideia do que preciso, podem me ajudar?

Link to comment

this code is wrong, it will work if you change it to below code
 

local total_officers = 0
local all_players = getElementsByType("player")
for num,this_player in ipairs(all_players) do
		if getElementData(this_player,"Officer") then
    		total_officers = total_officers + 1
		end
end
dxDrawText(total_officers, x*696, y*230, x*913, y*268, tocolor(240, 240, 240, 200), 0.90, fonte, "center", "center", false, true, true, false, false)

 

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