Dolinho Posted October 14, 2014 Share Posted October 14, 2014 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
ReSe Posted October 14, 2014 Share Posted October 14, 2014 You mean you would like to count players? Link to comment
Dolinho Posted October 14, 2014 Author Share Posted October 14, 2014 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. Link to comment
ZL|LuCaS Posted October 14, 2014 Share Posted October 14, 2014 explain better add example: count = count + 1 every time the event is called Link to comment
Dolinho Posted October 14, 2014 Author Share Posted October 14, 2014 Total votes Like joining votes of all players in one panel? Link to comment
ZL|LuCaS Posted October 14, 2014 Share Posted October 14, 2014 Total votesLike 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
DNL291 Posted October 15, 2014 Share Posted October 15, 2014 Increasing a number using a string obviously it will not work. Link to comment
Dolinho Posted October 15, 2014 Author Share Posted October 15, 2014 Tested and not work. I really want to learn date. 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