Jump to content

sum total of points.


Dolinho

Recommended Posts

How can I see the total of all players in outputChatBox ?

call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Mod1", getRootElement(), 8, 0.07) 
addEvent("Votosparaum",true)  
addEventHandler("Votosparaum",root,  
function() 
local aScore = getElementData(source, 'Mod1') or 0 
setElementData(source, 'Mod1', aScore +1) 
outputChatBox("Jogador TESTE esta com "..aScore.." Votos",source, 10, 118, 240) 
end  
) 

Link to comment
Total votes

Like joining votes of all players in one panel?

  
--  setElementData(allPlayers,"Mod1",x+1) test function 
t = 0 
x = 0 
  for index, allPlayers in ipairs(getElementsByType("player")) do 
  setElementData(allPlayers,"Mod1",x+1) -- test function 
  local data = getAllElementData ( allPlayers ) 
  for k, v in pairs ( data ) do  
     if k == "Mod1" then   
        t = t+tostring ( v ) 
        outputDebugString(t) 
        end 
    end 
end 

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