Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.46 KB | None | 0 0
  1. -- Interface
  2. ui.addTextArea ( 1, "<p align='center'><font size='9'><a href='event:show1'><font color='#009D9D'><i>Cargo <b>«Sheeprise»</b></i>", n, 325, 135, 70, 30, 1, 1, 0, false)
  3. ui.addTextArea ( 2, "<p align='center'><font size='9'><a href='event:show2'><font color='#EE799F'><i>Medalha <b>The First Cake</b></i>", n, 430, 135, 70, 30, 1, 1, 0, false)
  4. ui.addTextArea ( 3, "<p align='center'><font size='9'><a href='event:show3'><font color='#cd950c'><i>3.000 Sheep Coins</i>", n, 325, 183, 70, 30, 1, 1, 0, false)
  5. ui.addTextArea ( 4, "<p align='center'><font size='9'><a href='event:show4'><font color='#cd950c'><i>10.000 Sheep Coins</i>", n, 430, 183, 70, 30, 1, 1, 0, false)
  6. ui.addTextArea ( 5, "<p align='center'><font size='9'><a href='event:show5'><font color='#5CACEE'><i>5 <b>línguas de sogra</b></i>", n, 325, 234, 70, 30, 1, 1, 0, false)
  7. ui.addTextArea ( 6, "<p align='center'><font size='9'><a href='event:show6'><font color='#E0AA36'><i>20 <b>queijos</b> de inventário</i>", n, 430, 234, 70, 30, 1, 1, 0, false)
  8.  
  9. -- Informações: (primeiro valor é o nome do item, o segundo valor é o preço)
  10.  
  11. itensInfo = {[1]={"Cargo <b>«Sheeprise»</b>", 50}, [2]={"Medalha <b>The First Cake</b>", 50},
  12. [3]={"<b>3.000</b> Sheep Coins", 30}, [4]={"<b>10.000</b> Sheep Coins", 90},
  13. [5]={"5 <b>Línguas de Sogra</b> (consumível)", 50}, [6]={"20 <b>queijos</b>", 80}}
  14.  
  15. -- Função que mostra informações de um item (primeiro valor da função é o jogador, segundo valor é o ID do item (o valor que fica entre os [] na tabela de informações)
  16. -- info.pontos[n] é o valor de pontos que o jogador tem (você tem que alterar isso)
  17. function showItem (n, item)
  18. ui.addTextArea ( 4 + tfm.get.room.playerList[n].id, "<p align='center'><font color='#CD950C' size='9'>"..itensInfo[item][1], n, 300, 120, 200, 20, 0xFFFFFF, 0xCD950C, 0.9, true )
  19. ui.addTextArea ( 5 + tfm.get.room.playerList[n].id, "", n, 300, 140, 200, 140, 0xFFFFFF, 0xCD950C, 1, true )
  20. ui.addTextArea ( 6 + tfm.get.room.playerList[n].id, "<p align='center'><font color='#cd950c' size='10'><b>Nome: </b>"..itensInfo[item][1], n, 310, 150, 180, 20, 0xFFFFFF, 0xCD950C, 1, true )
  21. if itensInfo[item][2] <= info.pontos[n] then
  22. ui.addTextArea ( 7 + tfm.get.room.playerList[n].id, "<p align='center'><font color='#cd950c' size='10'><b>Preço: </b>"..itensInfo[item][2].." - <i>Saldo final: "..info.pontos[n] - itensInfo[item][2].."</i>", n, 310, 184, 180, 20, 0xFFFFFF, 0xCD950C, 1, true )
  23. ui.addTextArea ( 8 + tfm.get.room.playerList[n].id, "<p align='center'><font color='#cd950c'><a href='event:buy"..item.."'><b>Comprar</b>", n, 310, 218, 180, 20, 0xFFFFFF, 0xCD950C, 1, true )
  24. else
  25. ui.addTextArea ( 7 + tfm.get.room.playerList[n].id, "<p align='center'><font color='#cd950c' size='9'><b>Preço: </b>"..itensInfo[item][2].." - <i>Faltam: ".. itensInfo[item][2] - info.pontos[n].."</i>", n, 310, 184, 180, 20, 0xFFFFFF, 0xCD950C, 1, true )
  26. ui.addTextArea ( 8 + tfm.get.room.playerList[n].id, "<p align='center'><font color='#999999'><b>Comprar</b>", n, 310, 218, 180, 20, 0xFFFFFF, 0x999999, 1, true )
  27. end
  28. ui.addTextArea ( 9 + tfm.get.room.playerList[n].id, "<p align='center'><font color='#cd950c'><a href='event:fecharInfo'><b>Fechar</b>", n, 310, 252, 180, 20, 0xFFFFFF, 0xCD950C, 1, true )
  29. end
  30.  
  31. -- Isso aqui vai no textAreaCallback (n = jogador que clicou no callback)
  32. if :sub(1,4) == "show" then
  33. mostrarItem(n, tonumber(c:sub(5,#c)))
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement