ODutii Posted August 4, 2021 Share Posted August 4, 2021 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
CastiaL Posted August 4, 2021 Share Posted August 4, 2021 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) 1 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