Guest User

SimS

a guest
Aug 8th, 2010
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.08 KB | None | 0 0
  1. GUIEditor3_Window = {}
  2. GUIEditor3_TabPanel = {}
  3. GUIEditor3_Tab = {}
  4. GUIEditor3_Button = {}
  5. GUIEditor3_Memo = {}
  6. GUIEditor3_Label = {}
  7. GUIEditor3_Edit = {}
  8. GUIEditor3_Image = {}
  9.  
  10. local screenWidth, screenHeight = guiGetScreenSize()
  11. local windowWidth, windowHeight = 660, 500
  12. local left = screenWidth/2 - windowWidth/2
  13. local top = screenHeight/2 - windowHeight/2
  14.  
  15. GUIEditor3_Window[1] = guiCreateWindow(left, top, windowWidth, windowHeight,"Escolha sua classe",false)
  16. guiSetAlpha(GUIEditor3_Window[1],1)
  17. guiWindowSetSizable(GUIEditor3_Window[1],false)
  18. GUIEditor3_Button[1] = guiCreateButton(164,39,103,94,"",false,GUIEditor3_Window[1])
  19. guiSetProperty(GUIEditor3_Button[1],"AlwaysOnTop","true")
  20. GUIEditor3_Image[1] = guiCreateStaticImage(8,7,86,79,"images/icons/PoliceIcon.png",false,GUIEditor3_Button[1])
  21. guiSetAlpha(GUIEditor3_Image[1],1)
  22. guiMoveToBack(GUIEditor_Image[1])
  23. GUIEditor3_Button[2] = guiCreateButton(164,153,103,94,"",false,GUIEditor3_Window[1])
  24. guiSetAlpha(GUIEditor3_Button[2],1)
  25. guiSetProperty(GUIEditor3_Button[2],"AlwaysOnTop","true")
  26. GUIEditor3_Image[2] = guiCreateStaticImage(7,6,88,82,"images/icons/ArmyIcon.png",false,GUIEditor3_Button[2])
  27. guiSetAlpha(GUIEditor3_Image[2],1)
  28. guiMoveToBack(GUIEditor_Image[2])
  29. GUIEditor3_Button[3] = guiCreateButton(164,268,103,94,"",false,GUIEditor3_Window[1])
  30. guiSetAlpha(GUIEditor3_Button[3],1)
  31. guiSetProperty(GUIEditor3_Button[3],"AlwaysOnTop","true")
  32. GUIEditor3_Image[3] = guiCreateStaticImage(8,7,87,79,"images/icons/MedicIcon.png",false,GUIEditor3_Button[3])
  33. guiSetAlpha(GUIEditor3_Image[3],1)
  34. guiMoveToBack(GUIEditor_Image[3])
  35. GUIEditor3_Button[4] = guiCreateButton(164,384,103,90,"",false,GUIEditor3_Window[1])
  36. guiSetAlpha(GUIEditor3_Button[4],1)
  37. guiSetProperty(GUIEditor3_Button[4],"AlwaysOnTop","true")
  38. GUIEditor3_Image[4] = guiCreateStaticImage(36,6,28,78,"images/icons/SurvivorIcon.png",false,GUIEditor3_Button[4])
  39. guiSetAlpha(GUIEditor3_Image[4],1)
  40. guiMoveToBack(GUIEditor_Image[4])
  41. GUIEditor3_Label[1] = guiCreateLabel(281,395,68,21,"Civil",false,GUIEditor3_Window[1])
  42. guiSetAlpha(GUIEditor3_Label[1],1)
  43. guiLabelSetColor(GUIEditor3_Label[1],255,255,255)
  44. guiLabelSetVerticalAlign(GUIEditor3_Label[1],"top")
  45. guiLabelSetHorizontalAlign(GUIEditor3_Label[1],"left",false)
  46. guiSetFont(GUIEditor3_Label[1],"default-bold-small")
  47. GUIEditor3_Label[2] = guiCreateLabel(281,417,339,46,"Escolhendo esta classe, voce aparecera sempre no Glen Park.\nPossui armas exclusivas e acesso facil a veiculos de varios \ntipos.",false,GUIEditor3_Window[1])
  48. guiSetAlpha(GUIEditor3_Label[2],1)
  49. guiLabelSetColor(GUIEditor3_Label[2],255,255,255)
  50. guiLabelSetVerticalAlign(GUIEditor3_Label[2],"top")
  51. guiLabelSetHorizontalAlign(GUIEditor3_Label[2],"left",false)
  52. GUIEditor3_Label[3] = guiCreateLabel(281,52,77,21,"Policia Local",false,GUIEditor3_Window[1])
  53. guiSetAlpha(GUIEditor3_Label[3],1)
  54. guiLabelSetColor(GUIEditor3_Label[3],255,255,255)
  55. guiLabelSetVerticalAlign(GUIEditor3_Label[3],"top")
  56. guiLabelSetHorizontalAlign(GUIEditor3_Label[3],"left",false)
  57. guiSetFont(GUIEditor3_Label[3],"default-bold-small")
  58. GUIEditor3_Label[4] = guiCreateLabel(281,74,340,49,"Escolhendo esta classe, voce aparecera sempre na delegacia.\nPossui armas exclusivas e acesso facil a carros de policia e \nequipamentos da S.W.A.T.",false,GUIEditor3_Window[1])
  59. guiSetAlpha(GUIEditor3_Label[4],1)
  60. guiLabelSetColor(GUIEditor3_Label[4],255,255,255)
  61. guiLabelSetVerticalAlign(GUIEditor3_Label[4],"top")
  62. guiLabelSetHorizontalAlign(GUIEditor3_Label[4],"left",false)
  63. GUIEditor3_Label[5] = guiCreateLabel(281,168,77,21,"Exercito",false,GUIEditor3_Window[1])
  64. guiSetAlpha(GUIEditor3_Label[5],1)
  65. guiLabelSetColor(GUIEditor3_Label[5],255,255,255)
  66. guiLabelSetVerticalAlign(GUIEditor3_Label[5],"top")
  67. guiLabelSetHorizontalAlign(GUIEditor3_Label[5],"left",false)
  68. guiSetFont(GUIEditor3_Label[5],"default-bold-small")
  69. GUIEditor3_Label[6] = guiCreateLabel(281,188,337,48,"Escolhendo esta classe, voce aparecera sempre na Area 69.\nPossui armas exclusivas e acesso facil a carros e helicopteros\nde propriedade do exercito.",false,GUIEditor3_Window[1])
  70. guiSetAlpha(GUIEditor3_Label[6],1)
  71. guiLabelSetColor(GUIEditor3_Label[6],255,255,255)
  72. guiLabelSetVerticalAlign(GUIEditor3_Label[6],"top")
  73. guiLabelSetHorizontalAlign(GUIEditor3_Label[6],"left",false)
  74. GUIEditor3_Label[7] = guiCreateLabel(281,280,77,21,"Paramedico",false,GUIEditor3_Window[1])
  75. guiSetAlpha(GUIEditor3_Label[7],1)
  76. guiLabelSetColor(GUIEditor3_Label[7],255,255,255)
  77. guiLabelSetVerticalAlign(GUIEditor3_Label[7],"top")
  78. guiLabelSetHorizontalAlign(GUIEditor3_Label[7],"left",false)
  79. guiSetFont(GUIEditor3_Label[7],"default-bold-small")
  80. GUIEditor3_Label[8] = guiCreateLabel(281,302,329,48,"Escolhendo esta classe, voce aparecera sempre no Hospital.\nPossui armas exclusivas, pode curar e possui acesso facil a \nveiculos medicos.",false,GUIEditor3_Window[1])
  81. guiSetAlpha(GUIEditor3_Label[8],1)
  82. guiLabelSetColor(GUIEditor3_Label[8],255,255,255)
  83. guiLabelSetVerticalAlign(GUIEditor3_Label[8],"top")
  84. guiLabelSetHorizontalAlign(GUIEditor3_Label[8],"left",false)
  85. GUIEditor3_Image[5] = guiCreateStaticImage(33,47,114,40,"images/guns/m4.png",false,GUIEditor3_Window[1])
  86. guiSetAlpha(GUIEditor3_Image[5],1)
  87. GUIEditor3_Image[6] = guiCreateStaticImage(33,86,114,40,"images/guns/deagle.png",false,GUIEditor3_Window[1])
  88. guiSetAlpha(GUIEditor3_Image[6],1)
  89. GUIEditor3_Image[7] = guiCreateStaticImage(33,159,114,40,"images/guns/m4.png",false,GUIEditor3_Window[1])
  90. guiSetAlpha(GUIEditor3_Image[7],1)
  91. GUIEditor3_Image[8] = guiCreateStaticImage(33,199,114,40,"images/guns/deagle.png",false,GUIEditor3_Window[1])
  92. guiSetAlpha(GUIEditor3_Image[8],1)
  93. GUIEditor3_Image[9] = guiCreateStaticImage(33,278,114,40,"images/guns/shotgun.png",false,GUIEditor3_Window[1])
  94. guiSetAlpha(GUIEditor3_Image[9],1)
  95. GUIEditor3_Image[10] = guiCreateStaticImage(33,310,114,40,"images/guns/deagle.png",false,GUIEditor3_Window[1])
  96. guiSetAlpha(GUIEditor3_Image[10],1)
  97. GUIEditor3_Image[11] = guiCreateStaticImage(33,387,114,40,"images/guns/ak47.png",false,GUIEditor3_Window[1])
  98. guiSetAlpha(GUIEditor3_Image[11],1)
  99. GUIEditor3_Image[12] = guiCreateStaticImage(33,429,114,40,"images/guns/deagle.png",false,GUIEditor3_Window[1])
  100. guiSetAlpha(GUIEditor3_Image[12],1)
  101.  
  102. guiSetVisible ( GUIEditor3_Window[1], false )
  103.  
  104. local localPlayer = getLocalPlayer ( )
  105. local playername = getPlayerName(localPlayer)
  106.  
  107. function windowTeamHandler( )
  108.  
  109.     guiSetVisible ( GUIEditor3_Window[1], true )
  110.  
  111.     guiSetInputEnabled(true)
  112.     showCursor ( true )
  113. end
  114.  
  115. addEvent( "windowTeamHandler", true )
  116. addEventHandler( "windowTeamHandler", getRootElement(), windowTeamHandler )
  117.  
  118. function onClickBtn ( button, state )
  119.     if (source == GUIEditor3_Button[1]) then
  120.         triggerServerEvent ( "onProceedTeam", getRootElement(), localPlayer, "police" )
  121.     end
  122. end
  123.  
  124. function onClickBtn2 ( button, state )
  125.     if (source == GUIEditor3_Button[2]) then
  126.         triggerServerEvent ( "onProceedTeam", getRootElement(), localPlayer, "army" )
  127.     end
  128. end
  129.  
  130. function onClickBtn3 ( button, state )
  131.     if (source == GUIEditor3_Button[3]) then
  132.         triggerServerEvent ( "onProceedTeam", getRootElement(), localPlayer, "medic" )
  133.     end
  134. end
  135.  
  136. function onClickBtn4 ( button, state )
  137.     if (source == GUIEditor3_Button[4]) then
  138.         triggerServerEvent ( "onProceedTeam", getRootElement(), localPlayer, "civilian" )
  139.     end
  140. end
  141.  
  142. function hideLoginWindow3()
  143.     guiSetInputEnabled(false)
  144.     guiSetVisible ( GUIEditor3_Window[1], false )
  145.     showCursor ( false )
  146. end
  147.  
  148. addEvent( "hideLoginWindow3", true )
  149. addEventHandler( "hideLoginWindow3", getRootElement(), hideLoginWindow3 )
  150.  
  151. function hideLoginWindowSpawn2()
  152.     guiSetInputEnabled(false)
  153.     guiSetVisible ( GUIEditor_Window[1], false )
  154.     showCursor ( false )
  155.     triggerServerEvent ( "onPlayerSpawn", player, player )
  156. end
  157.  
  158. addEvent( "hideLoginWindowSpawn2", true )
  159. addEventHandler( "hideLoginWindowSpawn2", getRootElement(), hideLoginWindowSpawn2 )
  160.  
  161. addEventHandler ( "onClientGUIClick", GUIEditor3_Button[1], onClickBtn, false )
  162. addEventHandler ( "onClientGUIClick", GUIEditor3_Button[2], onClickBtn2, false )
  163. addEventHandler ( "onClientGUIClick", GUIEditor3_Button[3], onClickBtn3, false )
  164. addEventHandler ( "onClientGUIClick", GUIEditor3_Button[4], onClickBtn4, false )
Advertisement
Add Comment
Please, Sign In to add comment