Jump to content

sum total of points.


Dolinho

Recommended Posts

Posted

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  
) 

Posted

is a voting panel

each player adds +1 to return

the value that I have with the other player.

Summing the values ​​of all players and show full.

Posted
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 

MTA Scripters. ♥♥♥Beijinhos♥♥♥

Posted

Increasing a number using a string obviously it will not work.

Please do not PM me with scripting related question nor support, use the forums instead.

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