Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mice = {}
- local s = 0
- local n = 0
- local admin = "Thetroz" --Sustituye esto por tu nombre
- function eventNewPlayer(name)
- if not mice[name] then
- mice[name] = {boolean = true}
- end
- end
- function main()
- for name in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
- system.disableChatCommandDisplay("p", true)
- end
- function nuevaPregunta(pregunta)
- s = 0
- n = 0
- ui.addTextArea(0, "<p align='center'><font size='15'>"..pregunta, nil, 254, 100, 300, 200, 0x003333, 0x000000, 1, true)
- resultados()
- for name in pairs(tfm.get.room.playerList) do
- mice[name].boolean = true
- end
- end
- function resultados()
- ui.addTextArea(1, "<a href='event:si'><font size='15'>Sí ("..s..")", nil, 280, 270, nil, nil, 0x000066, 0x000000, 1, true)
- ui.addTextArea(2, "<a href='event:no'><font size='15'>No ("..n..")", nil, 480, 270, nil, nil, 0x000066, 0x000000, 1, true)
- end
- function eventChatCommand(name, c)
- if c:sub(0,1) == "p" then
- if admin == name then
- nuevaPregunta(c:sub(2))
- end
- end
- end
- function eventTextAreaCallback(id, name, c)
- if c == "si" then
- if mice[name].boolean == true then
- print(name.." respondió 'Sí'")
- mice[name].boolean = false
- s = s + 1
- resultados()
- end
- elseif c == "no" then
- if mice[name].boolean == true then
- print(name.." respondió 'No'")
- mice[name].boolean = false
- n = n + 1
- resultados()
- end
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement