Advertisement
Hachem16

Menu Pad

Jan 5th, 2014
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.09 KB | None | 0 0
  1. see = [[<b><VP><a href="event:pad1">Menu Pad!</a></b>]]
  2. Fly = {}
  3. Info = [[
  4. <V> Hello and welcome to <VP>MenuPad<V> ! Here, you can use communly known commands but it A <VP>Pad<V> :)
  5. You can access this help menu when ever you want by writing <BL>!help<V> and for the Pad use <BL><a href="event:pad1">!pad</a><V>.
  6. <p align="right"><a href="event:close"><R>Close</a></p>
  7. ]]
  8. pad1 = [[
  9. <BL><a href="event:sham">Set Shaman</a> :<V> sets the specific mouse as a shaman.
  10. <BL><a href="event:snow">Snow</a> :<V> sets snow to the map.
  11. <BL><a href="event:map">Map</a> :<V> plays youre  map.
  12. <BL><a href="event:vamp">Vampire</a> :<V> sets the specific mouse as a vampire.
  13. <BL><a href="event:fly">Fly</a> :<V> Gives the ability to fly for the following mouse.
  14. <BL><a href="event:unfly">Unfly</a> :<V> Disable the ability to fly for the following mouse.
  15. <R><p align="center"><a href="event:close">Close</a></p>
  16.  
  17. ]]
  18. function eventNewPlayer(name)
  19.     tfm.exec.bindKeyboard(name, 32, true, true)
  20.     ui.addTextArea(0 , see, name, nil, nil, nil, nil, nil, nil, 0.92, true)
  21.     Fly[name]=false
  22. end
  23.  
  24. for p, player in pairs(tfm.get.room.playerList) do
  25.     eventNewPlayer(p)
  26. end
  27.  
  28. function eventTextAreaCallback(id, name, event)
  29.     if event=="sham" then
  30.         ui.addPopup(0, 2,[[<font size="16"><J><b>Player Name</b>:</font>]], name, nil, nil, nil, true)
  31.     elseif event=="snow" then
  32.         tfm.exec.snow()
  33.     elseif event=="map" then
  34.         ui.addPopup(1, 2, [[<font size="16"><J><b>Map code</b>:</font>]], name, nil, nil, nil, true)
  35.     elseif event=="vamp" then
  36.         ui.addPopup(2, 2, [[<font size="16"<J>><b>Player Name</b>:</font>]], name, nil, nil, nil, true)
  37.     elseif event=="pad1" then
  38.         ui.removeTextArea(see,name)
  39.         ui.addTextArea(1001, pad1, name, nil, nil, nil, nil, nil, nil, 0.92,  true)
  40.     elseif event=="close" then
  41.         ui.removeTextArea(id,name)
  42.         ui.addTextArea(0,'<b><VP><a href="event:pad1">Menu Pad!</a></b>',name,nil,nil,nil,nil,nil, nil, 0.92, true)
  43.     elseif event=="fly" then
  44.         tfm.exec.bindKeyboard(name, 32, true, true)
  45.         ui.addPopup(3, 2,[[<font size="16"><J><b>Player Name</b>:</font>]], name, nil, nil, nil, true)
  46.     elseif event=="unfly" then
  47.         ui.addPopup(4, 2,[[<font size="16"><J><b>Player Name</b>:</font>]], name, nil, nil, nil, true)
  48.     end
  49. end
  50.  
  51.        
  52. function eventKeyboard(name,key,down,x,y)
  53.     if Fly[name] then
  54.         if key==32 then
  55.             tfm.exec.movePlayer(name,0,0,true,0,-50,false)
  56.         end
  57.     end
  58. end
  59.        
  60. function eventPopupAnswer(id,name,answer)
  61.     if id==0  then
  62.         if answer==nil then
  63.             tfm.exec.setShaman(name)
  64.         elseif answer=="all" then
  65.             for name,player in pairs(tfm.get.room.playerList) do
  66.                 tfm.exec.setShaman(name)
  67.             end
  68.         else
  69.             tfm.exec.setShaman(answer)
  70.         end
  71.     elseif id==1 then
  72.         if answer~=nil then
  73.             tfm.exec.newGame(answer)
  74.         else
  75.             tfm.exec.newGame(math.random(0,210))
  76.         end
  77.     elseif id==2 then
  78.         if answer~=nil then
  79.             tfm.exec.setVampirePlayer(answer)
  80.         else
  81.             tfm.exec.setVampirePlayer(name)
  82.         end
  83.     elseif id==3 then
  84.         if answer~=nil then
  85.             Fly[answer]=true
  86.         else
  87.             Fly[name]=true
  88.         end
  89.     elseif id==4 then
  90.         if answer~=nil then
  91.             Fly[answer]=false
  92.         else
  93.             Fly[name]=true
  94.         end
  95.     end
  96. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement