Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.07 KB | None | 0 0
  1. local screenWidth, screenHeight = guiGetScreenSize()
  2. local scaleX = screenWidth/1920
  3. local scaleY = screenHeight/1080
  4. local screenWidth, screenHeight = guiGetScreenSize()
  5. local scaleX = screenWidth/1920
  6. local scaleY = screenHeight/1080
  7.  
  8. Logowanie_PL = {
  9. button = {},
  10. staticimage = {},
  11. edit = {}
  12. }
  13. Logowanie_EN = {
  14. button = {},
  15. staticimage = {},
  16. edit = {}
  17. }
  18. Wybor_Jezyka = {
  19. button = {},
  20. staticimage = {}
  21.  
  22. }
  23. Zarzadzanie_PL = {
  24. button = {},
  25. staticimage = {},
  26. edit = {}
  27. }
  28. Zarzadzanie_EN = {
  29. button = {},
  30. staticimage = {},
  31. edit = {}
  32. }
  33. Tworzenie_PL = {
  34. button = {},
  35. staticimage = {},
  36. combobox = {},
  37. edit = {}
  38. }
  39. Tworzenie_EN = {
  40. button = {},
  41. staticimage = {},
  42. combobox = {},
  43. edit = {}
  44. }
  45. Wybor_Spawnu_EN = {
  46. gridlist = {},
  47. staticimage = {},
  48. button = {}
  49. }
  50. Wybor_Spawnu_PL = {
  51. gridlist = {},
  52. staticimage = {},
  53. button = {}
  54. }
  55. Wybor_Pracy_PL = {
  56. gridlist = {},
  57. staticimage = {},
  58. button = {}
  59. }
  60. Wybor_Pracy_EN = {
  61. gridlist = {},
  62. staticimage = {},
  63. button = {}
  64. }
  65. Wybor_Pracy_EN.staticimage[1] = guiCreateStaticImage(0.64, 0.33, 0.33, 0.37, "images/druzyna_en.png", true)
  66. Wybor_Pracy_EN.button[1] = guiCreateButton(0.39, 0.81, 0.21, 0.10, "wybierz", true, Wybor_Pracy_EN.staticimage[1])
  67. guiSetAlpha(Wybor_Pracy_EN.button[1], 0.00)
  68. Wybor_Pracy_EN.gridlist[1] = guiCreateGridList(38*scaleX, 40*scaleY, 561*scaleX, 266*scaleY, false, Wybor_Pracy_EN.staticimage[1])
  69. guiGridListAddColumn(Wybor_Pracy_EN.gridlist[1], "Online team::", 0.9)
  70. for i = 1, 6 do
  71. guiGridListAddRow(Wybor_Pracy_EN.gridlist[1])
  72. end
  73. guiGridListSetItemText(Wybor_Pracy_EN.gridlist[1], 0, 1, "Truckers", false, false)
  74. guiGridListSetItemText(Wybor_Pracy_EN.gridlist[1], 1, 1, "Police", false, false)
  75. guiGridListSetItemText(Wybor_Pracy_EN.gridlist[1], 2, 1, "Taxi", false, false)
  76. guiGridListSetItemText(Wybor_Pracy_EN.gridlist[1], 3, 1, "Medic", false, false)
  77. guiGridListSetItemText(Wybor_Pracy_EN.gridlist[1], 4, 1, "Final Build", false, false)
  78. guiGridListSetItemText(Wybor_Pracy_EN.gridlist[1], 5, 1, "BP Ultimate", false, false)
  79. guiGridListSetItemText(Wybor_Pracy_EN.gridlist[1], 6, 1, "Fresh Logistic", false, false)
  80. Wybor_Pracy_PL.staticimage[1] = guiCreateStaticImage(0.64, 0.33, 0.33, 0.37, "images/druzyna_pl.png", true)
  81. Wybor_Pracy_PL.button[1] = guiCreateButton(0.39, 0.81, 0.21, 0.10, "wybierz", true, Wybor_Pracy_PL.staticimage[1])
  82. guiSetAlpha(Wybor_Pracy_PL.button[1], 0.00)
  83. Wybor_Pracy_PL.gridlist[1] = guiCreateGridList(38*scaleX, 40*scaleY, 561*scaleX, 266*scaleY, false, Wybor_Pracy_PL.staticimage[1])
  84. guiGridListAddColumn(Wybor_Pracy_PL.gridlist[1], "Dostępne druzyny:", 0.9)
  85. for i = 1, 6 do
  86. guiGridListAddRow(Wybor_Pracy_PL.gridlist[1])
  87. end
  88. guiGridListSetItemText(Wybor_Pracy_PL.gridlist[1], 0, 1, "Truckerzy", false, false)
  89. guiGridListSetItemText(Wybor_Pracy_PL.gridlist[1], 1, 1, "Policja", false, false)
  90. guiGridListSetItemText(Wybor_Pracy_PL.gridlist[1], 2, 1, "Taxi", false, false)
  91. guiGridListSetItemText(Wybor_Pracy_PL.gridlist[1], 3, 1, "Pogotowie", false, false)
  92. guiGridListSetItemText(Wybor_Pracy_PL.gridlist[1], 4, 1, "Final Build", false, false)
  93. guiGridListSetItemText(Wybor_Pracy_PL.gridlist[1], 5, 1, "BP Ultimate", false, false)
  94. guiGridListSetItemText(Wybor_Pracy_PL.gridlist[1], 6, 1, "Fresh Logistic", false, false)
  95. Wybor_Spawnu_PL.staticimage[1] = guiCreateStaticImage(0.64, 0.33, 0.33, 0.37, "images/spawn_pl.png", true)
  96. Wybor_Spawnu_PL.button[1] = guiCreateButton(0.39, 0.81, 0.21, 0.10, "wybierz", true, Wybor_Spawnu_PL.staticimage[1])
  97. guiSetAlpha(Wybor_Spawnu_PL.button[1], 0.00)
  98. Wybor_Spawnu_PL.gridlist[1] = guiCreateGridList(38*scaleX, 40*scaleY, 561*scaleX, 266*scaleY, false, Wybor_Spawnu_PL.staticimage[1])
  99. guiGridListAddColumn(Wybor_Spawnu_PL.gridlist[1], "Dostępne mejsca spawnu:", 0.9)
  100. for i = 1, 3 do
  101. guiGridListAddRow(Wybor_Spawnu_PL.gridlist[1])
  102. end
  103. guiGridListSetItemText(Wybor_Spawnu_PL.gridlist[1], 0, 1, "San Fierro", false, false)
  104. guiGridListSetItemText(Wybor_Spawnu_PL.gridlist[1], 1, 1, "Los Santos", false, false)
  105. guiGridListSetItemText(Wybor_Spawnu_PL.gridlist[1], 2, 1, "Las Venturas", false, false)
  106. Wybor_Spawnu_EN.staticimage[1] = guiCreateStaticImage(0.64, 0.33, 0.33, 0.37, "images/spawn_en.png", true)
  107. Wybor_Spawnu_EN.button[1] = guiCreateButton(0.39, 0.81, 0.21, 0.10, "wybierz", true, Wybor_Spawnu_EN.staticimage[1])
  108. guiSetAlpha(Wybor_Spawnu_EN.button[1], 0.00)
  109. Wybor_Spawnu_EN.gridlist[1] = guiCreateGridList(38*scaleX, 40*scaleY, 561*scaleX, 266*scaleY, false, Wybor_Spawnu_EN.staticimage[1])
  110. guiGridListAddColumn(Wybor_Spawnu_EN.gridlist[1], "Online spawn points:", 0.9)
  111. for i = 1, 3 do
  112. guiGridListAddRow(Wybor_Spawnu_EN.gridlist[1])
  113. end
  114. guiGridListSetItemText(Wybor_Spawnu_EN.gridlist[1], 0, 1, "San Fierro", false, false)
  115. guiGridListSetItemText(Wybor_Spawnu_EN.gridlist[1], 1, 1, "Los Santos", false, false)
  116. guiGridListSetItemText(Wybor_Spawnu_EN.gridlist[1], 2, 1, "Las Venturas", false, false)
  117. Tworzenie_PL.staticimage[1] = guiCreateStaticImage(0.41, 0.63, 0.33, 0.38, "images/tworzenie_pl.png", true)
  118. Tworzenie_PL.edit[1] = guiCreateEdit(0.08, 0.24, 0.23, 0.10, "imie", true, Tworzenie_PL.staticimage[1])
  119. Tworzenie_PL.edit[2] = guiCreateEdit(0.08, 0.57, 0.23, 0.10, "Naziwsko", true, Tworzenie_PL.staticimage[1])
  120. Tworzenie_PL.edit[3] = guiCreateEdit(0.66, 0.58, 0.23, 0.10, "Wiek", true, Tworzenie_PL.staticimage[1])
  121. Tworzenie_PL.combobox[1] = guiCreateComboBox(0.66, 0.24, 0.25, 0.18, "", true, Tworzenie_PL.staticimage[1])
  122. guiComboBoxAddItem(Tworzenie_PL.combobox[1], "Meżczyzna")
  123. guiComboBoxAddItem(Tworzenie_PL.combobox[1], "Kobieta")
  124. Tworzenie_PL.button[1] = guiCreateButton(0.08, 0.87, 0.20, 0.11, "Tworz", true, Tworzenie_PL.staticimage[1])
  125. guiSetAlpha(Tworzenie_PL.button[1], 0.00)
  126. Tworzenie_PL.button[2] = guiCreateButton(0.66, 0.85, 0.20, 0.11, "Anuluj", true, Tworzenie_PL.staticimage[1])
  127. guiSetAlpha(Tworzenie_PL.button[2], 0.00)
  128. Tworzenie_EN.staticimage[1] = guiCreateStaticImage(0.41, 0.63, 0.33, 0.38, "images/tworzenie_en.png", true)
  129. Tworzenie_EN.edit[1] = guiCreateEdit(0.08, 0.24, 0.23, 0.10, "imie", true, Tworzenie_EN.staticimage[1])
  130. Tworzenie_EN.edit[2] = guiCreateEdit(0.08, 0.57, 0.23, 0.10, "Naziwsko", true, Tworzenie_EN.staticimage[1])
  131. Tworzenie_EN.edit[3] = guiCreateEdit(0.66, 0.58, 0.23, 0.10, "Wiek", true, Tworzenie_EN.staticimage[1])
  132. Tworzenie_EN.combobox[1] = guiCreateComboBox(0.66, 0.24, 0.25, 0.18, "", true, Tworzenie_EN.staticimage[1])
  133. guiComboBoxAddItem(Tworzenie_EN.combobox[1], "Meżczyzna")
  134. guiComboBoxAddItem(Tworzenie_EN.combobox[1], "Kobieta")
  135. Tworzenie_EN.button[1] = guiCreateButton(0.08, 0.87, 0.20, 0.11, "Tworz", true, Tworzenie_EN.staticimage[1])
  136. guiSetAlpha(Tworzenie_EN.button[1], 0.00)
  137. Tworzenie_EN.button[2] = guiCreateButton(0.66, 0.85, 0.20, 0.11, "Anuluj", true, Tworzenie_EN.staticimage[1])
  138. guiSetAlpha(Tworzenie_EN.button[2], 0.00)
  139. Zarzadzanie_PL.staticimage[1] = guiCreateStaticImage(0.65, 0.30, 0.35, 0.33, "images/Zarzadzanie_pl.png", true)
  140. Zarzadzanie_PL.button[1] = guiCreateButton(0.68, 0.22, 0.25, 0.09, "tworz", true, Zarzadzanie_PL.staticimage[1])
  141. guiSetAlpha(Zarzadzanie_PL.button[1], 0.00)
  142. Zarzadzanie_PL.button[2] = guiCreateButton(0.67, 0.40, 0.25, 0.09, "dalejtworz", true, Zarzadzanie_PL.staticimage[1])
  143. guiSetAlpha(Zarzadzanie_PL.button[2], 0.00)
  144. Zarzadzanie_PL.button[3] = guiCreateButton(0.68, 0.58, 0.25, 0.09, "dalejtworz", true, Zarzadzanie_PL.staticimage[1])
  145. guiSetAlpha(Zarzadzanie_PL.button[3], 0.00)
  146. Zarzadzanie_PL.button[4] = guiCreateButton(0.66, 0.75, 0.25, 0.09, "dalejtworz", true, Zarzadzanie_PL.staticimage[1])
  147. guiSetAlpha(Zarzadzanie_PL.button[4], 0.00)
  148. Zarzadzanie_PL.edit[1] = guiCreateEdit(0.03, 0.23, 0.27, 0.08, "", true, Zarzadzanie_PL.staticimage[1])
  149. Zarzadzanie_PL.edit[2] = guiCreateEdit(0.03, 0.43, 0.27, 0.08, "", true, Zarzadzanie_PL.staticimage[1])
  150. Zarzadzanie_PL.edit[3] = guiCreateEdit(0.03, 0.64, 0.27, 0.08, "", true, Zarzadzanie_PL.staticimage[1])
  151. Zarzadzanie_PL.edit[4] = guiCreateEdit(0.03, 0.81, 0.27, 0.08, "", true, Zarzadzanie_PL.staticimage[1])
  152. Zarzadzanie_EN.staticimage[1] = guiCreateStaticImage(0.65, 0.30, 0.35, 0.33, "images/Zarzadzanie_en.png", true)
  153. Zarzadzanie_EN.button[1] = guiCreateButton(0.68, 0.22, 0.25, 0.09, "tworz", true, Zarzadzanie_EN.staticimage[1])
  154. guiSetAlpha(Zarzadzanie_EN.button[1], 0.00)
  155. Zarzadzanie_EN.button[2] = guiCreateButton(0.67, 0.40, 0.25, 0.09, "dalejtworz", true, Zarzadzanie_EN.staticimage[1])
  156. guiSetAlpha(Zarzadzanie_EN.button[2], 0.00)
  157. Zarzadzanie_EN.button[3] = guiCreateButton(0.68, 0.58, 0.25, 0.09, "dalejtworz", true, Zarzadzanie_EN.staticimage[1])
  158. guiSetAlpha(Zarzadzanie_EN.button[3], 0.00)
  159. Zarzadzanie_EN.button[4] = guiCreateButton(0.66, 0.75, 0.25, 0.09, "dalejtworz", true, Zarzadzanie_EN.staticimage[1])
  160. guiSetAlpha(Zarzadzanie_EN.button[4], 0.00)
  161. Zarzadzanie_EN.edit[1] = guiCreateEdit(0.03, 0.23, 0.27, 0.08, "", true, Zarzadzanie_EN.staticimage[1])
  162. Zarzadzanie_EN.edit[2] = guiCreateEdit(0.03, 0.43, 0.27, 0.08, "", true, Zarzadzanie_EN.staticimage[1])
  163. Zarzadzanie_EN.edit[3] = guiCreateEdit(0.03, 0.64, 0.27, 0.08, "", true, Zarzadzanie_EN.staticimage[1])
  164. Zarzadzanie_EN.edit[4] = guiCreateEdit(0.03, 0.81, 0.27, 0.08, "", true, Zarzadzanie_EN.staticimage[1])
  165. Logowanie_PL.staticimage[1] = guiCreateStaticImage(0.59, 0.29, 0.41, 0.38, "images/logowanie_pl.png", true)
  166. Logowanie_PL.button[1] = guiCreateButton(0.27, 0.83, 0.22, 0.08, "Loguj", true, Logowanie_PL.staticimage[1])
  167. guiSetAlpha(Logowanie_PL.button[1], 0.00)
  168. Logowanie_PL.button[2] = guiCreateButton(0.56, 0.83, 0.22, 0.08, "Ree", true, Logowanie_PL.staticimage[1])
  169. guiSetAlpha(Logowanie_PL.button[2], 0.00)
  170. Logowanie_PL.edit[1] = guiCreateEdit(0.34, 0.32, 0.38, 0.06, "Login", true, Logowanie_PL.staticimage[1])
  171. Logowanie_PL.edit[2] = guiCreateEdit(0.34, 0.48, 0.38, 0.06, "Haslo", true, Logowanie_PL.staticimage[1])
  172. guiEditSetMasked(Logowanie_PL.edit[2], true)
  173. Logowanie_EN.staticimage[1] = guiCreateStaticImage(0.59, 0.29, 0.41, 0.38, "images/logowanie_en.png", true)
  174. Logowanie_EN.button[1] = guiCreateButton(0.27, 0.83, 0.22, 0.08, "Loguj", true, Logowanie_EN.staticimage[1])
  175. guiSetAlpha(Logowanie_EN.button[1], 0.00)
  176. Logowanie_EN.button[2] = guiCreateButton(0.56, 0.83, 0.22, 0.08, "Ree", true, Logowanie_EN.staticimage[1])
  177. guiSetAlpha(Logowanie_EN.button[2], 0.00)
  178. Logowanie_EN.edit[1] = guiCreateEdit(0.34, 0.32, 0.38, 0.06, "Username", true, Logowanie_EN.staticimage[1])
  179. Logowanie_EN.edit[2] = guiCreateEdit(0.34, 0.48, 0.38, 0.06, "Password", true, Logowanie_EN.staticimage[1])
  180. guiEditSetMasked(Logowanie_EN.edit[2], true)
  181. Wybor_Jezyka.staticimage[1] = guiCreateStaticImage(0.56, 0.31, 0.44, 0.36, "images/wybor_jezyka.png", true)
  182. Wybor_Jezyka.button[1] = guiCreateButton(0.07, 0.36, 0.36, 0.34, "pl", true, Wybor_Jezyka.staticimage[1])
  183. guiSetAlpha(Wybor_Jezyka.button[1], 0.00)
  184. Wybor_Jezyka.button[2] = guiCreateButton(0.56, 0.36, 0.39, 0.34, "EN", true, Wybor_Jezyka.staticimage[1])
  185. guiSetAlpha(Wybor_Jezyka.button[2], 0.00)
  186. guiSetVisible(Wybor_Jezyka.staticimage[1], false)
  187. guiSetVisible(Zarzadzanie_PL.staticimage[1], false)
  188. guiSetVisible(Zarzadzanie_EN.staticimage[1], false)
  189. guiSetVisible(Tworzenie_PL.staticimage[1], false)
  190. guiSetVisible(Tworzenie_EN.staticimage[1], false)
  191. guiSetVisible(Logowanie_EN.staticimage[1], false)
  192. guiSetVisible(Logowanie_PL.staticimage[1], false)
  193. guiSetVisible(Wybor_Pracy_EN.staticimage[1], false)
  194. guiSetVisible(Wybor_Pracy_PL.staticimage[1], false)
  195. guiSetVisible(Wybor_Spawnu_PL.staticimage[1], false)
  196. guiSetVisible(Wybor_Spawnu_EN.staticimage[1], false)
  197.  
  198.  
  199. addEventHandler("onClientGUIClick",Wybor_Jezyka.button[1],function()
  200. setElementData(getLocalPlayer(),"Polska",true)
  201. guiSetVisible(Logowanie_PL.staticimage[1], true)
  202. setElementData(getLocalPlayer(),"Paulo",true)
  203. guiSetVisible(Wybor_Jezyka.staticimage[1], false)
  204. exports.notifications:showBox("info", "Wybrałeś język Polski, skrypty będą działąć w tym języku.")
  205. end,false)
  206.  
  207. addEventHandler("onClientGUIClick",Wybor_Jezyka.button[2],function()
  208. setElementData(getLocalPlayer(),"English",true)
  209. guiSetVisible(Logowanie_EN.staticimage[1], true)
  210. setElementData(getLocalPlayer(),"Paulo",true)
  211. guiSetVisible(Wybor_Jezyka.staticimage[1], false)
  212. exports.notifications:showBox("info", "You have selected the English language, scripts should work in that language.")
  213. end,false)
  214.  
  215. addEventHandler("onClientGUIClick",Logowanie_PL.button[1],function()
  216. local username = guiGetText(Logowanie_PL.edit[1])
  217. local password = guiGetText(Logowanie_PL.edit[2])
  218. if username and password then
  219. triggerServerEvent("Dobre_Logowanie", getRootElement(), localPlayer, username, password)
  220. else
  221. exports.notifications:showBox("error", "Zapomniałeś podać login lub hasło.")
  222. end
  223. end,false )
  224.  
  225. addEventHandler("onClientGUIClick",Logowanie_EN.button[1],function()
  226. local username = guiGetText(Logowanie_EN.edit[3])
  227. local password = guiGetText(Logowanie_EN.edit[4])
  228. if username and password then
  229. triggerServerEvent("Submit_Login", getRootElement(), localPlayer, username, password)
  230. else
  231. exports.notifications:showBox("error", "You must type username and password.")
  232. end
  233. end,false )
  234.  
  235. addEventHandler("onClientGUIClick",Logowanie_PL.button[2],function()
  236. local username = guiGetText(Logowanie_PL.edit[1])
  237. local password = guiGetText(Logowanie_PL.edit[2])
  238. if username and password then
  239. if (string.len(username)>=4) then
  240. if (string.len(password)>=4) then
  241. triggerServerEvent("Dobra_Rejestracja", getRootElement(), localPlayer, username, password)
  242. else
  243. exports.notifications:showBox("error", "Hasło musi być dłuższy niż 4 znaki.")
  244. end
  245. else
  246. exports.notifications:showBox("error", "Login musi być dłuższy niż 4 znaki.")
  247. end
  248. else
  249. exports.notifications:showBox("error", "Wpisz login i hasło.")
  250. end
  251. end ,false)
  252.  
  253.  
  254. addEventHandler("onClientGUIClick",Logowanie_EN.button[1],function()
  255. local username = guiGetText(Logowanie_EN.edit[3])
  256. local password = guiGetText(Logowanie_EN.edit[4])
  257. if username and password then
  258. if (string.len(username)>=4) then
  259. if (string.len(password)>=4) then
  260. triggerServerEvent("Submit_Register", getRootElement(), localPlayer, username, password)
  261. else
  262. outputChatBox( "The password must contain at least four characters.")
  263. end
  264. else
  265. exports.notifications:showBox("error", "Username must be at least 4 characters.")
  266. end
  267. else
  268. exports.notifications:showBox("error", "Enter your login and password!")
  269. end
  270. end ,false)
  271.  
  272. addEventHandler("onClientGUIClick",Zarzadzanie_PL.button[1],function()
  273. guiSetVisible(Tworzenie_PL.staticimage[1], true)
  274. guiSetVisible(Zarzadzanie_PL.staticimage[1], false)
  275. exports.notifications:showBox("info", "Aby stworzyć postać, wypełnij wszystkie pola.")
  276. end,false)
  277.  
  278. addEventHandler("onClientGUIClick",Zarzadzanie_PL.button[3],function()
  279. triggerServerEvent("Wczytaj_Postac_PL", getRootElement(), localPlayer)
  280. end,false)
  281.  
  282.  
  283.  
  284.  
  285.  
  286. addEventHandler("onClientGUIClick",Zarzadzanie_EN.button[1],function()
  287. guiSetVisible(Tworzenie_EN.staticimage[1], true)
  288. guiSetVisible(Zarzadzanie_EN.staticimage[1], false)
  289. exports.notifications:showBox("info", "To create a form, fill in all the fields.")
  290. end,false)
  291.  
  292. addEventHandler("onClientGUIClick",Zarzadzanie_EN.button[3],function()
  293. triggerServerEvent("Wczytaj_Postac_EN", getRootElement(), localPlayer)
  294. end,false)
  295.  
  296. addEventHandler ("onClientGUIClick", Wybor_Pracy_PL.button[1],function(button, state, thePlayer)
  297. local praca = guiGridListGetItemText (Wybor_Pracy_PL.gridlist[1], guiGridListGetSelectedItem(Wybor_Pracy_PL.gridlist[1]))
  298. if (praca == "Truckerzy") then
  299. guiSetVisible(Wybor_Pracy_PL.staticimage[1], false)
  300. guiSetVisible(Wybor_Spawnu_PL.staticimage[1], true)
  301. elseif (praca == "Policja") then
  302. triggerServerEvent("Policja_PL", getRootElement(), getLocalPlayer())
  303. SchowajGUI()
  304. elseif (praca == "Pogotowie") then
  305. triggerServerEvent("Pogo_PL", getRootElement(), getLocalPlayer())
  306. SchowajGUI()
  307. elseif (praca == "Taxi") then
  308. triggerServerEvent("Taxi_PL", getRootElement(), getLocalPlayer())
  309. SchowajGUI()
  310. elseif (praca == "Pomoc Drogowa") then
  311. triggerServerEvent("Pomoc_PL", getRootElement(), getLocalPlayer())
  312. SchowajGUI()
  313. elseif (praca == "BP Ultimate") then
  314. triggerServerEvent("BP_PL", getRootElement(), getLocalPlayer())
  315. SchowajGUI()
  316. elseif (praca == "Final Build") then
  317. triggerServerEvent("Final_PL", getRootElement(), getLocalPlayer())
  318. SchowajGUI()
  319. elseif (praca == "Fresh Logistic") then
  320. triggerServerEvent("Fresh_PL", getRootElement(), getLocalPlayer())
  321. SchowajGUI()
  322. else
  323. exports.notifications:showBox("error", "Nie wybrałeś żadnej pracy. Jeśli nie jesteś nigdzie zatrudniony wybierz pole 'Truckerzy'.")
  324.  
  325. end
  326. end,false)
  327.  
  328. addEventHandler ("onClientGUIClick", Wybor_Pracy_EN.button[1],function(button, state, thePlayer)
  329. local praca = guiGridListGetItemText (Wybor_Pracy_EN.gridlist[1], guiGridListGetSelectedItem(Wybor_Pracy_EN.gridlist[1]))
  330. if (praca == "Truckers") then
  331. guiSetVisible(Wybor_Pracy_EN.staticimage[1], false)
  332. guiSetVisible(Wybor_Spawnu_EN.staticimage[1], true)
  333. elseif (praca == "Police") then
  334. triggerServerEvent("Policja_EN", getRootElement(), getLocalPlayer())
  335. SchowajGUI()
  336. elseif (praca == "Medic") then
  337. triggerServerEvent("Pogo_EN", getRootElement(), getLocalPlayer())
  338. SchowajGUI()
  339. elseif (praca == "Taxi") then
  340. triggerServerEvent("Taxi_EN", getRootElement(), getLocalPlayer())
  341. SchowajGUI()
  342. elseif (praca == "Mechanic") then
  343. triggerServerEvent("Pomoc_EN", getRootElement(), getLocalPlayer())
  344. SchowajGUI()
  345. elseif (praca == "BP Ultimate") then
  346. triggerServerEvent("BP_PL", getRootElement(), getLocalPlayer())
  347. SchowajGUI()
  348. elseif (praca == "Final Build") then
  349. triggerServerEvent("Final_PL", getRootElement(), getLocalPlayer())
  350. SchowajGUI()
  351. elseif (praca == "Fresh Logistic") then
  352. triggerServerEvent("Fresh_PL", getRootElement(), getLocalPlayer())
  353. SchowajGUI()
  354. else
  355. exports.notifications:showBox("error", "You have not selected any work. If you are not employed anywhere, select the field 'Truckerzy'.")
  356.  
  357. end
  358. end,false)
  359.  
  360. addEventHandler ("onClientGUIClick",Wybor_Spawnu_PL.button[1],function(button, state, thePlayer)
  361. local ms = guiGridListGetItemText (Wybor_Spawnu_PL.gridlist[1], guiGridListGetSelectedItem(Wybor_Spawnu_PL.gridlist[1]))
  362. if (ms == "San Fierro") then
  363. SchowajGUI()
  364. triggerServerEvent("SF_PL", getRootElement(), getLocalPlayer())
  365. showPlayerHudComponent ("all", true)
  366. elseif (ms == "Las Venturas") then
  367. triggerServerEvent("LV_PL", getRootElement(), getLocalPlayer())
  368. SchowajGUI()
  369. showPlayerHudComponent ("all", true)
  370. elseif (ms == "Los Santos") then
  371. SchowajGUI()
  372. triggerServerEvent("LS_PL", getRootElement(), getLocalPlayer())
  373. showPlayerHudComponent ("all", true)
  374. else
  375. exports.notifications:showBox("error","Nie wybrałeś miejsca spawnu.")
  376. exports.notifications:showBox("error", "Not selected spawn points.")
  377. end
  378. end,false)
  379.  
  380. addEventHandler ("onClientGUIClick",Wybor_Spawnu_EN.button[1],function(button, state, thePlayer)
  381. local ms = guiGridListGetItemText (Wybor_Spawnu_EN.gridlist[1], guiGridListGetSelectedItem(Wybor_Spawnu_EN.gridlist[1]))
  382. if (ms == "San Fierro") then
  383. SchowajGUI()
  384. triggerServerEvent("SF_EN", getRootElement(), getLocalPlayer())
  385. showPlayerHudComponent ("all", true)
  386. elseif (ms == "Las Venturas") then
  387. triggerServerEvent("LV_EN", getRootElement(), getLocalPlayer())
  388. SchowajGUI()
  389. showPlayerHudComponent ("all", true)
  390. elseif (ms == "Los Santos") then
  391. SchowajGUI()
  392. triggerServerEvent("LS_EN", getRootElement(), getLocalPlayer())
  393. showPlayerHudComponent ("all", true)
  394. else
  395. exports.notifications:showBox("error", "Not selected spawn points.")
  396. end
  397. end,false)
  398.  
  399. addEventHandler ("onClientGUIClick",Tworzenie_PL.button[1], function()
  400. local imie = guiGetText(Tworzenie_PL.edit[1])
  401. local nazwisko = guiGetText(Tworzenie_PL.edit[2])
  402. local plec = guiGetText(Tworzenie_PL.combobox[1])
  403. local wiek = guiGetText(Tworzenie_PL.edit[3])
  404. if imie and nazwisko and plec and wiek then
  405. if (string.len(imie)>=4) then
  406. if (string.len(nazwisko)>=4) then
  407. if (string.len(wiek)>=1) then
  408. guiSetVisible (Tworzenie_PL.staticimage[1], false)
  409. guiSetVisible (Zarzadzanie_PL.staticimage[1], true)
  410. triggerServerEvent("Tworze_Postac_PL", getLocalPlayer(), imie,nazwisko,plec,wiek)
  411. guiSetText(Zarzadzanie_PL.edit[1],imie)
  412. guiSetText(Zarzadzanie_PL.edit[2],nazwisko)
  413. guiSetText(Zarzadzanie_PL.edit[3],plec)
  414. guiSetText(Zarzadzanie_PL.edit[4],wiek)
  415. else
  416. exports.notifications:showBox("error", "Nie wisano imienia postaci.")
  417. end
  418. else
  419. exports.notifications:showBox("error", "Nazwisko musi zawierac 4 znaki")
  420. end
  421. else
  422. exports.notifications:showBox("error", "Wiek moze zawierać tylko 1-100.")
  423. end
  424. end
  425. end,false)
  426.  
  427.  
  428. addEventHandler ("onClientGUIClick",Tworzenie_EN.button[1], function()
  429. local imie = guiGetText(Tworzenie_EN.edit[1])
  430. local nazwisko = guiGetText(Tworzenie_EN.edit[2])
  431. local plec = guiGetText(Tworzenie_EN.combobox[1])
  432. local wiek = guiGetText(Tworzenie_EN.edit[3])
  433. if imie and nazwisko and plec and wiek then
  434. if (string.len(imie)>=4) then
  435. if (string.len(nazwisko)>=4) then
  436. if (string.len(wiek)>=1) then
  437. guiSetVisible (Tworzenie_EN.staticimage[1], false)
  438. guiSetVisible (Zarzadzanie_EN.staticimage[1], true)
  439. triggerServerEvent("Tworze_Postac_EN", getLocalPlayer(), imie,nazwisko,plec,wiek)
  440. guiSetText(Zarzadzanie_EN.edit[1],imie)
  441. guiSetText(Zarzadzanie_EN.edit[2],nazwisko)
  442. guiSetText(Zarzadzanie_EN.edit[3],plec)
  443. guiSetText(Zarzadzanie_EN.edit[4],wiek)
  444. else
  445. exports.notifications:showBox("error", "You must write all files")
  446. end
  447. else
  448. exports.notifications:showBox("error", "Surename must have 4 characters")
  449. end
  450. else
  451. exports.notifications:showBox("error", "Old must have 1-100")
  452. end
  453. end
  454. end,false)
  455.  
  456.  
  457. addEventHandler ("onClientGUIClick",Tworzenie_PL.button[2], function()
  458. guiSetVisible (Tworzenie_PL.staticimage[1], false)
  459. guiSetVisible (Zarzadzanie_PL.staticimage[1], false)
  460. end)
  461.  
  462.  
  463. addEventHandler ("onClientGUIClick",Tworzenie_EN.button[2], function()
  464. guiSetVisible (Tworzenie_EN.staticimage[1], false)
  465. guiSetVisible (Zarzadzanie_EN.staticimage[1], false)
  466. end)
  467.  
  468. addEventHandler("onClientGUIClick",Zarzadzanie_PL.button[2],function()
  469. guiSetVisible (Zarzadzanie_PL.staticimage[1], false)
  470. guiSetVisible (Wybor_Pracy_PL.staticimage[1], true)
  471. end)
  472.  
  473. addEventHandler ("onClientGUIClick",Zarzadzanie_EN.button[2], function()
  474. guiSetVisible (Zarzadzanie_EN.staticimage[1], false)
  475. guiSetVisible (Wybor_Pracy_EN.staticimage[1], true)
  476. end)
  477.  
  478. function WchodzeNaSerwer(type)
  479. if type == true then
  480. showPlayerHudComponent("all", false)
  481. showChat(false)
  482. showCursor(true)
  483. fadeCamera(true)
  484. guiSetVisible(Wybor_Jezyka.staticimage[1], true)
  485. --setCameraMatrix(1416,-887,120,-90,1700,-350)
  486. setCameraMatrix(1491.48572, -1402.52332, 23.61719, 1491.42236, -1407.00012, 23.61719)
  487.  
  488. end
  489. end
  490.  
  491.  
  492.  
  493.  
  494. function hideLoginWindow()
  495. guiSetVisible (Logowanie_EN.staticimage[1], false)
  496. guiSetVisible (Logowanie_PL.staticimage[1], false)
  497. if getElementData(getLocalPlayer(),"English") then
  498. guiSetVisible (Zarzadzanie_EN.staticimage[1], true)
  499. guiSetVisible (Zarzadzanie.staticimage[1], true)
  500. Skiny()
  501. elseif getElementData(getLocalPlayer(),"Polska") then
  502. guiSetVisible (Zarzadzanie_PL.staticimage[1], true)
  503. Skiny()
  504. end
  505. end
  506. addEvent("hideLoginWindow", true)
  507. addEventHandler("hideLoginWindow", getResourceRootElement(getThisResource()), hideLoginWindow)
  508.  
  509. addEvent("Zapamietaj",true)
  510. addEventHandler("Zapamietaj",getRootElement(),function(playerscore)
  511. setElementData(getLocalPlayer(),"Ostatni_Skin",playerscore)
  512. end)
  513.  
  514. function Skiny()
  515. if getElementData(getLocalPlayer(), "Ostatni_Skin") then
  516. local skin = getElementData(getLocalPlayer(),"Ostatni_Skin")
  517. muestra = createPed(skin, 1492.42236, -1407.00012, 23.61719)
  518. else
  519. ped = createPed(15, 1492.42236, -1407.00012, 23.61719)
  520. end
  521. end
  522.  
  523. addEvent("Dane_Konta",true)
  524. addEventHandler("Dane_Konta",getRootElement(),function(imie,naziwsko,plec,wiek)
  525. if getElementData(getLocalPlayer(),"Polska") then
  526. guiSetText(Zarzadzanie_PL.edit[1],imie)
  527. guiSetText(Zarzadzanie_PL.edit[2],naziwsko)
  528. guiSetText(Zarzadzanie_PL.edit[3],plec)
  529. guiSetText(Zarzadzanie_PL.edit[4],wiek)
  530. elseif getElementData(getLocalPlayer(),"English") then
  531. guiSetText(Zarzadzanie_EN.edit[1],imie)
  532. guiSetText(Zarzadzanie_EN.edit[2],naziwsko)
  533. guiSetText(Zarzadzanie_EN.edit[3],plec)
  534. guiSetText(Zarzadzanie_EN.edit[4],wiek)
  535. end
  536. end)
  537.  
  538. function SchowajGUI()
  539. guiSetVisible(Wybor_Jezyka.staticimage[1], false)
  540. guiSetVisible(Zarzadzanie_PL.staticimage[1], false)
  541. guiSetVisible(Zarzadzanie_EN.staticimage[1], false)
  542. guiSetVisible(Tworzenie_PL.staticimage[1], false)
  543. guiSetVisible(Logowanie_EN.staticimage[1], false)
  544. guiSetVisible(Logowanie_PL.staticimage[1], false)
  545. guiSetVisible(Wybor_Pracy_PL.staticimage[1], false)
  546. guiSetVisible(Wybor_Pracy_EN.staticimage[1], false)
  547. guiSetVisible(Wybor_Spawnu_PL.staticimage[1], false)
  548. guiSetVisible(Wybor_Spawnu_EN.staticimage[1], false)
  549. showCursor(false)
  550. showChat(true)
  551. stopSound(muzyka)
  552. end
  553.  
  554.  
  555.  
  556. function startcam()
  557. -- setCameraMatrix(2710.7729492188,1233.9653320313,22.7174453735352711, 1234, 23, 2707, 1140, -8)
  558. local x1, y1, z1 = 2710.7729492188,1233.9653320313,22.7174453735352711
  559. local x2, y2, z2 = 1234, 23, 2707
  560. setCameraMatrix ( x1, y1, z1, x2, y2, z2 )
  561. end
  562.  
  563. ----Kamerka
  564. addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), startcam)
  565. addEventHandler("onClientReader",getRootElement(), startcam)
  566.  
  567.  
  568. Logo1 = guiCreateStaticImage(0.01, 0.05, 0.72, 0.08, "/images/logo1.png", true)
  569. Logo2 = guiCreateStaticImage(0.28, 0.86, 0.72, 0.10, "/images/logo2.png", true)
  570. guiSetVisible(Logo2, false)
  571. guiSetVisible(Logo1, false)
  572.  
  573. local sm = {}
  574. sm.moov = 0
  575. sm.object1, sm.object2 = nil, nil
  576.  
  577. local function removeCamHandler ()
  578. if(sm.moov == 1) then
  579. sm.moov = 0
  580. end
  581. end
  582.  
  583. local function camRender ()
  584. if isElement(sm.object1) and isElement(sm.object2) then
  585. local x1, y1, z1 = getElementPosition ( sm.object1 )
  586. local x2, y2, z2 = getElementPosition ( sm.object2 )
  587. setCameraMatrix ( x1, y1, z1, x2, y2, z2 )
  588. end
  589. end
  590.  
  591. function smoothMoveCamera ( x1, y1, z1, x1t, y1t, z1t, x2, y2, z2, x2t, y2t, z2t, time )
  592. if(sm.moov == 1) then return false end
  593. sm.object1 = createObject ( 1337, x1, y1, z1 )
  594. sm.object2 = createObject ( 1337, x1t, y1t, z1t )
  595. setElementAlpha ( sm.object1, 0 )
  596. setElementAlpha ( sm.object2, 0 )
  597. setObjectScale(sm.object1, 0.01)
  598. setObjectScale(sm.object2, 0.01)
  599. moveObject ( sm.object1, time, x2, y2, z2, 0, 0, 0 )
  600. moveObject ( sm.object2, time, x2t, y2t, z2t, 0, 0, 0 )
  601.  
  602. addEventHandler ( "onClientPreRender", getRootElement(), camRender )
  603. sm.moov = 1
  604. setTimer ( removeCamHandler, time, 1 )
  605. setTimer ( destroyElement, time, 1, sm.object1 )
  606. setTimer ( destroyElement, time, 1, sm.object2 )
  607. return true
  608. end
  609.  
  610. function startcam()
  611. showPlayerHudComponent("all", false)
  612. showChat(false)
  613. showCursor(true)
  614. fadeCamera(true)
  615. local kam = smoothMoveCamera(2710.7729492188,1233.9653320313,222.7174453735352711, -1701.6151123047, 21.74271774292, 76.711669921875, -1625.2635498047, 437.74124145508, 17.581869125366, -1692.2729492188, -545.36743164063, 34.764526367188,50000 )
  616. setFarClipDistance(3000)
  617. muzyka2 = playSound("Muzyka2.mp3",true)
  618. setSoundVolume(muzyka2,0.4)
  619. setTimer ( NapiszLogo,7000,1,true)
  620. setTimer ( NapiszLogo2,14000,1,true)
  621. setTimer ( NapiszLogo,56000,1,false)
  622. setTimer ( NapiszLogo2,56000,1,false)
  623. setTimer ( WchodzeNaSerwer,65000,1,true)
  624.  
  625. end
  626.  
  627. function NapiszLogo(type)
  628. if type == true then
  629. guiSetVisible(Logo1, true)
  630. elseif type == false then
  631. guiSetVisible(Logo1, false)
  632. stopSound(muzyka2)
  633. muzyka = playSound("Muzyka.mp3",true)
  634. setSoundVolume(muzyka,0.1)
  635. guiSetVisible(Logo2, false)
  636. fadeCamera ( false, 3.0, 0, 0, 0 )
  637. end
  638. end
  639.  
  640. function NapiszLogo2(type)
  641. if type == true then
  642. guiSetVisible(Logo2, true)
  643. elseif type == false then
  644. guiSetVisible(Logo2, false)
  645. end
  646. end
  647. ----Kamerka
  648. addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), startcam)
  649. addEventHandler("onClientReader",getRootElement(), startcam)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement