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