Noneatme

Handy Script - MTA San Andreas CLIENT

Jan 11th, 2013
881
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 194.82 KB | None | 0 0
  1. --[[
  2.     ##########################################################################
  3.     ##                                                                      ##
  4.     ## Project: 'MT-RPG' - Gamemode for MTA: San Andreas PROJECT X          ##
  5.     ##                      Developer: Noneatme                             ##
  6.     ##           License: See LICENSE in the top level directory            ##
  7.     ##                                                                      ##
  8.     ##########################################################################
  9.     [C] Copyright 2013 Noneatme
  10. ]]
  11.  
  12.  
  13. local enabled = false
  14. local menue = true
  15.  
  16. local gMe = getLocalPlayer()
  17.  
  18. local font = dxCreateFont("data/fonts/harabara.ttf", 36)
  19.  
  20. addEvent("onMTHandyDataNeedBack", true)
  21. addEvent("onMTHandyActionBack", true)
  22. addEvent("onClientMTHandyIQCMessageSend", true)
  23. addEvent("onMTHandyRadiosGetBack", true)
  24. addEvent("onClientLAEmailBekomm", true)
  25. addEvent("onLAClientInfobar", true)
  26.  
  27.  
  28. local houseBlip
  29. local can_scroll = true
  30. local can_scrolltimer
  31.  
  32. local noSoundButton = {}
  33.  
  34.  
  35. -- Event handlers -
  36.  
  37. -- Variables --
  38.  
  39. -- VEHICLE COLOOR --
  40. local vehBlipColor = {}
  41. vehBlipColor["r"] = {}
  42. vehBlipColor["g"] = {}
  43. vehBlipColor["b"] = {}
  44. local color = 1
  45. vehBlipColor["r"][color] = 255
  46. vehBlipColor["g"][color] = 0
  47. vehBlipColor["b"][color] = 0
  48. color = color + 1
  49. vehBlipColor["r"][color] = 0
  50. vehBlipColor["g"][color] = 255
  51. vehBlipColor["b"][color] = 0
  52. color = color + 1
  53. vehBlipColor["r"][color] = 0
  54. vehBlipColor["g"][color] = 0
  55. vehBlipColor["b"][color] = 255
  56. color = color + 1
  57. vehBlipColor["r"][color] = 0
  58. vehBlipColor["g"][color] = 0
  59. vehBlipColor["b"][color] = 0
  60. color = color + 1
  61. vehBlipColor["r"][color] = 255
  62. vehBlipColor["g"][color] = 255
  63. vehBlipColor["b"][color] = 255
  64. color = color + 1
  65. vehBlipColor["r"][color] = 255
  66. vehBlipColor["g"][color] = 255
  67. vehBlipColor["b"][color] = 0
  68. color = color + 1  
  69. vehBlipColor["r"][color] = 255
  70. vehBlipColor["g"][color] = 0
  71. vehBlipColor["b"][color] = 255
  72. color = color + 1
  73. vehBlipColor["r"][color] = 0
  74. vehBlipColor["g"][color] = 255
  75. vehBlipColor["b"][color] = 255
  76. color = color + 1
  77. vehBlipColor["r"][color] = 125
  78. vehBlipColor["g"][color] = 125
  79. vehBlipColor["b"][color] = 125
  80. color = color + 1
  81. vehBlipColor["r"][color] = 255
  82. vehBlipColor["g"][color] = 150
  83. vehBlipColor["b"][color] = 0
  84. color = color + 1
  85. color = nil
  86. local vehBlip = {}
  87.  
  88.  
  89. -- WEATHER --
  90. local temp = 28
  91. local weather_v_1 = 9
  92. local weather_v_2 = 8
  93. local weather_v_3 = 8
  94.  
  95. -- SETTINGS --
  96.  
  97. local MAX_MEMO_LENGTH = "65535"
  98.  
  99. local empfang, akku = 4, 0
  100. local auswahl = "0"
  101. local c_url = "www.loogle.com"
  102. local webserver = "la-rl.com"
  103. local pfad = "scripts/" -- zum beispiel handy/, falls in Gamemode eingebunden
  104. local cal_anzeige = ""
  105. local last_url = c_url
  106. local bankgeld = 25000
  107.  
  108. -- ANTI SPAM --
  109.  
  110. local antiSpam = {}
  111. antiSpam["timesopen"] = 0
  112.  
  113. -- INFO BAR --
  114. local infoBar = {}
  115. infoBar["text"] = ""
  116. infoBar["showing"] = false
  117. infoBar["timer"] = false
  118. infoBar["r"] = false
  119. infoBar["g"] = false
  120. infoBar["b"] = false
  121. infoBar["sy"] = 0
  122. infoBar["time"] = 3000
  123.  
  124. -- RADIO DATA --
  125. local radioauswahl = 0
  126. local radioData = {}
  127. local radioSample = {}
  128. local radioBalken = {}
  129.  
  130. radioData["playing"] = false
  131. radioData["url"] = false
  132. radioData["name"] = false
  133. radioData["volume"] = 1
  134. radioData["sound"] = false
  135. radioData["maxlenght"] = false
  136.  
  137. -- RADIO EFFECTS --
  138.  
  139. local effect_names = {
  140.     [1] = "gargle",
  141.     [2] = "compressor",
  142.     [3] = "echo",
  143.     [4] = "i3dl2reverb",
  144.     [5] = "distortion",
  145.     [6] = "chorus",
  146.     [7] = "parameq",
  147.     [8] = "reverb",
  148.     [9] = "flanger"
  149. }
  150.  
  151. -- SPECIFIG MESSENGER EMAIL SETTINGS --
  152. local messengersite = "1"
  153. local memo_text = ""
  154. local email_text = ""
  155. local email_sender = ""
  156. local email_betreff = ""
  157. local email_id = 0
  158. local emailget = false
  159. local emailgettimer
  160.  
  161. local update_text = "Updates werden geladen..."
  162.  
  163. local iqc_text = ""
  164.  
  165. local current_background = 1
  166.  
  167. local allowedPersons = { -- Personen die die Updates/Ankuendigungen bearbeiten koennen
  168.     ["[LA]Leyynen"] = true,
  169.     ["[LA]Tobi"] = true,
  170.     ["[LA]Samuele"] = true,
  171.     ["[LA]Jan"] = true,
  172.     ["[LA]Turkeychiller"] = true,
  173.     ["[LA]Dawi"] = true,
  174.     ["[LA]Style"] = true,
  175.     ["[LA]None"] = true,
  176.     ["Noneatme"] = true, -- ^^
  177. }
  178.  
  179. local handy_backgrounds = {
  180.     [1] = "Standart Background",
  181.     [2] = "Weidenbaum",
  182.     [3] = "SIII Background",
  183.     [4] = "Abstract Background",
  184.     [5] = "Feuerzeug Background",
  185.     [6] = "Mustang Background",
  186.     [7] = "Augen Background",
  187.     [8] = "Klee Background",
  188.     [9] = "Fussball Background",
  189.     [10] = "Planet Background",
  190.     [11] = "Apocalypse Background",
  191. }
  192.  
  193. local ammu_select = {}
  194. local radiosite = 0
  195. local standartbuttons = false
  196. local appsite = false
  197. local weapon_price = 0
  198. -- AMMU DEFINNITION --
  199.  
  200. local temp_name = "9mm"
  201. ammu_select[temp_name] = {}
  202. ammu_select[temp_name]["ammu"] = 0
  203. ammu_select[temp_name]["selected"] = false
  204. ammu_select[temp_name]["gunprice"] = 250
  205. ammu_select[temp_name]["ammoprice"] = 25
  206.  
  207. temp_name = "deagle"
  208. ammu_select[temp_name] = {}
  209. ammu_select[temp_name]["ammu"] = 0
  210. ammu_select[temp_name]["selected"] = false
  211. ammu_select[temp_name]["gunprice"] = 250
  212. ammu_select[temp_name]["ammoprice"] = 25
  213.  
  214. temp_name = "shotgun"
  215. ammu_select[temp_name] = {}
  216. ammu_select[temp_name]["ammu"] = 0
  217. ammu_select[temp_name]["selected"] = false
  218. ammu_select[temp_name]["gunprice"] = 275
  219. ammu_select[temp_name]["ammoprice"] = 5
  220.  
  221. temp_name = "mp5"
  222. ammu_select[temp_name] = {}
  223. ammu_select[temp_name]["ammu"] = 0
  224. ammu_select[temp_name]["selected"] = false
  225. ammu_select[temp_name]["gunprice"] = 550
  226. ammu_select[temp_name]["ammoprice"] = 100
  227.  
  228.  
  229. temp_name = "ak-47"
  230. ammu_select[temp_name] = {}
  231. ammu_select[temp_name]["ammu"] = 0
  232. ammu_select[temp_name]["selected"] = false
  233. ammu_select[temp_name]["gunprice"] = 1000
  234. ammu_select[temp_name]["ammoprice"] = 100
  235.  
  236. temp_name = "m4"
  237. ammu_select[temp_name] = {}
  238. ammu_select[temp_name]["ammu"] = 0
  239. ammu_select[temp_name]["selected"] = false
  240. ammu_select[temp_name]["gunprice"] = 1500
  241. ammu_select[temp_name]["ammoprice"] = 150
  242.  
  243. temp_name = "rifle"
  244. ammu_select[temp_name] = {}
  245. ammu_select[temp_name]["ammu"] = 0
  246. ammu_select[temp_name]["selected"] = false
  247. ammu_select[temp_name]["gunprice"] = 350
  248. ammu_select[temp_name]["ammoprice"] = 7
  249.  
  250. temp_name = "armour"
  251. ammu_select[temp_name] = {}
  252. ammu_select[temp_name]["ammu"] = 0
  253. ammu_select[temp_name]["selected"] = false
  254. ammu_select[temp_name]["gunprice"] = 250
  255. ammu_select[temp_name]["ammoprice"] = ammu_select[temp_name]["gunprice"]
  256.  
  257. temp_name = "nachtsicht"
  258. ammu_select[temp_name] = {}
  259. ammu_select[temp_name]["ammu"] = 0
  260. ammu_select[temp_name]["selected"] = false
  261. ammu_select[temp_name]["gunprice"] = 25
  262. ammu_select[temp_name]["ammoprice"] = ammu_select[temp_name]["gunprice"]
  263.  
  264. temp_name = "waerme"
  265. ammu_select[temp_name] = {}
  266. ammu_select[temp_name]["ammu"] = 0
  267. ammu_select[temp_name]["selected"] = false
  268. ammu_select[temp_name]["gunprice"] = 25
  269. ammu_select[temp_name]["ammoprice"] = ammu_select[temp_name]["gunprice"]
  270.  
  271. temp_name = "knife"
  272. ammu_select[temp_name] = {}
  273. ammu_select[temp_name]["ammu"] = 0
  274. ammu_select[temp_name]["selected"] = false
  275. ammu_select[temp_name]["gunprice"] = 10
  276. ammu_select[temp_name]["ammoprice"] = ammu_select[temp_name]["gunprice"]
  277.  
  278. temp_name = "bat"
  279. ammu_select[temp_name] = {}
  280. ammu_select[temp_name]["ammu"] = 0
  281. ammu_select[temp_name]["selected"] = false
  282. ammu_select[temp_name]["gunprice"] = 15
  283. ammu_select[temp_name]["ammoprice"] = ammu_select[temp_name]["gunprice"]
  284.  
  285. local ammu_element = {}
  286. local OPEN_KEY = "1"
  287.  
  288. guiSetInputMode("no_binds_when_editing")
  289.  
  290. local page_images = {
  291.     ["www.loogle.com"] = "startpage",
  292.     ["loogle.com"] = "startpage",
  293.     ["www.info.com"] = "info",
  294.     ["info.com"] = "info",
  295.     ["mta-sa.de"] = "mtasa",
  296.     ["www.mta-sa.de"] = "mtasa",
  297.     ["www.sfair.de"] = "sfair",
  298.     ["www.sfair.com"] = "sfair",
  299.     ["www.sanfierroairport.com"] = "sfair",
  300.     ["www.hospital.com"] = "hospital",
  301.     ["www.healme.com"] = "hospital",
  302.     ["www.krankenhaus.com"] = "hospital",
  303.     ["www.cluckingbell.com"] = "cluckingbell",
  304.     ["www.cluckingbell.de"] = "cluckingbell",
  305.     ["www.cluckingbellhappychicken.com"] = "cluckingbell",
  306.     ["www.paynspray.de"] = "pns",
  307.     ["www.paynspray.com"] = "pns",
  308.     ["www.pns.com"] = "pns",
  309.     ["www.pns.de"] = "pns",
  310.     ["www.house.de"] = "house",
  311.     ["www.myhomes.de"] = "house",
  312.     ["www.home.com"] = "house",
  313.     ["www.myhome.com"] = "house",
  314.     ["www.house.com"] = "house",
  315.     ["www.loogle.com/select"] = "auswahlpage",
  316.     ["www.loogle.com/selectmore"] = "auswahlpage2",
  317.     ["www.bank.com"] = "bank",
  318.     ["10060"] = "10060",
  319.     ["www.news.com"] = "newsmain",
  320.     ["www.pizza.com"] = "pizza",
  321.     ["www.pizza.de"] = "pizza",
  322.     ["www.ammunation.com"] = "ammunation",
  323.     ["404"] = "404",
  324.     ["www.iqc.com"] = "iqc",
  325.     ["www.casino.com"] = "casino",
  326.     ["www.casino.de"] = "casino",
  327.     ["www.updates.com"] = "updates",
  328.     ["www.updates.de"] = "updates",
  329.     ["www.nutte.de"] = "nutten",
  330.     ["www.nutte.com"] = "nutten",
  331.     ["www.fahrzeuge.com"] = "fahrzeuge",
  332.     ["www.vehinfos.de"] = "vehinfo",
  333.     ["www.vehinfos.com"] = "vehinfo",
  334.     ["www.backgrounds.de"] = "backgrounds",
  335.     ["www.backgrounds.com"] = "backgrounds",
  336.     ["www.lamc.de"] = "lamc",
  337.     ["www.lamc.com"] = "lamc",
  338.     ["www.medic.de"] = "lamc",
  339.     ["www.lamd.de"] = "lamc",
  340.     ["www.lamd.com"] = "lamc",
  341.     -- NEWS SEITEN --
  342.     ["www.news.com/handyinfo"] = "news/handyinfo",
  343. }
  344.  
  345. local news = {
  346.     [1] = "13.08.2012|Galaxy SII veroeffentlicht!|handyinfo",
  347. }
  348.  
  349. --[[
  350. addCommandHandler("setempfang", function(cmd, t)
  351.     empfang = t
  352. end)]]
  353.  
  354. addEventHandler("onClientResourceStart", getResourceRootElement(), function()
  355.     triggerServerEvent("onMTHandyDataNeed", localPlayer, "background")
  356. end)
  357.  
  358. -- AKKU UND EMPFANG --
  359.  
  360. empfang = math.random(2, 4)
  361.  
  362. local lastarea = ""
  363.  
  364. function changeRandomEmpfang()
  365.     if(lastarea == "") then
  366.         empfang = 2
  367.         local x, y, z = getElementPosition(getLocalPlayer())
  368.         local zone = getZoneName(x, y, z, false)
  369.         lastarea = zone
  370.     else
  371.         local x, y, z = getElementPosition(getLocalPlayer())
  372.         local zone = getZoneName(x, y, z, false)
  373.         if(zone ~= lastarea) then
  374.             empfang = math.random(2, 4)
  375.             lastarea = zone
  376.             if(empfang == 1) then
  377.                 showInfobar("Information: Schwaches Netz", 3000, 100, 0, 0)
  378.             end
  379.             if(empfang == 0) then
  380.                 showInfobar("Information: Kein Netz", 3000, 200, 0, 0)
  381.             end
  382.         end
  383.     end
  384. end
  385.  
  386. setTimer(changeRandomEmpfang, 30000, -1)
  387. --changeRandomEmpfang()
  388.  
  389. function changeRandomAkku()
  390.     if(akku == 0) then
  391.         akku = 4
  392.     else
  393.         akku = akku-1
  394.         if(akku < 2) then
  395.             showInfobar("Information: Akku Schwach, bitte im Auto aufladen", 5000, 50, 0, 0)
  396.         end
  397.     end
  398. end
  399.  
  400. setTimer(changeRandomAkku, 30*60*1000, -1)
  401. changeRandomAkku()
  402.  
  403. --addCommandHandler("changeakku", changeRandomAkku)
  404.  
  405. -- AKKUCHECK --
  406. setTimer(function()
  407.     if(isPedInVehicle(localPlayer)) then
  408.         if(akku < 4) then
  409.             akku = akku+1
  410.         end
  411.     end
  412. end, 60000, -1)
  413.  
  414. addEventHandler("onClientVehicleEnter", getRootElement(), function(thePlayer)
  415.     if(thePlayer == localPlayer) then
  416.         if(akku < 4) and (akku > 0) then
  417.             showInfobar("Information: Akku wird geladen.", 5000, 0, 50, 50)
  418.         end
  419.     end
  420. end)
  421.  
  422. -- VARIABLES --
  423. local w_bilder = {
  424.     [0]="sunny",
  425.     [1]="suncloud",
  426.     [2]="suncloud",
  427.     [3]="suncloud",
  428.     [4]="suncloud",
  429.     [5]="suncloud",
  430.     [6]="suncloud",
  431.     [7]="suncloud",
  432.     [8]="stormy",
  433.     [9]="foggy",
  434.     [10]="sunny",
  435.     [11]="sunny",
  436.     [12]="sunny",
  437.     [13]="sunny",
  438.     [14]="sunny",
  439.     [15]="sunny",
  440.     [16]="rainy",
  441.     [17]="sunny",
  442.     [18]="sunny",
  443.     [19]="sunny",
  444.     [20]="foggy",
  445.     [21]="cloudy",
  446.     [22]="cloudy",
  447.     [23]="sunny",
  448.     [24]="sunny",
  449.     [25]="sunny",
  450.     [26]="sunny",
  451.     [27]="cloudy",
  452.     [28]="sunny",
  453.     [29]="sunny",
  454.     [30]="cloudy",
  455.     [31]="cloudy",
  456.     [32]="foggy",
  457.     [33]="sunny",
  458.     [34]="sunny",
  459.     [35]="sunny",
  460.     [36]="sunny",
  461.     [37]="sunny",
  462.     [38]="suncloud",
  463.     [39]="suncloud",
  464.     [40]="sunny",
  465.     [41]="sunny",
  466.     [42]="sunny",
  467.     [43]="cloudy",
  468.     [44]="cloudy",
  469.     [45]="cloudy",
  470.     [46]="sunny",
  471.     [47]="sunny",
  472.     [48]="sunny",
  473.     [49]="cloudy"
  474.  }
  475.  
  476.  
  477. -- RENDER- FUCK YEA -
  478. local buttonmain = false
  479. local dialer = false
  480. local browser = false
  481. local memo = false
  482. local calculator = false
  483. local messeger = false
  484. local radio = false
  485. local faq = false
  486. local faqsite = 0
  487. local site = {}
  488.  
  489. local light = {}
  490.  
  491. local button = {}
  492. local mes_labels = {}
  493.  
  494. addEventHandler("onMTHandyDataNeedBack", getLocalPlayer(), function(value, anzahl, wetter, wetter2, wetter3)
  495.     if(value == "onlinegeld") then
  496.         bankgeld = anzahl
  497.     elseif(value == "wetter") then
  498.         temp = anzahl
  499.         weather_v_1 = wetter
  500.         weather_v_2 = wetter2
  501.         weather_v_3 = wetter3
  502.     elseif(value == "memo") then
  503.         memo_text = anzahl
  504.         if(isElement(button["memo:memo"])) then
  505.             guiSetText(button["memo:memo"], memo_text)
  506.         end
  507.     elseif(value == "updates") then
  508.         update_text = anzahl
  509.         if(isElement(button["browser:updates_memo"])) then
  510.             guiSetText(button["browser:updates_memo"], update_text)
  511.         end
  512.     elseif(value == "background") then
  513.         current_background = anzahl
  514.     end
  515. end)
  516.  
  517. addEventHandler("onClientLAEmailBekomm", getLocalPlayer(), function(absender)
  518.     applyIncomingEffect()
  519.     setTimer(function()
  520.         if(emailget == true) then
  521.             emailget = false
  522.             if(isTimer(emailgettimer)) then
  523.                 killTimer(emailgettimer)
  524.             end
  525.         end
  526.         emailget = true
  527.         emailgettimer = setTimer(function()
  528.             emailget = false
  529.         end, 30000, 1)
  530.         showInfobar("Neue E-Mail von "..absender.." empfangen!", 5000, 0, 50, 0)
  531.     end, 3000, 1)
  532. end)
  533.  
  534.  
  535. function show_memo()
  536.     if(memo == true) then return end
  537.     memo = true
  538.     local sx, sy = guiGetScreenSize()
  539.     local x, y = sx/2, sy/2
  540.     addx = 615
  541.     addy = 58
  542.     addx = addx/1920*sx
  543.     addy = addy/1920*sx
  544.     width, height = 488/1.5, 779/1.5
  545.     width, height = width/1920*sx, height/1920*sx
  546.     button["memo:memo"] = guiCreateMemo(x+addx, y-addy, width, height, "Testmemo", false)
  547.     triggerServerEvent("onMTHandyDataNeed", gMe, "memo")
  548.     guiSetProperty(button["memo:memo"], "MaxTextLength", MAX_MEMO_LENGTH)
  549. end
  550.  
  551. function show_messenger(site, adress, subject, outboxonly)
  552.     if(messenger == true) then return end
  553.     messenger = true
  554.     hide_browser()
  555.     hide_browsersite("hospital")
  556.     local sx, sy = guiGetScreenSize()
  557.     local x, y = sx/2, sy/2
  558.  
  559.     local addx, addy, width, height, scale
  560.    
  561.     if(site == "1") then
  562.         if(emailget == true) then
  563.             emailget = false
  564.             if(isTimer(emailgettimer)) then
  565.                 killTimer(emailgettimer)
  566.             end
  567.         end
  568.         addx = 620
  569.         addy = 55
  570.         addx = addx/1920*sx
  571.         addy = addy/1920*sx
  572.         width, height = 159/1.5, 68/1.5
  573.         width, height = width/1920*sx, height/1920*sx
  574.        
  575.         button["messenger:inbox"] = guiCreateButton(x+addx, y-addy, width, height, "Eingang", false)
  576.         guiSetAlpha(button["messenger:inbox"], 0)
  577.        
  578.         addx = 725
  579.         addy = 55
  580.         addx = addx/1920*sx
  581.         addy = addy/1920*sx
  582.         width, height = 159/1.5, 68/1.5
  583.         width, height = width/1920*sx, height/1920*sx
  584.        
  585.         button["messenger:outbox"] = guiCreateButton(x+addx, y-addy, width, height, "Ausgang", false)
  586.         guiSetAlpha(button["messenger:outbox"], 0)
  587.        
  588.         addx = 830
  589.         addy = 55
  590.         addx = addx/1920*sx
  591.         addy = addy/1920*sx
  592.         width, height = 159/1.5, 68/1.5
  593.         width, height = width/1920*sx, height/1920*sx
  594.        
  595.         button["messenger:recommend"] = guiCreateButton(x+addx, y-addy, width, height, "Empfohlen", false)
  596.         guiSetAlpha(button["messenger:recommend"], 0)
  597.        
  598.         addx = 630
  599.         addy = -420
  600.         addx = addx/1920*sx
  601.         addy = addy/1920*sx
  602.         width, height = 75/1.5, 63/1.5
  603.         width, height = width/1920*sx, height/1920*sx
  604.        
  605.         button["messenger:write"] = guiCreateButton(x+addx, y-addy, width, height, "Schreiben", false)
  606.         guiSetAlpha(button["messenger:write"], 0)
  607.        
  608.         -- SCROLLPANE --
  609.        
  610.         addx = 630
  611.         addy = 0
  612.         addx = addx/1920*sx
  613.         addy = addy/1920*sx
  614.         width, height = 457/1.5, 597/1.5
  615.         width, height = width/1920*sx, height/1920*sx
  616.        
  617.         button["messenger:scrollpane_inbox"] = guiCreateScrollPane(x+addx, y-addy, width, height, false)
  618.         guiScrollPaneSetScrollBars(button["messenger:scrollpane_inbox"],false,true)
  619.        
  620.         triggerServerEvent("onMTHandyAction", gMe, "emailsinbox", webserver)
  621.        
  622.         addEventHandler("onClientGUIClick", button["messenger:outbox"], function()
  623.             hide_messenger(messengersite)
  624.             show_messenger("2")
  625.             messengersite = "2"
  626.         end, false)
  627.        
  628.         -- EVENT HANDLERS --
  629.         addEventHandler("onClientGUIClick", button["messenger:inbox"], function()
  630.             hide_messenger(messengersite)
  631.             show_messenger("1")
  632.             messengersite = "1"
  633.         end, false)
  634.        
  635.         addEventHandler("onClientGUIClick", button["messenger:write"], function()
  636.             hide_messenger(messengersite)
  637.             show_messenger("3")
  638.             messengersite = "3"
  639.         end, false)
  640.     elseif(site == "2") then
  641.         addx = 620
  642.         addy = 55
  643.         addx = addx/1920*sx
  644.         addy = addy/1920*sx
  645.         width, height = 159/1.5, 68/1.5
  646.         width, height = width/1920*sx, height/1920*sx
  647.        
  648.         button["messenger:inbox"] = guiCreateButton(x+addx, y-addy, width, height, "Eingang", false)
  649.         guiSetAlpha(button["messenger:inbox"], 0)
  650.        
  651.         addx = 725
  652.         addy = 55
  653.         addx = addx/1920*sx
  654.         addy = addy/1920*sx
  655.         width, height = 159/1.5, 68/1.5
  656.         width, height = width/1920*sx, height/1920*sx
  657.        
  658.         button["messenger:outbox"] = guiCreateButton(x+addx, y-addy, width, height, "Ausgang", false)
  659.         guiSetAlpha(button["messenger:outbox"], 0)
  660.        
  661.         addx = 830
  662.         addy = 55
  663.         addx = addx/1920*sx
  664.         addy = addy/1920*sx
  665.         width, height = 159/1.5, 68/1.5
  666.         width, height = width/1920*sx, height/1920*sx
  667.        
  668.         button["messenger:recommend"] = guiCreateButton(x+addx, y-addy, width, height, "Empfohlen", false)
  669.         guiSetAlpha(button["messenger:recommend"], 0)
  670.        
  671.         addx = 630
  672.         addy = -420
  673.         addx = addx/1920*sx
  674.         addy = addy/1920*sx
  675.         width, height = 75/1.5, 63/1.5
  676.         width, height = width/1920*sx, height/1920*sx
  677.        
  678.         button["messenger:write"] = guiCreateButton(x+addx, y-addy, width, height, "Schreiben", false)
  679.         guiSetAlpha(button["messenger:write"], 0)
  680.        
  681.         -- SCROLLPANE --
  682.        
  683.         addx = 630
  684.         addy = 0
  685.         addx = addx/1920*sx
  686.         addy = addy/1920*sx
  687.         width, height = 457/1.5, 597/1.5
  688.         width, height = width/1920*sx, height/1920*sx
  689.        
  690.         button["messenger:scrollpane_inbox"] = guiCreateScrollPane(x+addx, y-addy, width, height, false)
  691.         guiScrollPaneSetScrollBars(button["messenger:scrollpane_inbox"],false,true)
  692.        
  693.         triggerServerEvent("onMTHandyAction", gMe, "emailsoutbox", webserver)
  694.        
  695.         addEventHandler("onClientGUIClick", button["messenger:outbox"], function()
  696.             hide_messenger(messengersite)
  697.             show_messenger("2")
  698.             messengersite = "2"
  699.         end, false)
  700.        
  701.         -- EVENT HANDLERS --
  702.         addEventHandler("onClientGUIClick", button["messenger:inbox"], function()
  703.             hide_messenger(messengersite)
  704.             show_messenger("1")
  705.             messengersite = "1"
  706.         end, false)
  707.        
  708.         addEventHandler("onClientGUIClick", button["messenger:write"], function()
  709.             hide_messenger(messengersite)
  710.             show_messenger("3")
  711.             messengersite = "3"
  712.         end, false)
  713.     elseif(site == "3") then
  714.         addx = 675
  715.         addy = 50
  716.         addx = addx/1920*sx
  717.         addy = addy/1920*sx
  718.         width, height = 382/1.5, 49/1.5
  719.         width, height = width/1920*sx, height/1920*sx
  720.         if not(adress) then adress = "" end
  721.         button["messenger:edit_to"] = guiCreateEdit(x+addx, y-addy, width, height, adress, false)
  722.  
  723.         addx = 675
  724.         addy = 0
  725.         addx = addx/1920*sx
  726.         addy = addy/1920*sx
  727.         width, height = 382/1.5, 49/1.5
  728.         width, height = width/1920*sx, height/1920*sx
  729.         if not(subject) then subject = "" end
  730.         button["messenger:edit_subject"] = guiCreateEdit(x+addx, y-addy, width, height, subject, false)
  731.        
  732.         addx = 617
  733.         addy = -50
  734.         addx = addx/1920*sx
  735.         addy = addy/1920*sx
  736.         width, height = 479/1.5, 552/1.5
  737.         width, height = width/1920*sx, height/1920*sx
  738.        
  739.         button["messenger:memo_message"] = guiCreateMemo(x+addx, y-addy, width, height, "", false)
  740.        
  741.         addx = 632
  742.         addy = -423
  743.         addx = addx/1920*sx
  744.         addy = addy/1920*sx
  745.         width, height = 79/1.5, 48/1.5
  746.         width, height = width/1920*sx, height/1920*sx
  747.        
  748.         button["messenger:button_send"] = guiCreateButton(x+addx, y-addy, width, height, "Senden", false)
  749.        
  750.         addx = 880
  751.         addy = -423
  752.         addx = addx/1920*sx
  753.         addy = addy/1920*sx
  754.         width, height = 79/1.5, 48/1.5
  755.         width, height = width/1920*sx, height/1920*sx
  756.        
  757.         button["messenger:button_discard"] = guiCreateButton(x+addx, y-addy, width, height, "Abbrechen", false)
  758.         guiSetAlpha(button["messenger:button_send"], 0)
  759.         guiSetAlpha(button["messenger:button_discard"], 0)
  760.        
  761.         addEventHandler("onClientGUIClick", button["messenger:button_send"], function()
  762.             local empfaenger = guiGetText(button["messenger:edit_to"])
  763.             if(gettok(empfaenger, 2, "@") ~= webserver) then outputChatBox("Du kannst nur Emails an Spieler@"..webserver.." senden!", 255, 0, 0) return end
  764.             local text = guiGetText(button["messenger:memo_message"])
  765.             local betreff = guiGetText(button["messenger:edit_subject"])
  766.             triggerServerEvent("onMTHandyAction", gMe, "emailsend", empfaenger, text, webserver, betreff)
  767.             hide_messenger(messengersite)
  768.             show_messenger("1")
  769.             messengersite = "1"
  770.         end, false)
  771.        
  772.         addEventHandler("onClientGUIClick", button["messenger:button_discard"], function()
  773.             hide_messenger(messengersite)
  774.             show_messenger("1")
  775.             messengersite = "1"
  776.         end, false)
  777.     elseif(site == "4") then
  778.         addx = 675
  779.         addy = 50
  780.         addx = addx/1920*sx
  781.         addy = addy/1920*sx
  782.         width, height = 382/1.5, 49/1.5
  783.         width, height = width/1920*sx, height/1920*sx
  784.         button["messenger:read_from"] = guiCreateEdit(x+addx, y-addy, width, height, email_sender, false)
  785.         guiEditSetReadOnly(button["messenger:read_from"], true)
  786.        
  787.         addx = 675
  788.         addy = 0
  789.         addx = addx/1920*sx
  790.         addy = addy/1920*sx
  791.         width, height = 382/1.5, 49/1.5
  792.         width, height = width/1920*sx, height/1920*sx
  793.         button["messenger:read_subject"] = guiCreateEdit(x+addx, y-addy, width, height, email_betreff, false)
  794.         guiEditSetReadOnly(button["messenger:read_subject"], true)
  795.        
  796.        
  797.         addx = 617
  798.         addy = -50
  799.         addx = addx/1920*sx
  800.         addy = addy/1920*sx
  801.         width, height = 479/1.5, 552/1.5
  802.         width, height = width/1920*sx, height/1920*sx
  803.        
  804.         button["messenger:memo_message"] = guiCreateMemo(x+addx, y-addy, width, height, email_text, false)
  805.         guiMemoSetReadOnly(button["messenger:memo_message"], true)
  806.        
  807.         addx = 632
  808.         addy = -423
  809.         addx = addx/1920*sx
  810.         addy = addy/1920*sx
  811.         width, height = 79/1.5, 48/1.5
  812.         width, height = width/1920*sx, height/1920*sx
  813.        
  814.         button["messenger:button_answer"] = guiCreateButton(x+addx, y-addy, width, height, "Antworten", false)
  815.         guiSetAlpha(button["messenger:button_answer"], 0)
  816.        
  817.         addx = 880
  818.         addy = -423
  819.         addx = addx/1920*sx
  820.         addy = addy/1920*sx
  821.         width, height = 79/1.5, 48/1.5
  822.         width, height = width/1920*sx, height/1920*sx
  823.        
  824.         button["messenger:button_delete"] = guiCreateButton(x+addx, y-addy, width, height, "Loeschen", false)
  825.         guiSetAlpha(button["messenger:button_delete"], 0)
  826.         addEventHandler("onClientGUIClick", button["messenger:button_delete"], function()
  827.             if(outboxonly == true) then return end
  828.             triggerServerEvent("onMTHandyAction", gMe, "maildelete", email_id)
  829.             hide_messenger(messengersite)
  830.             show_messenger("1")
  831.             messengersite = "1"
  832.         end, false)
  833.        
  834.         addEventHandler("onClientGUIClick", button["messenger:button_answer"], function()
  835.             if(outboxonly == true) then return end
  836.             local to = guiGetText(button["messenger:read_from"])
  837.             local sub = "RE: "..guiGetText(button["messenger:read_subject"])
  838.             hide_messenger(messengersite)
  839.             show_messenger("3", to, sub)
  840.             messengersite = "3"
  841.         end, false)
  842.     end
  843. end
  844.  
  845.    
  846.  
  847. -- HANDY ACTION BACK --
  848.  
  849. addEventHandler("onMTHandyActionBack", getLocalPlayer(), function(typ, value1, value2, value3)
  850.     if(typ == "emailsinbox") then
  851.         if(isElement(button["messenger:scrollpane_inbox"])) then
  852.             local sx, sy = guiGetScreenSize()
  853.             local x, y = sx/2, sy/2
  854.  
  855.             local addx, addy, width, height, scale
  856.             local result = value1
  857.             local i = 1
  858.             for index, row in pairs(result) do
  859.                 local sender = row['FROM_NAME']
  860.                 local betreff = row['SUBJECT_TEXT']
  861.                 local add = 40*i
  862.                 addx = 600
  863.                 addy = add
  864.                 addx = addx/1920*sx
  865.                 addy = addy/1920*sx
  866.                 width, height = 450/1.5, 60/1.5
  867.                 width, height = width/1920*sx, height/1920*sx
  868.                 button["messenger:scrollpane_label_"..i] = guiCreateLabel(x+addx, y-addy, width, height, "E-Mail "..row['MAILID']..", Von: "..sender.."@"..webserver.."\nBetreff: "..betreff, false, button["messenger:scrollpane_inbox"])
  869.                
  870.                 local this = button["messenger:scrollpane_label_"..i]
  871.                 local id = row['MAILID']
  872.                 guiSetFont(this, "default-bold-small")
  873.                
  874.                 addEventHandler("onClientMouseEnter", this, function()
  875.                     if(source ~= this) then return end
  876.                     guiLabelSetColor(source, 150, 150, 255)
  877.                 end)
  878.                 addEventHandler("onClientMouseLeave", this, function()
  879.                     if(source ~= this) then return end
  880.                     guiLabelSetColor(source, 255, 255, 255)
  881.                 end)
  882.                 addEventHandler("onClientGUIClick", this, function()
  883.                     if(source ~= this) then return end
  884.                     email_text = row['MESSAGE_TEXT']
  885.                     email_sender = row['FROM_NAME']
  886.                     email_betreff = row['SUBJECT_TEXT']
  887.                     email_id = row['MAILID']
  888.                     hide_messenger(messengersite)
  889.                     show_messenger("4")
  890.                     messengersite = "4"
  891.                 end)
  892.                 i = i+1
  893.             end
  894.         end
  895.     elseif(typ == "emailsoutbox") then
  896.         if(isElement(button["messenger:scrollpane_inbox"])) then
  897.             local sx, sy = guiGetScreenSize()
  898.             local x, y = sx/2, sy/2
  899.  
  900.             local addx, addy, width, height, scale
  901.             local result = value1
  902.             local i = 1
  903.             for index, row in pairs(result) do
  904.                 local sender = row['TO_NAME']
  905.                 local betreff = row['SUBJECT_TEXT']
  906.                 local add = 40*i
  907.                 addx = 600
  908.                 addy = add
  909.                 addx = addx/1920*sx
  910.                 addy = addy/1920*sx
  911.                 width, height = 450/1.5, 50/1.5
  912.                 width, height = width/1920*sx, height/1920*sx
  913.                 button["messenger:scrollpane_label_"..i] = guiCreateLabel(x+addx, y-addy, width, height, "E-Mail "..row['MAILID']..", Zu: "..sender.."\nBetreff: "..betreff, false, button["messenger:scrollpane_inbox"])
  914.                
  915.                 local this = button["messenger:scrollpane_label_"..i]
  916.                 local id = row['MAILID']
  917.                 guiSetFont(this, "default-bold-small")
  918.                
  919.                 addEventHandler("onClientMouseEnter", this, function()
  920.                     if(source ~= this) then return end
  921.                     guiLabelSetColor(source, 150, 150, 255)
  922.                 end)
  923.                 addEventHandler("onClientMouseLeave", this, function()
  924.                     if(source ~= this) then return end
  925.                     guiLabelSetColor(source, 255, 255, 255)
  926.                 end)
  927.                 addEventHandler("onClientGUIClick", this, function()
  928.                     if(source ~= this) then return end
  929.                     email_text = row['MESSAGE_TEXT']
  930.                     email_sender = row['FROM_NAME']
  931.                     email_betreff = row['SUBJECT_TEXT']
  932.                     email_id = row['MAILID']
  933.                     hide_messenger(messengersite)
  934.                     show_messenger("4", nil, nil, true)
  935.                     messengersite = "4"
  936.                 end)
  937.                 i = i+1
  938.             end
  939.         end
  940.     end
  941. end)
  942.  
  943.  
  944. function hide_messenger(site)
  945.     if(messenger == false) then return end
  946.     hide_messengersite(site)
  947.     messenger = false
  948. end
  949.  
  950. function hide_messengersite(site)
  951.     if(messenger == true) then
  952.         if(site == "1") or (site == "2") then
  953.             destroyElement(button["messenger:inbox"])
  954.             destroyElement(button["messenger:outbox"])
  955.             destroyElement(button["messenger:recommend"])
  956.             destroyElement(button["messenger:write"])
  957.             destroyElement(button["messenger:scrollpane_inbox"])
  958.         elseif(site == "3") then
  959.             destroyElement(button["messenger:edit_to"])
  960.             destroyElement(button["messenger:edit_subject"])
  961.             destroyElement(button["messenger:memo_message"])
  962.             destroyElement(button["messenger:button_send"])
  963.             destroyElement(button["messenger:button_discard"])
  964.         elseif(site == "4") then
  965.             destroyElement(button["messenger:read_from"])
  966.             destroyElement(button["messenger:read_subject"])
  967.             destroyElement(button["messenger:memo_message"])
  968.             destroyElement(button["messenger:button_answer"])
  969.             destroyElement(button["messenger:button_delete"])
  970.         end
  971.     end
  972. end
  973.  
  974. function hide_memo()
  975.     if(memo == false) then return end
  976.     memo = false
  977.     destroyElement(button["memo:memo"])
  978. end
  979.  
  980. -- INFOBAR --
  981. --[[
  982.     infoBar["text"] = ""
  983.     infoBar["showing"] = false
  984.     infoBar["timer"] = false
  985. ]]
  986.  
  987. function applyIncomingEffect(lenght)
  988.     if not(lenght) then
  989.         lenght = math.random(3000, 5000)
  990.     end
  991.     local s = playSound("data/sounds/interference.mp3", false)
  992.     setTimer(destroyElement, lenght, 1, s)
  993. end
  994.  
  995. function hideInfobar()
  996.     infoBar["showing"] = false
  997.     infoBar["text"] = ""
  998. end
  999.  
  1000. function showInfobar(text, time, r, g, b, silent)
  1001.     if(isTimer(infoBar["timer"])) then
  1002.         killTimer(infoBar["timer"])
  1003.     end
  1004.     if not(r) then r = 255 end
  1005.     if not(g) then g = 255 end
  1006.     if not(b) then b = 255 end
  1007.     if not(time) then time = 3000 end
  1008.     infoBar["text"] = text
  1009.     infoBar["showing"] = true
  1010.     infoBar["r"] = r
  1011.     infoBar["g"] = g
  1012.     infoBar["b"] = b
  1013.     infoBar["time"] = time
  1014.     if(silent ~= true) then
  1015.         playSound("data/sounds/notification1.mp3", false)
  1016.         playSound("data/sounds/vibration1.mp3", false)
  1017.     end
  1018.     if(enabled) then
  1019.         infoBar["timer"] = setTimer(hideInfobar, infoBar["time"], 1)
  1020.     end
  1021. end
  1022.  
  1023. addEventHandler("onLAClientInfobar", getLocalPlayer(), showInfobar)
  1024.  
  1025. --[[
  1026. addCommandHandler("infobar", function(cmd, text)
  1027.     showInfobar(text)
  1028. --  applyIncomingEffect()
  1029. end)]]
  1030.  
  1031.  
  1032. local faq_label = {}
  1033. local faq_words = {}
  1034.  
  1035. local faq_suche = 0
  1036.  
  1037. local last_scrollpos = 0
  1038.  
  1039.  
  1040.  
  1041. function show_faq(id)
  1042.     if not(id) then id = 0 end
  1043.     if(faq == false) then
  1044.         if(id == 0) then
  1045.             guiSetInputMode("no_binds_when_editing")
  1046.             faq = true
  1047.             local sx, sy = guiGetScreenSize()
  1048.             local x, y = sx/2, sy/2
  1049.             local addx, addy, width, height, scale
  1050.             addx = 680
  1051.             addy = 47
  1052.             addx = addx/1920*sx
  1053.             addy = addy/1920*sx
  1054.             width, height = 236, 25
  1055.             width, height = width/1920*sx, height/1920*sx
  1056.             button["faq:searchedit"] = guiCreateEdit(x+addx, y-addy, width, height, "Suche...", false)
  1057.            
  1058.            
  1059.             addx = 630
  1060.             addy = 0
  1061.             addx = addx/1920*sx
  1062.             addy = addy/1920*sx
  1063.             width, height = 457/1.5, 697/1.5
  1064.             width, height = width/1920*sx, height/1920*sx
  1065.             button["faq:pane"] = guiCreateScrollPane(x+addx, y-addy, width, height, false)
  1066.             local i = 1
  1067.             for index, wert in pairs(handy_help_titel) do
  1068.                 local add = (40/1920*sx)*i
  1069.                 addx = 600
  1070.                 addy = add
  1071.                 addx = addx/1920*sx
  1072.                 addy = addy/1920*sx
  1073.                 width, height = 450/1.5, 60/1.5
  1074.                 width, height = width/1920*sx, height/1920*sx
  1075.                 faq_label[i] = guiCreateLabel(x+addx, y-addy, width, height, wert, false, button["faq:pane"])
  1076.                 guiLabelSetColor(faq_label[i], 0, 0, 0)
  1077.                 guiSetFont(faq_label[i], "default-bold-small")
  1078.                
  1079.                 addEventHandler("onClientMouseEnter", faq_label[i], function()
  1080.                     guiLabelSetColor(source, 100, 100, 100)
  1081.                     playSoundFrontEnd(42)
  1082.                 end, false)
  1083.                 addEventHandler("onClientMouseLeave", faq_label[i], function()
  1084.                     guiLabelSetColor(source, 0, 0, 0)
  1085.                 end, false)
  1086.                
  1087.                 addEventHandler("onClientGUIClick", faq_label[i], function()
  1088.                     last_scrollpos = guiScrollPaneGetVerticalScrollPosition(button["faq:pane"])
  1089.                     playSoundFrontEnd(41)
  1090.                     for index, key in pairs(handy_help_titel) do
  1091.                         if(key == guiGetText(source)) then
  1092.                             faq_suche = index
  1093.                             break;
  1094.                         end
  1095.                     end
  1096.                     hide_faq(0)
  1097.                     show_faq(1)
  1098.                     faqsite = 1
  1099.                 end, false)
  1100.                
  1101.                 i = i+1
  1102.             end
  1103.            
  1104.             addEventHandler("onClientGUIClick", button["faq:searchedit"], function()
  1105.                 if(guiGetText(source) == "Suche...") then
  1106.                     guiSetText(source, " ")
  1107.                 end
  1108.             end, false)
  1109.            
  1110.             addEventHandler("onClientGUIChanged", button["faq:searchedit"], function()
  1111.                 local text = guiGetText(source)
  1112.                 for index, label in pairs(faq_label) do
  1113.                     if(isElement(label)) then
  1114.                         destroyElement(label)
  1115.                     end
  1116.                 end
  1117.                 if(text == "Suche...") or (text == "") then
  1118.                     local i = 1
  1119.                     for index, wert in pairs(handy_help_titel) do
  1120.                         local add = (40/1920*sx)*i
  1121.                         addx = 600
  1122.                         addy = add
  1123.                         addx = addx/1920*sx
  1124.                         addy = addy/1920*sx
  1125.                         width, height = 450/1.5, 60/1.5
  1126.                         width, height = width/1920*sx, height/1920*sx
  1127.                         faq_label[i] = guiCreateLabel(x+addx, y-addy, width, height, wert, false, button["faq:pane"])
  1128.                         guiLabelSetColor(faq_label[i], 0, 0, 0)
  1129.                         guiSetFont(faq_label[i], "default-bold-small")
  1130.                         addEventHandler("onClientMouseEnter", faq_label[i], function()
  1131.                             guiLabelSetColor(source, 100, 100, 100)
  1132.                             playSoundFrontEnd(42)
  1133.                         end, false)
  1134.                         addEventHandler("onClientMouseLeave", faq_label[i], function()
  1135.                             guiLabelSetColor(source, 0, 0, 0)
  1136.                         end, false)
  1137.                         addEventHandler("onClientGUIClick", faq_label[i], function()
  1138.                             playSoundFrontEnd(41)
  1139.                             for index, key in pairs(handy_help_titel) do
  1140.                                 if(key == guiGetText(source)) then
  1141.                                     faq_suche = index
  1142.                                     break;
  1143.                                 end
  1144.                             end
  1145.                             hide_faq(0)
  1146.                             show_faq(1)
  1147.                             faqsite = 1
  1148.                         end, false)
  1149.                         i = i+1
  1150.                     end
  1151.                 else
  1152.                     for index, words in pairs(faq_words) do
  1153.                         faq_words[index] = false
  1154.                     end
  1155.                     local i = 1
  1156.                     text2 = string.gsub(text, "?", "%")
  1157.                     text2 = string.lower(text2)
  1158.                     for index, wert in pairs(handy_help_titel) do
  1159.                         wert2 = string.gsub(wert, "?", "%")
  1160.                         wert2 = string.lower(wert2)
  1161.                         for index, cut in pairs(string.explode(wert2, " ")) do
  1162.                             cut = string.gsub(cut, "?", "%")
  1163.                             cut = string.gsub(cut, " ", "")
  1164.                             for index2, cut2 in pairs(string.explode(text2, " ")) do
  1165.                                 cut2 = string.gsub(cut2, "?", "%")
  1166.                                 cut2 = string.gsub(cut2, " ", "")
  1167.                                 if(cut == cut2) then
  1168.                                     if(faq_words[wert] ~= true) then
  1169.                                         local add = (40/1920*sx)*i
  1170.                                         addx = 600
  1171.                                         addy = add
  1172.                                         addx = addx/1920*sx
  1173.                                         addy = addy/1920*sx
  1174.                                         width, height = 450/1.5, 60/1.5
  1175.                                         width, height = width/1920*sx, height/1920*sx
  1176.                                         faq_label[i] = guiCreateLabel(x+addx, y-addy, width, height, wert, false, button["faq:pane"])
  1177.                                         guiLabelSetColor(faq_label[i], 0, 0, 0)
  1178.                                         guiSetFont(faq_label[i], "default-bold-small")
  1179.                                         faq_words[wert] = true
  1180.                                         addEventHandler("onClientMouseEnter", faq_label[i], function()
  1181.                                             guiLabelSetColor(source, 100, 100, 100)
  1182.                                             playSoundFrontEnd(42)
  1183.                                         end, false)
  1184.                                         addEventHandler("onClientMouseLeave", faq_label[i], function()
  1185.                                             guiLabelSetColor(source, 0, 0, 0)
  1186.                                         end, false)
  1187.                                        
  1188.                                         addEventHandler("onClientGUIClick", faq_label[i], function()
  1189.                                             playSoundFrontEnd(41)
  1190.                                             for index, key in pairs(handy_help_titel) do
  1191.                                                 if(key == guiGetText(source)) then
  1192.                                                     faq_suche = index
  1193.                                                     break;
  1194.                                                 end
  1195.                                             end
  1196.                                             hide_faq(0)
  1197.                                             show_faq(1)
  1198.                                             faqsite = 1
  1199.                                         end, false)
  1200.                                         i = i+1
  1201.                                     end
  1202.                                 end
  1203.                             end
  1204.                         end
  1205.                     end
  1206.                 end
  1207.             end, false)
  1208.             guiScrollPaneSetVerticalScrollPosition(button["faq:pane"], last_scrollpos)
  1209.             --[[local addx, addy, width, height, scale
  1210.             local result = value1
  1211.             local i = 1
  1212.             for index, row in pairs(result) do
  1213.                 local sender = row['FROM_NAME']
  1214.                 local betreff = row['SUBJECT_TEXT']
  1215.                 local add = 40*i
  1216.                 addx = 600
  1217.                 addy = add
  1218.                 addx = addx/1920*sx
  1219.                 addy = addy/1920*sx
  1220.                 width, height = 450/1.5, 60/1.5
  1221.                 width, height = width/1920*sx, height/1920*sx
  1222.                 button["messenger:scrollpane_label_"..i] = guiCreateLabel(x+addx, y-addy, width, height, "E-Mail "..row['MAILID']..", Von: "..sender.."@"..webserver.."\nBetreff: "..betreff, false, button["messenger:scrollpane_inbox"])
  1223.                
  1224.                 local this = button["messenger:scrollpane_label_"..i]
  1225.                 local id = row['MAILID']
  1226.                 guiSetFont(this, "default-bold-small")
  1227.                
  1228.                 addEventHandler("onClientMouseEnter", this, function()
  1229.                     if(source ~= this) then return end
  1230.                     guiLabelSetColor(source, 150, 150, 255)
  1231.                 end)
  1232.                 addEventHandler("onClientMouseLeave", this, function()
  1233.                     if(source ~= this) then return end
  1234.                     guiLabelSetColor(source, 255, 255, 255)
  1235.                 end)
  1236.                 addEventHandler("onClientGUIClick", this, function()
  1237.                     if(source ~= this) then return end
  1238.                     email_text = row['MESSAGE_TEXT']
  1239.                     email_sender = row['FROM_NAME']
  1240.                     email_betreff = row['SUBJECT_TEXT']
  1241.                     email_id = row['MAILID']
  1242.                     hide_messenger(messengersite)
  1243.                     show_messenger("4")
  1244.                     messengersite = "4"
  1245.                 end)
  1246.                 i = i+1
  1247.             end]]
  1248.         elseif(id == 1) then
  1249.             local sx, sy = guiGetScreenSize()
  1250.             local x, y = sx/2, sy/2
  1251.             local addx, addy, width, height, scale
  1252.            
  1253.             addx = 680
  1254.             addy = 47
  1255.             addx = addx/1920*sx
  1256.             addy = addy/1920*sx
  1257.             width, height = 236, 25
  1258.             width, height = width/1920*sx, height/1920*sx
  1259.             button["faq:searchedit"] = guiCreateEdit(x+addx, y-addy, width, height, handy_help_titel[faq_suche], false)
  1260.             faq = true
  1261.             addEventHandler("onClientGUIChanged", button["faq:searchedit"], function()
  1262.                 hide_faq(faqsite)
  1263.                 show_faq(0)
  1264.                 faqsite = 0
  1265.             end, false)
  1266.         end
  1267.     end
  1268. end
  1269.  
  1270.  
  1271. function hide_faq(id)
  1272.     if not(id) then id = 0 end
  1273.     if(faq == true) then
  1274.         if(id == 0) then
  1275.             faq = false
  1276.             destroyElement(button["faq:searchedit"])
  1277.             destroyElement(button["faq:pane"])
  1278.             for index, label in pairs(faq_label) do
  1279.                 if(isElement(label)) then
  1280.                     destroyElement(label)
  1281.                 end
  1282.             end
  1283.         elseif(id == 1) then
  1284.             faq = false
  1285.             destroyElement(button["faq:searchedit"])
  1286.         end
  1287.     end
  1288. end
  1289.  
  1290. -- FAQ --
  1291.  
  1292. function show_calculator()
  1293.     if(calculator == true) then return end
  1294.     calculator = true
  1295.     local sx, sy = guiGetScreenSize()
  1296.     local x, y = sx/2, sy/2
  1297.  
  1298.     local addx, addy, width, height, scale
  1299.    
  1300.    
  1301.     -- Special numbers --
  1302.    
  1303.     addx = 620
  1304.     addy = -375
  1305.     addx = addx/1920*sx
  1306.     addy = addy/1920*sx
  1307.     width, height = 114/1.5, 127/1.5
  1308.     width, height = width/1920*sx, height/1920*sx
  1309.     button["cal:num."] = guiCreateButton(x+addx, y-addy, width, height, ".", false)
  1310.    
  1311.     addx = 780
  1312.     addy = -375
  1313.     addx = addx/1920*sx
  1314.     addy = addy/1920*sx
  1315.     width, height = 114/1.5, 127/1.5
  1316.     width, height = width/1920*sx, height/1920*sx
  1317.     button["cal:num="] = guiCreateButton(x+addx, y-addy, width, height, "=", false)
  1318.    
  1319.     addx = 860
  1320.     addy = -375
  1321.     addx = addx/1920*sx
  1322.     addy = addy/1920*sx
  1323.     width, height = 114/1.5, 127/1.5
  1324.     width, height = width/1920*sx, height/1920*sx
  1325.     button["cal:num+"] = guiCreateButton(x+addx, y-addy, width, height, "+", false)
  1326.    
  1327.     addx = 860
  1328.     addy = -285
  1329.     addx = addx/1920*sx
  1330.     addy = addy/1920*sx
  1331.     width, height = 114/1.5, 127/1.5
  1332.     width, height = width/1920*sx, height/1920*sx
  1333.     button["cal:num-"] = guiCreateButton(x+addx, y-addy, width, height, "-", false)
  1334.    
  1335.     addx = 860
  1336.     addy = -195
  1337.     addx = addx/1920*sx
  1338.     addy = addy/1920*sx
  1339.     width, height = 114/1.5, 127/1.5
  1340.     width, height = width/1920*sx, height/1920*sx
  1341.     button["cal:num*"] = guiCreateButton(x+addx, y-addy, width, height, "*", false)
  1342.    
  1343.     addx = 860
  1344.     addy = -105
  1345.     addx = addx/1920*sx
  1346.     addy = addy/1920*sx
  1347.     width, height = 114/1.5, 127/1.5
  1348.     width, height = width/1920*sx, height/1920*sx
  1349.     button["cal:num/"] = guiCreateButton(x+addx, y-addy, width, height, "/", false)
  1350.    
  1351.     addx = 700
  1352.     addy = -375
  1353.     addx = addx/1920*sx
  1354.     addy = addy/1920*sx
  1355.     width, height = 114/1.5, 127/1.5
  1356.     width, height = width/1920*sx, height/1920*sx
  1357.     button["cal:num0"] = guiCreateButton(x+addx, y-addy, width, height, "0", false)
  1358.    
  1359.     addx = 620
  1360.     addy = -285
  1361.     addx = addx/1920*sx
  1362.     addy = addy/1920*sx
  1363.     width, height = 114/1.5, 127/1.5
  1364.     width, height = width/1920*sx, height/1920*sx
  1365.     button["cal:num1"] = guiCreateButton(x+addx, y-addy, width, height, "1", false)
  1366.    
  1367.     addx = 700
  1368.     addy = -285 -- 200 das ist 5!
  1369.     addx = addx/1920*sx
  1370.     addy = addy/1920*sx
  1371.     width, height = 114/1.5, 127/1.5
  1372.     width, height = width/1920*sx, height/1920*sx
  1373.     button["cal:num2"] = guiCreateButton(x+addx, y-addy, width, height, "2", false)
  1374.    
  1375.  
  1376.    
  1377.     addx = 780
  1378.     addy = -285
  1379.     addx = addx/1920*sx
  1380.     addy = addy/1920*sx
  1381.     width, height = 114/1.5, 127/1.5
  1382.     width, height = width/1920*sx, height/1920*sx
  1383.     button["cal:num3"] = guiCreateButton(x+addx, y-addy, width, height, "3", false)
  1384.    
  1385.     addx = 620
  1386.     addy = -195
  1387.     addx = addx/1920*sx
  1388.     addy = addy/1920*sx
  1389.     width, height = 114/1.5, 127/1.5
  1390.     width, height = width/1920*sx, height/1920*sx
  1391.     button["cal:num4"] = guiCreateButton(x+addx, y-addy, width, height, "4", false)
  1392.    
  1393.     addx = 700
  1394.     addy = -195
  1395.     addx = addx/1920*sx
  1396.     addy = addy/1920*sx
  1397.     width, height = 114/1.5, 127/1.5
  1398.     width, height = width/1920*sx, height/1920*sx
  1399.     button["cal:num5"] = guiCreateButton(x+addx, y-addy, width, height, "5", false)
  1400.    
  1401.     addx = 780
  1402.     addy = -195
  1403.     addx = addx/1920*sx
  1404.     addy = addy/1920*sx
  1405.     width, height = 114/1.5, 127/1.5
  1406.     width, height = width/1920*sx, height/1920*sx
  1407.     button["cal:num6"] = guiCreateButton(x+addx, y-addy, width, height, "6", false)
  1408.    
  1409.     addx = 620
  1410.     addy = -105
  1411.     addx = addx/1920*sx
  1412.     addy = addy/1920*sx
  1413.     width, height = 114/1.5, 127/1.5
  1414.     width, height = width/1920*sx, height/1920*sx
  1415.     button["cal:num7"] = guiCreateButton(x+addx, y-addy, width, height, "7", false)
  1416.    
  1417.     addx = 700
  1418.     addy = -105
  1419.     addx = addx/1920*sx
  1420.     addy = addy/1920*sx
  1421.     width, height = 114/1.5, 127/1.5
  1422.     width, height = width/1920*sx, height/1920*sx
  1423.     button["cal:num8"] = guiCreateButton(x+addx, y-addy, width, height, "8", false)
  1424.    
  1425.     addx = 780
  1426.     addy = -105
  1427.     addx = addx/1920*sx
  1428.     addy = addy/1920*sx
  1429.     width, height = 114/1.5, 127/1.5
  1430.     width, height = width/1920*sx, height/1920*sx
  1431.     button["cal:num9"] = guiCreateButton(x+addx, y-addy, width, height, "9", false)
  1432.    
  1433.     addx = 860
  1434.     addy = -55
  1435.     addx = addx/1920*sx
  1436.     addy = addy/1920*sx
  1437.     width, height = 114/1.5, 74/1.5
  1438.     width, height = width/1920*sx, height/1920*sx
  1439.     button["cal:numdel"] = guiCreateButton(x+addx, y-addy, width, height, "del", false)
  1440.    
  1441.     guiSetAlpha(button["cal:num0"], 0)
  1442.     guiSetAlpha(button["cal:num1"], 0)
  1443.     guiSetAlpha(button["cal:num2"], 0)
  1444.     guiSetAlpha(button["cal:num3"], 0)
  1445.     guiSetAlpha(button["cal:num4"], 0)
  1446.     guiSetAlpha(button["cal:num5"], 0)
  1447.     guiSetAlpha(button["cal:num6"], 0)
  1448.     guiSetAlpha(button["cal:num7"], 0)
  1449.     guiSetAlpha(button["cal:num8"], 0)
  1450.     guiSetAlpha(button["cal:num9"], 0)
  1451.     guiSetAlpha(button["cal:num+"], 0)
  1452.     guiSetAlpha(button["cal:num-"], 0)
  1453.     guiSetAlpha(button["cal:num*"], 0)
  1454.     guiSetAlpha(button["cal:num/"], 0)
  1455.     guiSetAlpha(button["cal:numdel"], 0)
  1456.     guiSetAlpha(button["cal:num."], 0)
  1457.     guiSetAlpha(button["cal:num="], 0)
  1458.    
  1459.     -- EVENT HANDLERS --
  1460.     addEventHandler("onClientGUIClick", button["cal:num+"], function()
  1461.         local l = #cal_anzeige
  1462.         if(l > 29) or (l < 1) then return end
  1463.         local last = string.sub(cal_anzeige, #cal_anzeige, #cal_anzeige)
  1464.         if(last == "+") or (last == "-") or (last == "*") or (last == "/") or (last == ".") then return end
  1465.         cal_anzeige = cal_anzeige.."+"
  1466.     end, false)
  1467.     addEventHandler("onClientGUIClick", button["cal:num-"], function()
  1468.         local l = #cal_anzeige
  1469.         if(l > 29) or (l < 1) then return end
  1470.         local last = string.sub(cal_anzeige, #cal_anzeige, #cal_anzeige)
  1471.         outputChatBox(last)
  1472.         if(last == "+") or (last == "-") or (last == "*") or (last == "/") or (last == ".") then return end
  1473.         cal_anzeige = cal_anzeige.."-"
  1474.     end, false)
  1475.     addEventHandler("onClientGUIClick", button["cal:num*"], function()
  1476.         local l = #cal_anzeige
  1477.         if(l > 29) or (l < 1) then return end
  1478.         local last = string.sub(cal_anzeige, #cal_anzeige, #cal_anzeige)
  1479.         if(last == "+") or (last == "-") or (last == "*") or (last == "/") or (last == ".") then return end
  1480.         cal_anzeige = cal_anzeige.."*"
  1481.     end, false)
  1482.     addEventHandler("onClientGUIClick", button["cal:num/"], function()
  1483.         local l = #cal_anzeige
  1484.         if(l > 29) or (l < 1) then return end
  1485.         local last = string.sub(cal_anzeige, #cal_anzeige, #cal_anzeige)
  1486.         if(last == "+") or (last == "-") or (last == "*") or (last == "/") or (last == ".") then return end
  1487.         cal_anzeige = cal_anzeige.."/"
  1488.     end, false)
  1489.     addEventHandler("onClientGUIClick", button["cal:num."], function()
  1490.         local l = #cal_anzeige
  1491.         if(l > 29) or (l < 1) then return end
  1492.         local last = string.sub(cal_anzeige, #cal_anzeige, #cal_anzeige)
  1493.         if(last == "+") or (last == "-") or (last == "*") or (last == "/") or (last == ".") then return end
  1494.         cal_anzeige = cal_anzeige.."."
  1495.     end, false)
  1496.     addEventHandler("onClientGUIClick", button["cal:num0"], function()
  1497.         local l = #cal_anzeige
  1498.         if(l > 29)  then return end
  1499.         cal_anzeige = cal_anzeige.."0"
  1500.     end, false)
  1501.     addEventHandler("onClientGUIClick", button["cal:num1"], function()
  1502.         local l = #cal_anzeige
  1503.         if(l > 29) then return end
  1504.         cal_anzeige = cal_anzeige.."1"
  1505.     end, false)
  1506.     addEventHandler("onClientGUIClick", button["cal:num2"], function()
  1507.         local l = #cal_anzeige
  1508.         if(l > 29) then return end
  1509.         cal_anzeige = cal_anzeige.."2"
  1510.     end, false)
  1511.     addEventHandler("onClientGUIClick", button["cal:num3"], function()
  1512.         local l = #cal_anzeige
  1513.         if(l > 29) then return end
  1514.         cal_anzeige = cal_anzeige.."3"
  1515.     end, false)
  1516.     addEventHandler("onClientGUIClick", button["cal:num4"], function()
  1517.         local l = #cal_anzeige
  1518.         if(l > 29) then return end
  1519.         cal_anzeige = cal_anzeige.."4"
  1520.     end, false)
  1521.     addEventHandler("onClientGUIClick", button["cal:num5"], function()
  1522.         local l = #cal_anzeige
  1523.         if(l > 29) then return end
  1524.         cal_anzeige = cal_anzeige.."5"
  1525.     end, false)
  1526.     addEventHandler("onClientGUIClick", button["cal:num6"], function()
  1527.         local l = #cal_anzeige
  1528.         if(l > 29) then return end
  1529.         cal_anzeige = cal_anzeige.."6"
  1530.     end, false)
  1531.     addEventHandler("onClientGUIClick", button["cal:num7"], function()
  1532.         local l = #cal_anzeige
  1533.         if(l > 29) then return end
  1534.         cal_anzeige = cal_anzeige.."7"
  1535.     end, false)
  1536.     addEventHandler("onClientGUIClick", button["cal:num8"], function()
  1537.         local l = #cal_anzeige
  1538.         if(l > 29) then return end
  1539.         cal_anzeige = cal_anzeige.."8"
  1540.     end, false)
  1541.     addEventHandler("onClientGUIClick", button["cal:num9"], function()
  1542.         local l = #cal_anzeige
  1543.         if(l > 29) then return end
  1544.         cal_anzeige = cal_anzeige.."9"
  1545.     end, false)
  1546.     addEventHandler("onClientGUIClick", button["cal:num="], function()
  1547.         local wert = string.format("%f", tostring(loadstring("return "..cal_anzeige)()))
  1548.         cal_anzeige = wert
  1549.     end, false)
  1550.     addEventHandler("onClientGUIClick", button["cal:numdel"], function()
  1551.         cal_anzeige = string.sub(cal_anzeige, 1, #cal_anzeige-1)
  1552.     end, false)
  1553. end
  1554.  
  1555. function hide_calculator()
  1556.     if(calculator == false) then return end
  1557.     calculator = false
  1558.     destroyElement(button["cal:num0"])
  1559.     destroyElement(button["cal:num1"])
  1560.     destroyElement(button["cal:num2"])
  1561.     destroyElement(button["cal:num3"])
  1562.     destroyElement(button["cal:num4"])
  1563.     destroyElement(button["cal:num5"])
  1564.     destroyElement(button["cal:num6"])
  1565.     destroyElement(button["cal:num7"])
  1566.     destroyElement(button["cal:num8"])
  1567.     destroyElement(button["cal:num9"])
  1568.     destroyElement(button["cal:num="])
  1569.     destroyElement(button["cal:num*"])
  1570.     destroyElement(button["cal:num/"])
  1571.     destroyElement(button["cal:num+"])
  1572.     destroyElement(button["cal:num-"])
  1573.     destroyElement(button["cal:numdel"])
  1574.     destroyElement(button["cal:num."])
  1575. end
  1576.  
  1577. -- DEBUB SHIT --
  1578. --[[
  1579. addCommandHandler("ammu", function()
  1580.     local url = "www.ammunation.com"
  1581.     local curl = c_url
  1582.     last_url = c_url
  1583.     hide_browsersite(page_images[curl])
  1584.     local image = page_images[url]
  1585.     if not(image) then image = "404" end
  1586.     show_browsersite(image)
  1587.     c_url = url
  1588. end)]]
  1589.  
  1590. function show_browsersite(name)
  1591.     if(site[name] == name) then return end
  1592.     site[name] = name
  1593.     local sx, sy = guiGetScreenSize()
  1594.     local x, y = sx/2, sy/2
  1595.     local this
  1596.     local addx, addy, width, height, scale
  1597.     guiSetInputMode("no_binds_when_editing")
  1598.     if(name == "startpage") then
  1599.         addx = 621
  1600.         addy = -138
  1601.         addx = addx/1920*sx
  1602.         addy = addy/1920*sx
  1603.         width, height = 410/1.5, 62/1.5
  1604.         width, height = width/1920*sx, height/1920*sx
  1605.         button["browser:startpage_edit"] = guiCreateEdit(x+addx, y-addy, width, height, last_url, false)
  1606.        
  1607.         addx = 891
  1608.         addy = -138
  1609.         addx = addx/1920*sx
  1610.         addy = addy/1920*sx
  1611.         width, height = 62/1.5, 62/1.5
  1612.         width, height = width/1920*sx, height/1920*sx
  1613.         button["browser:startpage_button"] = guiCreateButton(x+addx, y-addy, width, height, "Los", false)
  1614.         guiSetAlpha(button["browser:startpage_button"], 0)
  1615.        
  1616.         addx = 630
  1617.         addy = -350
  1618.         addx = addx/1920*sx
  1619.         addy = addy/1920*sx
  1620.         width, height = 421/1.5, 129/1.5
  1621.         width, height = width/1920*sx, height/1920*sx
  1622.         button["browser:startpage_btn_auswahl"] = guiCreateButton(x+addx, y-addy, width, height, "Auswahl", false)
  1623.         guiSetAlpha(button["browser:startpage_btn_auswahl"], 0)
  1624.        
  1625.         addx = 640
  1626.         addy = -252
  1627.         addx = addx/1920*sx
  1628.         addy = addy/1920*sx
  1629.         width, height = 421/1.5, 129/1.5
  1630.         width, height = width/1920*sx, height/1920*sx
  1631.         button["browser:startpage_btn_auswahl2"] = guiCreateButton(x+addx, y-addy, width, height, "Auswahl", false)
  1632.         guiSetAlpha(button["browser:startpage_btn_auswahl2"], 0)
  1633.         addEventHandler("onClientGUIClick", button["browser:startpage_btn_auswahl2"], function()
  1634.             local url = "www.loogle.com/selectmore"
  1635.             if(tonumber(empfang) > 1) then
  1636.                
  1637.             else
  1638.                 url = "10060"
  1639.             end
  1640.             local curl = c_url
  1641.             hide_browsersite(page_images[curl])
  1642.             local image = page_images[url]
  1643.             show_browsersite(image)
  1644.             c_url = url
  1645.         end, false)
  1646.        
  1647.         addEventHandler("onClientGUIClick", button["browser:startpage_btn_auswahl"], function()
  1648.             local url = "www.loogle.com/select"
  1649.             if(tonumber(empfang) > 1) then
  1650.                
  1651.             else
  1652.                 url = "10060"
  1653.             end
  1654.             local curl = c_url
  1655.             hide_browsersite(page_images[curl])
  1656.             local image = page_images[url]
  1657.             show_browsersite(image)
  1658.             c_url = url
  1659.         end, false)
  1660.        
  1661.         -- EVENT HANDLERS --
  1662.         addEventHandler("onClientGUIClick", button["browser:startpage_button"], function()
  1663.             local url = guiGetText(button["browser:startpage_edit"])
  1664.             if(tonumber(empfang) > 1) then
  1665.                
  1666.             else
  1667.                 url = "10060"
  1668.             end
  1669.             local curl = c_url
  1670.             last_url = c_url
  1671.             hide_browsersite(page_images[curl])
  1672.             local image = page_images[url]
  1673.             if not(image) then
  1674.                 image = "404"
  1675.             end
  1676.             show_browsersite(image)
  1677.             c_url = url
  1678.         end, false)
  1679.     elseif(name == "404") then
  1680.         --[[
  1681.          for i, player in ipairs(getElementsByType("player")) do
  1682.             if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then
  1683.                 return player
  1684.             end
  1685.         end]]
  1686.     addx = 675
  1687.     addy = -220
  1688.     addx = addx/1920*sx
  1689.     addy = addy/1920*sx
  1690.     width, height = 400/1.5, 50/1.5
  1691.     width, height = width/1920*sx, height/1920*sx
  1692.     button["browser:404_infolabel"] = guiCreateLabel(x+addx, y-addy, width, height, "Die von dir angeforderte Seite\nkann nicht gefunden werden.", false)
  1693.     local this = button["browser:404_infolabel"]
  1694.     guiSetFont(this, "default-bold-small")
  1695.     guiLabelSetColor(this, 0, 0, 0)
  1696.     -- CHECK --
  1697.     -- Buggy, it finds only loogle.com --
  1698.     local url = c_url
  1699.     local teil = ""
  1700.     local sitefound = {}
  1701.     sitefound["state"] = false
  1702.     sitefound["site"] = ""
  1703.     if(gettok(c_url, 1, ".")) and (gettok(c_url, 2, ".")) and (gettok(c_url, 3, ".")) then
  1704.         teil = gettok(c_url, 2, ".")
  1705.     else
  1706.         teil = c_url
  1707.     end
  1708.     for site, image in next, page_images do
  1709.         if(gettok(c_url, 1, ".")) and (gettok(c_url, 2, ".")) and (gettok(c_url, 3, ".")) then
  1710.             if string.find(site:lower(), "%s"..tostring(teil):lower(), 1, true) then
  1711.                 sitefound["state"] = true
  1712.                 sitefound["site"] = site
  1713.                 break;
  1714.             end
  1715.         else
  1716.             if string.find(image:lower(), "%s"..tostring(teil):lower(), 1, true) then
  1717.                 sitefound["state"] = true
  1718.                 sitefound["site"] = site
  1719.                 break;
  1720.             end
  1721.         end
  1722.     end
  1723.     if(sitefound["state"] == true) then
  1724.         guiSetText(this, "Did you mean\n"..sitefound["site"].."?")
  1725.     end
  1726.     elseif(name == "auswahlpage") then
  1727.         -- Knoepfe
  1728.         addx = 615
  1729.         addy = -132+88
  1730.         addx = addx/1920*sx
  1731.         addy = addy/1920*sx
  1732.         width, height = 480/1.5, 130/1.5
  1733.         width, height = width/1920*sx, height/1920*sx
  1734.         button["browser:auswahl_google"] = guiCreateButton(x+addx, y-addy, width, height, "", false)
  1735.         guiSetAlpha(button["browser:auswahl_google"], 0)
  1736.         addEventHandler("onClientGUIClick", button["browser:auswahl_google"], function()
  1737.             local url = "www.loogle.com"
  1738.             local curl = c_url
  1739.             last_url = c_url
  1740.             hide_browsersite(page_images[curl])
  1741.             local image = page_images[url]
  1742.             if not(image) then image = "404" end
  1743.             show_browsersite(image)
  1744.             c_url = url
  1745.         end, false)
  1746.        
  1747.         addx = 615
  1748.         addy = -132
  1749.         addx = addx/1920*sx
  1750.         addy = addy/1920*sx
  1751.         width, height = 480/1.5, 130/1.5
  1752.         width, height = width/1920*sx, height/1920*sx
  1753.         button["browser:auswahl_clucking"] = guiCreateButton(x+addx, y-addy, width, height, "", false)
  1754.         guiSetAlpha(button["browser:auswahl_clucking"], 0)
  1755.        
  1756.         addEventHandler("onClientGUIClick", button["browser:auswahl_clucking"], function()
  1757.             local url = "www.cluckingbell.com"
  1758.             local curl = c_url
  1759.             last_url = c_url
  1760.             hide_browsersite(page_images[curl])
  1761.             local image = page_images[url]
  1762.             if not(image) then image = "404" end
  1763.             show_browsersite(image)
  1764.             c_url = url
  1765.         end, false)
  1766.        
  1767.        
  1768.         addx = 615
  1769.         addy = -220
  1770.         addx = addx/1920*sx
  1771.         addy = addy/1920*sx
  1772.         width, height = 480/1.5, 130/1.5
  1773.         width, height = width/1920*sx, height/1920*sx
  1774.         button["browser:auswahl_hospital"] = guiCreateButton(x+addx, y-addy, width, height, "", false)
  1775.         guiSetAlpha(button["browser:auswahl_hospital"], 0)
  1776.        
  1777.         addEventHandler("onClientGUIClick", button["browser:auswahl_hospital"], function()
  1778.             local url = "www.hospital.com"
  1779.             local curl = c_url
  1780.             last_url = c_url
  1781.             hide_browsersite(page_images[curl])
  1782.             local image = page_images[url]
  1783.             if not(image) then image = "404" end
  1784.             show_browsersite(image)
  1785.             c_url = url
  1786.         end, false)
  1787.        
  1788.         addx = 615
  1789.         addy = -220-88
  1790.         addx = addx/1920*sx
  1791.         addy = addy/1920*sx
  1792.         width, height = 480/1.5, 130/1.5
  1793.         width, height = width/1920*sx, height/1920*sx
  1794.         button["browser:auswahl_pns"] = guiCreateButton(x+addx, y-addy, width, height, "", false)
  1795.         guiSetAlpha(button["browser:auswahl_pns"], 0)
  1796.        
  1797.         addEventHandler("onClientGUIClick", button["browser:auswahl_pns"], function()
  1798.             local url = "www.paynspray.com"
  1799.             local curl = c_url
  1800.             last_url = c_url
  1801.             hide_browsersite(page_images[curl])
  1802.             local image = page_images[url]
  1803.             if not(image) then image = "404" end
  1804.             show_browsersite(image)
  1805.             c_url = url
  1806.         end, false)
  1807.        
  1808.         addx = 615
  1809.         addy = -220-(88*2)
  1810.         addx = addx/1920*sx
  1811.         addy = addy/1920*sx
  1812.         width, height = 480/1.5, 103/1.5
  1813.         width, height = width/1920*sx, height/1920*sx
  1814.         button["browser:auswahl_bank"] = guiCreateButton(x+addx, y-addy, width, height, "", false)
  1815.         guiSetAlpha(button["browser:auswahl_bank"], 0)
  1816.        
  1817.         addEventHandler("onClientGUIClick", button["browser:auswahl_bank"], function()
  1818.             local url = "www.bank.com"
  1819.             local curl = c_url
  1820.             last_url = c_url
  1821.             hide_browsersite(page_images[curl])
  1822.             local image = page_images[url]
  1823.             if not(image) then image = "404" end
  1824.             show_browsersite(image)
  1825.             c_url = url
  1826.         end, false)
  1827.     elseif(name == "auswahlpage2") then
  1828.         -- Knoepfe
  1829.         addx = 615
  1830.         addy = -132+88
  1831.         addx = addx/1920*sx
  1832.         addy = addy/1920*sx
  1833.         width, height = 480/1.5, 130/1.5
  1834.         width, height = width/1920*sx, height/1920*sx
  1835.         button["browser:auswahl_google"] = guiCreateButton(x+addx, y-addy, width, height, "", false)
  1836.         guiSetAlpha(button["browser:auswahl_google"], 0)
  1837.         addEventHandler("onClientGUIClick", button["browser:auswahl_google"], function()
  1838.             local url = "www.loogle.com"
  1839.             local curl = c_url
  1840.             last_url = c_url
  1841.             hide_browsersite(page_images[curl])
  1842.             local image = page_images[url]
  1843.             if not(image) then image = "404" end
  1844.             show_browsersite(image)
  1845.             c_url = url
  1846.         end, false)
  1847.        
  1848.         addx = 615
  1849.         addy = -132
  1850.         addx = addx/1920*sx
  1851.         addy = addy/1920*sx
  1852.         width, height = 480/1.5, 130/1.5
  1853.         width, height = width/1920*sx, height/1920*sx
  1854.         button["browser:auswahl_ammu"] = guiCreateButton(x+addx, y-addy, width, height, "", false)
  1855.         guiSetAlpha(button["browser:auswahl_ammu"], 0)
  1856.        
  1857.         addEventHandler("onClientGUIClick", button["browser:auswahl_ammu"], function()
  1858.             local url = "www.ammunation.com"
  1859.             local curl = c_url
  1860.             last_url = c_url
  1861.             hide_browsersite(page_images[curl])
  1862.             local image = page_images[url]
  1863.             if not(image) then image = "404" end
  1864.             show_browsersite(image)
  1865.             c_url = url
  1866.         end, false)
  1867.        
  1868.         addx = 617
  1869.         addy = -220
  1870.         addx = addx/1920*sx
  1871.         addy = addy/1920*sx
  1872.         width, height = 480/1.5, 130/1.5
  1873.         width, height = width/1920*sx, height/1920*sx
  1874.         button["browser:auswahl_casino"] = guiCreateButton(x+addx, y-addy, width, height, "", false)
  1875.         guiSetAlpha(button["browser:auswahl_casino"], 0)
  1876.        
  1877.         addEventHandler("onClientGUIClick", button["browser:auswahl_casino"], function()
  1878.             local url = "www.casino.com"
  1879.             local curl = c_url
  1880.             last_url = c_url
  1881.             hide_browsersite(page_images[curl])
  1882.             local image = page_images[url]
  1883.             if not(image) then image = "404" end
  1884.             show_browsersite(image)
  1885.             c_url = url
  1886.         end, false)
  1887.        
  1888.         addx = 617
  1889.         addy = -220-88
  1890.         addx = addx/1920*sx
  1891.         addy = addy/1920*sx
  1892.         width, height = 480/1.5, 130/1.5
  1893.         width, height = width/1920*sx, height/1920*sx
  1894.         button["browser:auswahl_background"] = guiCreateButton(x+addx, y-addy, width, height, "", false)
  1895.         guiSetAlpha(button["browser:auswahl_background"], 0)
  1896.        
  1897.         addEventHandler("onClientGUIClick", button["browser:auswahl_background"], function()
  1898.             local url = "www.backgrounds.com"
  1899.             local curl = c_url
  1900.             last_url = c_url
  1901.             hide_browsersite(page_images[curl])
  1902.             local image = page_images[url]
  1903.             if not(image) then image = "404" end
  1904.             show_browsersite(image)
  1905.             c_url = url
  1906.         end, false)
  1907.        
  1908.         addx = 615
  1909.         addy = -220-(88*2)
  1910.         addx = addx/1920*sx
  1911.         addy = addy/1920*sx
  1912.         width, height = 480/1.5, 103/1.5
  1913.         width, height = width/1920*sx, height/1920*sx
  1914.         button["browser:auswahl_pizza"] = guiCreateButton(x+addx, y-addy, width, height, "", false)
  1915.         guiSetAlpha(button["browser:auswahl_pizza"], 0)
  1916.        
  1917.         addEventHandler("onClientGUIClick", button["browser:auswahl_pizza"], function()
  1918.             local url = "www.pizza.com"
  1919.             local curl = c_url
  1920.             last_url = c_url
  1921.             hide_browsersite(page_images[curl])
  1922.             local image = page_images[url]
  1923.             if not(image) then image = "404" end
  1924.             show_browsersite(image)
  1925.             c_url = url
  1926.         end, false)
  1927.     elseif(name == "backgrounds") then
  1928.         addx = 630
  1929.         addy = -120
  1930.         addx = addx/1920*sx
  1931.         addy = addy/1920*sx
  1932.         width, height = 448/1.5, 442/1.5
  1933.         width, height = width/1920*sx, height/1920*sx
  1934.         button["browser:backgrounds_grid"] = guiCreateGridList(x+addx, y-addy, width, height, false)
  1935.         guiGridListAddColumn(button["browser:backgrounds_grid"], "ID", 0.3)
  1936.         guiGridListAddColumn(button["browser:backgrounds_grid"], "Name", 0.55)
  1937.        
  1938.         for i = 1, #handy_backgrounds, 1 do
  1939.             local index = i
  1940.             local key = handy_backgrounds[i]
  1941.             local row = guiGridListAddRow(button["browser:backgrounds_grid"])
  1942.             guiGridListSetItemText(button["browser:backgrounds_grid"], row, 1, index, false, false)
  1943.             guiGridListSetItemText(button["browser:backgrounds_grid"], row, 2, key, false, false)
  1944.         end
  1945.        
  1946.         guiSetFont(button["browser:backgrounds_grid"], "default-bold-small")
  1947.         addx = 630
  1948.         addy = -420
  1949.         addx = addx/1920*sx
  1950.         addy = addy/1920*sx
  1951.         width, height = 177/1.5, 47/1.5
  1952.         width, height = width/1920*sx, height/1920*sx
  1953.         button["browser:backgrounds_button"] = guiCreateButton(x+addx, y-addy, width, height, "Aktivieren", false)
  1954.        
  1955.         addEventHandler("onClientGUIClick", button["browser:backgrounds_button"], function()
  1956.             local id = tonumber(guiGridListGetItemText(button["browser:backgrounds_grid"], guiGridListGetSelectedItem(button["browser:backgrounds_grid"]), 1))
  1957.             if(id) then
  1958.                 if not(fileExists("data/images/galaxy/icons/backgrounds/background"..id..".jpg")) then
  1959.                     downloadFile("data/images/galaxy/icons/backgrounds/background"..id..".jpg")
  1960.                 end
  1961.                 current_background = id
  1962.                 outputChatBox("Hintergrund ausgewaehlt! Solltest du ihn nicht gedownloadet haben, wirst du es spaetestens jetzt tun.", 0, 255, 0)
  1963.                 triggerServerEvent("onMTHandyAction", gMe, "backgroundupdate", current_background)
  1964.             else
  1965.                 outputChatBox("Du musst ein Item aus der Liste auswaehlen!", 255, 0, 0)
  1966.             end
  1967.         end, false)
  1968.     elseif(name == "pizza") then
  1969.    
  1970.         addx = 630
  1971.         addy = -350
  1972.         addx = addx/1920*sx
  1973.         addy = addy/1920*sx
  1974.         width, height = 120/1.5, 100/1.5
  1975.         width, height = width/1920*sx, height/1920*sx
  1976.         button["browser:pizza_buy"] = guiCreateButton(x+addx, y-addy, width, height, "Pizza liefern\n25$", false)
  1977.    
  1978.         addEventHandler("onClientGUIClick", button["browser:pizza_buy"], function()
  1979.             triggerServerEvent("onMTHandyAction", getLocalPlayer(), "pizza")
  1980.         end, false)
  1981.     elseif(name == "hospital") then
  1982.    
  1983.         addx = 630
  1984.         addy = -350
  1985.         addx = addx/1920*sx
  1986.         addy = addy/1920*sx
  1987.         width, height = 120/1.5, 100/1.5
  1988.         width, height = width/1920*sx, height/1920*sx
  1989.         button["browser:hospital_buy"] = guiCreateButton(x+addx, y-addy, width, height, "Medikit liefern\n50$", false)
  1990.    
  1991.         addEventHandler("onClientGUIClick", button["browser:hospital_buy"], function()
  1992.             triggerServerEvent("onMTHandyAction", getLocalPlayer(), "medicine")
  1993.         end, false)
  1994.     elseif(name == "house") then
  1995.    
  1996.         addx = 620
  1997.         addy = -430
  1998.         addx = addx/1920*sx
  1999.         addy = addy/1920*sx
  2000.         width, height = 191/1.5, 48/1.5
  2001.         width, height = width/1920*sx, height/1920*sx
  2002.         button["browser:house_mark"] = guiCreateButton(x+addx, y-addy, width, height, "Mark", false)
  2003.         guiSetAlpha(button["browser:house_mark"], 0)
  2004.        
  2005.         addx = 620
  2006.         addy = -150
  2007.         addx = addx/1920*sx
  2008.         addy = addy/1920*sx
  2009.         width, height = 439/1.5, 407/1.5
  2010.         width, height = width/1920*sx, height/1920*sx
  2011.         button["browser:house_grid"] = guiCreateGridList(x+addx, y-addy, width, height, false)
  2012.        
  2013.         guiGridListAddColumn(button["browser:house_grid"], "ID", 0.2)
  2014.         guiGridListAddColumn(button["browser:house_grid"], "Ort", 0.5)
  2015.         guiGridListAddColumn(button["browser:house_grid"], "Preis", 0.3)
  2016.         guiGridListSetSelectionMode(button["browser:house_grid"], 1)
  2017.         local housePos = {}
  2018.        
  2019.         -- List fill
  2020.         for index, colshape in pairs(getElementsByType("pickup")) do
  2021.             if(getElementData(colshape, "OWNER") ) and (getElementData(colshape, "OWNER") == getPlayerName(gMe)) then
  2022.                 local x1, y1, z1 = getElementPosition(colshape)
  2023.                 local zone1, zone2 = getZoneName(x1, y1, z1, false), getZoneName(x1, y1, z1, true)
  2024.                 local id = getElementData(colshape, "ID")
  2025.                 local preis = getElementData(colshape, "PRICE")
  2026.                 local row = guiGridListAddRow(button["browser:house_grid"])
  2027.                 guiGridListSetItemText(button["browser:house_grid"], row, 1, id, false, false)
  2028.                 guiGridListSetItemText(button["browser:house_grid"], row, 2, zone1..", "..zone2, false, false)
  2029.                 guiGridListSetItemText(button["browser:house_grid"], row, 3, "$"..preis, false, false)
  2030.                 housePos[id] = {}
  2031.                 housePos[id]["x"] = x1
  2032.                 housePos[id]["y"] = y1
  2033.                 housePos[id]["z"] = z1
  2034.             end
  2035.         end
  2036.         -- EVENT HANDLERS --
  2037.         addEventHandler("onClientGUIClick", button["browser:house_mark"], function()
  2038.             local id = tonumber(guiGridListGetItemText(button["browser:house_grid"], guiGridListGetSelectedItem(button["browser:house_grid"]), 1))
  2039.             if not (id) then outputChatBox("Du musst eines deiner Haeuser auswaehlen, solange du eins Besitzt!", 255, 0, 0) return end
  2040.             local x, y, z = housePos[id]["x"], housePos[id]["y"], housePos[id]["z"]
  2041.             if(isElement(houseBlip)) then return end
  2042.             houseBlip = createBlip(x, y, z, 0, 2, 0, 255, 255, 255, 0, 99999.0)
  2043.             setTimer(destroyElement, 10000, 1, houseBlip)
  2044.             outputChatBox("Dein Haus wird dir auf deinem Radar angezeigt!", 0, 255, 0)
  2045.         end, false)
  2046.     elseif(name == "fahrzeuge") then
  2047.         addx = 620
  2048.         addy = -50
  2049.         addx = addx/1920*sx
  2050.         addy = addy/1920*sx
  2051.         width, height = 480/1.5, 450/1.5
  2052.         width, height = width/1920*sx, height/1920*sx
  2053.         button["browser:car_grid"] = guiCreateGridList(x+addx, y-addy, width, height, false)
  2054.        
  2055.         guiGridListAddColumn(button["browser:car_grid"], "Slot", 0.2)
  2056.         guiGridListAddColumn(button["browser:car_grid"], "Name", 0.3)
  2057.         guiGridListAddColumn(button["browser:car_grid"], "Standort", 0.4)
  2058.         guiGridListSetSelectionMode(button["browser:car_grid"], 1)
  2059.         guiSetFont(button["browser:car_grid"], "default-bold-small")
  2060.         color = 0
  2061.         for index, k in pairs(getElementsByType("vehicle")) do
  2062.             if(getElementData(k, "owner") ) and (getElementData(k, "owner") == getPlayerName(gMe)) then
  2063.                
  2064.                 local x1, y1, z1 = getElementPosition(k)
  2065.                 if(isElement(vehBlip[k])) then
  2066.                     destroyElement(vehBlip[k])
  2067.                 end
  2068.                
  2069.                 local zone1, zone2 = getZoneName(x1, y1, z1, false), getZoneName(x1, y1, z1, true)
  2070.                 local id = getElementData(k, "carslotnr_owner")
  2071.                 local name = getVehicleNameFromModel(getElementModel(k))
  2072.                 local row = guiGridListAddRow(button["browser:car_grid"])
  2073.                 guiGridListSetItemText(button["browser:car_grid"], row, 1, id, false, false)
  2074.                 guiGridListSetItemText(button["browser:car_grid"], row, 2, name, false, false)
  2075.                 guiGridListSetItemText(button["browser:car_grid"], row, 3, zone1..", "..zone2, false, false)
  2076.                 -- GPS --
  2077.                 if(getElementData(k, "gps")) then
  2078.                     color = color + 1
  2079.                     vehBlip[k] = createBlip ( x1, y1, z1, 0, 2, vehBlipColor["r"][color], vehBlipColor["g"][color], vehBlipColor["b"][color], 255, 0, 99999.0)
  2080.                     setTimer ( function() if(isElement(vehBlip[k])) then destroyElement(vehBlip[k]) end end, 10000, 1)
  2081.                     for i = 1, 3, 1 do guiGridListSetItemColor(button["browser:car_grid"], row, i, vehBlipColor["r"][color], vehBlipColor["g"][color], vehBlipColor["b"][color]) end
  2082.                 end
  2083.             end
  2084.         end
  2085.            
  2086.         addx = 630
  2087.         addy = -385
  2088.         addx = addx/1920*sx
  2089.         addy = addy/1920*sx
  2090.         width, height = 145/1.5, 35/1.5
  2091.         width, height = width/1920*sx, height/1920*sx
  2092.         button["browser:car_button1"] = guiCreateButton(x+addx, y-addy, width, height, "Abschliessen", false)
  2093.         guiSetFont(button["browser:car_button1"], "default-bold-small")
  2094.         guiSetAlpha(button["browser:car_button1"], 0)
  2095.         addEventHandler("onClientGUIClick", button["browser:car_button1"], function()
  2096.             local id = tonumber(guiGridListGetItemText(button["browser:car_grid"], guiGridListGetSelectedItem(button["browser:car_grid"]), 1))
  2097.             if not(id) then
  2098.                 outputChatBox("Du musst ein Fahrzeug aus der Liste auswaehlen!", 255, 0, 0)
  2099.             return end
  2100.             triggerServerEvent("doLAHandyCarAction", gMe, id, "lock")
  2101.         end, false)
  2102.        
  2103.         addx = 630
  2104.         addy = -430
  2105.         addx = addx/1920*sx
  2106.         addy = addy/1920*sx
  2107.         width, height = 145/1.5, 35/1.5
  2108.         width, height = width/1920*sx, height/1920*sx
  2109.         button["browser:car_button2"] = guiCreateButton(x+addx, y-addy, width, height, "Orten", false)
  2110.         guiSetFont(button["browser:car_button2"], "default-bold-small")
  2111.         guiSetAlpha(button["browser:car_button2"], 0)
  2112.        
  2113.         addEventHandler("onClientGUIClick", button["browser:car_button2"], function()
  2114.             local id = tonumber(guiGridListGetItemText(button["browser:car_grid"], guiGridListGetSelectedItem(button["browser:car_grid"]), 1))
  2115.             if not(id) then
  2116.                 outputChatBox("Du musst ein Fahrzeug aus der Liste auswaehlen!", 255, 0, 0)
  2117.             return end
  2118.             triggerServerEvent("doLAHandyCarAction", gMe, id, "orten")
  2119.         end, false)
  2120.        
  2121.         addx = 825
  2122.         addy = -430
  2123.         addx = addx/1920*sx
  2124.         addy = addy/1920*sx
  2125.         width, height = 145/1.5, 35/1.5
  2126.         width, height = width/1920*sx, height/1920*sx
  2127.         button["browser:car_button3"] = guiCreateButton(x+addx, y-addy, width, height, "Respawnen", false)
  2128.         guiSetFont(button["browser:car_button3"], "default-bold-small")
  2129.         guiSetAlpha(button["browser:car_button3"], 0)
  2130.        
  2131.         addEventHandler("onClientGUIClick", button["browser:car_button3"], function()
  2132.             local id = tonumber(guiGridListGetItemText(button["browser:car_grid"], guiGridListGetSelectedItem(button["browser:car_grid"]), 1))
  2133.             if not(id) then
  2134.                 outputChatBox("Du musst ein Fahrzeug aus der Liste auswaehlen!", 255, 0, 0)
  2135.             return end
  2136.             triggerServerEvent("doLAHandyCarAction", gMe, id, "towveh")
  2137.         end, false)
  2138.        
  2139.         addx = 825
  2140.         addy = -385
  2141.         addx = addx/1920*sx
  2142.         addy = addy/1920*sx
  2143.         width, height = 145/1.5, 35/1.5
  2144.         width, height = width/1920*sx, height/1920*sx
  2145.         button["browser:car_button4"] = guiCreateButton(x+addx, y-addy, width, height, "Verkaufen", false)
  2146.         guiSetFont(button["browser:car_button4"], "default-bold-small")
  2147.         guiSetAlpha(button["browser:car_button4"], 0)
  2148.  
  2149.        
  2150.         addx = 730
  2151.         addy = -350
  2152.         addx = addx/1920*sx
  2153.         addy = addy/1920*sx
  2154.         width, height = 145/1.5, 35/1.5
  2155.         width, height = width/1920*sx, height/1920*sx
  2156.         button["browser:car_checkbox1"] = guiCreateCheckBox(x+addx, y-addy, width, height, "Bestaetigung", false, false)
  2157.         guiSetFont(button["browser:car_checkbox1"], "default-bold-small")
  2158.        
  2159.        
  2160.            
  2161.         addEventHandler("onClientGUIClick", button["browser:car_button4"], function()
  2162.             local id = tonumber(guiGridListGetItemText(button["browser:car_grid"], guiGridListGetSelectedItem(button["browser:car_grid"]), 1))
  2163.             if not(id) then
  2164.                 outputChatBox("Du musst ein Fahrzeug aus der Liste auswaehlen!", 255, 0, 0)
  2165.             return end
  2166.             if(guiCheckBoxGetSelected(button["browser:car_checkbox1"]) == true) then
  2167.                 triggerServerEvent("doLAHandyCarAction", gMe, id, "sellcar")
  2168.             else
  2169.                 outputChatBox("Du musst dies Bestaetigen!", 255, 0, 0)
  2170.             end
  2171.         end, false)
  2172.        
  2173.     elseif(name == "bank") then
  2174.         addx = 725
  2175.         addy = -225
  2176.         addx = addx/1920*sx
  2177.         addy = addy/1920*sx
  2178.         width, height = 120/1.5, 100/1.5
  2179.         width, height = width/1920*sx, height/1920*sx
  2180.         button["browser:bank_account_label"] = guiCreateLabel(x+addx, y-addy, width, height, "Dein Geld:\n"..bankgeld.."$", false)
  2181.         guiLabelSetColor(button["browser:bank_account_label"], 0, 255, 0)
  2182.         guiSetFont(button["browser:bank_account_label"], "default-bold-small")
  2183.        
  2184.         addx = 660
  2185.         addy = -280
  2186.         addx = addx/1920*sx
  2187.         addy = addy/1920*sx
  2188.         width, height = 120/1.5, 100/1.5
  2189.         width, height = width/1920*sx, height/1920*sx
  2190.         button["browser:bank_account_label_value"] = guiCreateLabel(x+addx, y-addy, width, height, "Menge:", false)
  2191.         guiSetFont(button["browser:bank_account_label_value"], "default-bold-small")
  2192.        
  2193.         addx = 700
  2194.         addy = -275
  2195.         addx = addx/1920*sx
  2196.         addy = addy/1920*sx
  2197.         width, height = 215/1.5, 47/1.5
  2198.         width, height = width/1920*sx, height/1920*sx
  2199.         button["browser:bank_account_edit_value"] = guiCreateEdit(x+addx, y-addy, width, height, "", false)
  2200.         guiSetFont(button["browser:bank_account_edit_value"], "default-bold-small")
  2201.         -- To --
  2202.         addx = 660
  2203.         addy = -325
  2204.         addx = addx/1920*sx
  2205.         addy = addy/1920*sx
  2206.         width, height = 120/1.5, 100/1.5
  2207.         width, height = width/1920*sx, height/1920*sx
  2208.         button["browser:bank_account_label_to"] = guiCreateLabel(x+addx, y-addy, width, height, "Zu:", false)
  2209.         guiSetFont(button["browser:bank_account_label_to"], "default-bold-small")
  2210.        
  2211.         addx = 700
  2212.         addy = -320
  2213.         addx = addx/1920*sx
  2214.         addy = addy/1920*sx
  2215.         width, height = 215/1.5, 47/1.5
  2216.         width, height = width/1920*sx, height/1920*sx
  2217.         button["browser:bank_account_edit_to"] = guiCreateEdit(x+addx, y-addy, width, height, "", false)
  2218.         guiSetFont(button["browser:bank_account_edit_to"], "default-bold-small")
  2219.        
  2220.         addx = 675
  2221.         addy = -360
  2222.         addx = addx/1920*sx
  2223.         addy = addy/1920*sx
  2224.         width, height = 285/1.5, 47/1.5
  2225.         width, height = width/1920*sx, height/1920*sx
  2226.         button["browser:bank_account_button"] = guiCreateButton(x+addx, y-addy, width, height, "Senden", false)
  2227.         guiSetFont(button["browser:bank_account_button"], "default-bold-small")
  2228.        
  2229.         addEventHandler("onClientGUIClick", button["browser:bank_account_button"], function()
  2230.             local to = guiGetText(button["browser:bank_account_edit_to"])
  2231.             local value = tonumber(guiGetText(button["browser:bank_account_edit_value"]))
  2232.             if not(value) or (value < 1) or (value > 500000) then outputChatBox("Ungueltige Menge !", 255, 0, 0) return end
  2233.             value = math.floor(value)
  2234.             if not(getPlayerFromName(to)) then outputChatBox("Spieler ist nicht online!", 255, 0, 0) return end
  2235.             triggerServerEvent("onMTOnlineTransfer", gMe, to, value)
  2236.         end, false)
  2237.        
  2238.         addx = 675
  2239.         addy = -400
  2240.         addx = addx/1920*sx
  2241.         addy = addy/1920*sx
  2242.         width, height = 285/1.5, 47/1.5
  2243.         width, height = width/1920*sx, height/1920*sx
  2244.         button["browser:bank_account_button_liefern"] = guiCreateButton(x+addx, y-addy, width, height, "Geld per Luftpost liefern", false)
  2245.         guiSetFont(button["browser:bank_account_button_liefern"], "default-bold-small")
  2246.        
  2247.         addEventHandler("onClientGUIClick", button["browser:bank_account_button_liefern"], function()
  2248.             local value = tonumber(guiGetText(button["browser:bank_account_edit_value"]))
  2249.             if not(value) or (value < 1) or (value > 500000) then outputChatBox("Ungueltige Menge!", 255, 0, 0) return end
  2250.             value = math.floor(value)
  2251.             triggerServerEvent("onMTGeldLieferung", gMe, value)
  2252.         end, false)
  2253.     elseif(name == "newsmain") then
  2254.         local add = 0
  2255.         local newsid = 0
  2256.         local newsidn = {}
  2257.         local newsurl = {}
  2258.         local function addNews(text, url)
  2259.             addx = 620
  2260.             addy = -100-add
  2261.             addx = addx/1920*sx
  2262.             addy = addy/1920*sx
  2263.             width, height = #text*10/1.5, 60/1.5
  2264.             width, height = width/1920*sx, height/1920*sx
  2265.             button["browser:news_"..newsid] = guiCreateLabel(x+addx, y-addy, width, height, text.."\n________________________________________", false)
  2266.             guiSetFont(button["browser:news_"..newsid], "default-bold-small")
  2267.             guiLabelSetColor(button["browser:news_"..newsid], 0, 0, 255)
  2268.            
  2269.             newsidn[button["browser:news_"..newsid]] = newsid
  2270.             newsurl[button["browser:news_"..newsid]] = url
  2271.            
  2272.             addEventHandler("onClientMouseEnter", button["browser:news_"..newsid], function()
  2273.                 guiLabelSetColor(button["browser:news_"..newsidn[source]], 100, 100, 255)
  2274.             end)
  2275.             addEventHandler("onClientMouseLeave", button["browser:news_"..newsid], function()
  2276.                 guiLabelSetColor(button["browser:news_"..newsidn[source]], 0, 0, 255)
  2277.             end)
  2278.            
  2279.             addEventHandler("onClientGUIClick", button["browser:news_"..newsid], function()
  2280.                 local url = "www.news.com/"..newsurl[source]
  2281.                 if(tonumber(empfang) > 1) then
  2282.                    
  2283.                 else
  2284.                     url = "10060"
  2285.                 end
  2286.                 local curl = c_url
  2287.                 hide_browsersite(page_images[curl])
  2288.                 local image = page_images[url]
  2289.                 show_browsersite(image)
  2290.                 c_url = url
  2291.             end)
  2292.            
  2293.            
  2294.         end
  2295.         for i = 1, #news, 1 do
  2296.             local zeile = news[i]
  2297.             local uhrzeit = gettok(zeile, 1, "|")
  2298.             local titel = gettok(zeile, 2, "|")
  2299.             titel = uhrzeit.."|"..titel
  2300.             local url = gettok(zeile, 3, "|")
  2301.             addNews(titel, url)
  2302.             newsid = newsid+1
  2303.             add = add+40
  2304.         end
  2305.     elseif(name == "ammunation") then
  2306.  
  2307.         -- HANDGUNS --
  2308.         local this
  2309.         local add = 20
  2310.         local temp_name = "9mm"
  2311.        
  2312.         -- LABEL OBEN --
  2313.        
  2314.         addx = 640
  2315.         addy = -70
  2316.         addx = addx/1920*sx
  2317.         addy = addy/1920*sx
  2318.         width, height = 156/1.5, 32/1.5
  2319.         width, height = width/1920*sx, height/1920*sx
  2320.         button["browser:ammu_label_info1"] = guiCreateLabel(x+addx, y-addy, width, height, "Name",false)
  2321.         this = button["browser:ammu_label_info1"]
  2322.         guiSetFont(this, "default-bold-small")
  2323.         ammu_element[this] = this
  2324.        
  2325.         guiLabelSetColor(this, 0, 255, 0)
  2326.        
  2327.         addx = 630
  2328.         addy = -72
  2329.         addx = addx/1920*sx
  2330.         addy = addy/1920*sx
  2331.         width, height = 400/1.5, 69/1.5
  2332.         width, height = width/1920*sx, height/1920*sx
  2333.         button["browser:ammu_label_info2"] = guiCreateLabel(x+addx, y-addy, width, height, "___________________________________________________________________",false)
  2334.         this = button["browser:ammu_label_info2"]
  2335.         guiSetFont(this, "default-bold-small")
  2336.         ammu_element[this] = this
  2337.        
  2338.         addx = 825
  2339.         addy = -70
  2340.         addx = addx/1920*sx
  2341.         addy = addy/1920*sx
  2342.         width, height = 156/1.5, 32/1.5
  2343.         width, height = width/1920*sx, height/1920*sx
  2344.         button["browser:ammu_label_info3"] = guiCreateLabel(x+addx, y-addy, width, height, "Munition",false)
  2345.         this = button["browser:ammu_label_info3"]
  2346.         guiSetFont(this, "default-bold-small")
  2347.         ammu_element[this] = this
  2348.        
  2349.         guiLabelSetColor(this, 0, 255, 0)
  2350.        
  2351.        
  2352.         local temp_name = "9mm"
  2353.        
  2354.         addx = 630
  2355.         addy = -55-add-17.25
  2356.         addx = addx/1920*sx
  2357.         addy = addy/1920*sx
  2358.         width, height = 275/1.5, 34.5/1.5
  2359.         width, height = width/1920*sx, height/1920*sx
  2360.         button["browser:ammu_checkbox_"..temp_name] = guiCreateCheckBox(x+addx, y-addy, width, height, "9mm ($"..ammu_select[temp_name]["gunprice"].."/$"..ammu_select[temp_name]["ammoprice"]..")", false, false)
  2361.         this = button["browser:ammu_checkbox_"..temp_name]
  2362.         guiSetFont(this, "default-bold-small")
  2363.         ammu_element[this] = this
  2364.        
  2365.         addx = 825
  2366.         addy = -67-add
  2367.         addx = addx/1920*sx
  2368.         addy = addy/1920*sx
  2369.         width, height = 100/1.5, 32/1.5
  2370.         width, height = width/1920*sx, height/1920*sx
  2371.         button["browser:ammu_edit_"..temp_name] = guiCreateEdit(x+addx, y-addy, width, height, "0", false)
  2372.         this = button["browser:ammu_edit_"..temp_name]
  2373.         guiSetFont(this, "default-bold-small")
  2374.         ammu_element[this] = this
  2375.         add = add+25
  2376.        
  2377.         local temp_name = "deagle"
  2378.        
  2379.         addx = 630
  2380.         addy = -55-add-17.25
  2381.         addx = addx/1920*sx
  2382.         addy = addy/1920*sx
  2383.         width, height = 275/1.5, 34.5/1.5
  2384.         width, height = width/1920*sx, height/1920*sx
  2385.         button["browser:ammu_checkbox_"..temp_name] = guiCreateCheckBox(x+addx, y-addy, width, height, "Deagle ($"..ammu_select[temp_name]["gunprice"].."/$"..ammu_select[temp_name]["ammoprice"]..")", false, false)
  2386.         this = button["browser:ammu_checkbox_"..temp_name]
  2387.         guiSetFont(this, "default-bold-small")
  2388.         ammu_element[this] = this
  2389.        
  2390.         addx = 825
  2391.         addy = -67-add
  2392.         addx = addx/1920*sx
  2393.         addy = addy/1920*sx
  2394.         width, height = 100/1.5, 32/1.5
  2395.         width, height = width/1920*sx, height/1920*sx
  2396.         button["browser:ammu_edit_"..temp_name] = guiCreateEdit(x+addx, y-addy, width, height, "0", false)
  2397.         this = button["browser:ammu_edit_"..temp_name]
  2398.         guiSetFont(this, "default-bold-small")
  2399.         ammu_element[this] = this
  2400.         add = add+25
  2401.        
  2402.         local temp_name = "shotgun"
  2403.        
  2404.         addx = 630
  2405.         addy = -55-add-17.25
  2406.         addx = addx/1920*sx
  2407.         addy = addy/1920*sx
  2408.         width, height = 275/1.5, 34.5/1.5
  2409.         width, height = width/1920*sx, height/1920*sx
  2410.         button["browser:ammu_checkbox_"..temp_name] = guiCreateCheckBox(x+addx, y-addy, width, height, "Shotgun ($"..ammu_select[temp_name]["gunprice"].."/$"..ammu_select[temp_name]["ammoprice"]..")", false, false)
  2411.         this = button["browser:ammu_checkbox_"..temp_name]
  2412.         guiSetFont(this, "default-bold-small")
  2413.         ammu_element[this] = this
  2414.        
  2415.         addx = 825
  2416.         addy = -67-add
  2417.         addx = addx/1920*sx
  2418.         addy = addy/1920*sx
  2419.         width, height = 100/1.5, 32/1.5
  2420.         width, height = width/1920*sx, height/1920*sx
  2421.         button["browser:ammu_edit_"..temp_name] = guiCreateEdit(x+addx, y-addy, width, height, "0", false)
  2422.         this = button["browser:ammu_edit_"..temp_name]
  2423.         guiSetFont(this, "default-bold-small")
  2424.         ammu_element[this] = this
  2425.         add = add+25
  2426.        
  2427.         local temp_name = "mp5"
  2428.        
  2429.         addx = 630
  2430.         addy = -55-add-17.25
  2431.         addx = addx/1920*sx
  2432.         addy = addy/1920*sx
  2433.         width, height = 275/1.5, 34.5/1.5
  2434.         width, height = width/1920*sx, height/1920*sx
  2435.         button["browser:ammu_checkbox_"..temp_name] = guiCreateCheckBox(x+addx, y-addy, width, height, "MP5 ($"..ammu_select[temp_name]["gunprice"].."/$"..ammu_select[temp_name]["ammoprice"]..")", false, false)
  2436.         this = button["browser:ammu_checkbox_"..temp_name]
  2437.         guiSetFont(this, "default-bold-small")
  2438.         ammu_element[this] = this
  2439.        
  2440.         addx = 825
  2441.         addy = -67-add
  2442.         addx = addx/1920*sx
  2443.         addy = addy/1920*sx
  2444.         width, height = 100/1.5, 32/1.5
  2445.         width, height = width/1920*sx, height/1920*sx
  2446.         button["browser:ammu_edit_"..temp_name] = guiCreateEdit(x+addx, y-addy, width, height, "0", false)
  2447.         this = button["browser:ammu_edit_"..temp_name]
  2448.         guiSetFont(this, "default-bold-small")
  2449.         ammu_element[this] = this
  2450.         add = add+25
  2451.        
  2452.         local temp_name = "ak-47"
  2453.        
  2454.         addx = 630
  2455.         addy = -55-add-17.25
  2456.         addx = addx/1920*sx
  2457.         addy = addy/1920*sx
  2458.         width, height = 285/1.5, 34.5/1.5
  2459.         width, height = width/1920*sx, height/1920*sx
  2460.         button["browser:ammu_checkbox_"..temp_name] = guiCreateCheckBox(x+addx, y-addy, width, height, "AK-47 ($"..ammu_select[temp_name]["gunprice"].."/$"..ammu_select[temp_name]["ammoprice"]..")", false, false)
  2461.         this = button["browser:ammu_checkbox_"..temp_name]
  2462.         guiSetFont(this, "default-bold-small")
  2463.         ammu_element[this] = this
  2464.        
  2465.         addx = 825
  2466.         addy = -67-add
  2467.         addx = addx/1920*sx
  2468.         addy = addy/1920*sx
  2469.         width, height = 100/1.5, 32/1.5
  2470.         width, height = width/1920*sx, height/1920*sx
  2471.         button["browser:ammu_edit_"..temp_name] = guiCreateEdit(x+addx, y-addy, width, height, "0", false)
  2472.         this = button["browser:ammu_edit_"..temp_name]
  2473.         guiSetFont(this, "default-bold-small")
  2474.         ammu_element[this] = this
  2475.         add = add+25
  2476.        
  2477.         local temp_name = "m4"
  2478.        
  2479.         addx = 630
  2480.         addy = -55-add-17.25
  2481.         addx = addx/1920*sx
  2482.         addy = addy/1920*sx
  2483.         width, height = 275/1.5, 34.5/1.5
  2484.         width, height = width/1920*sx, height/1920*sx
  2485.         button["browser:ammu_checkbox_"..temp_name] = guiCreateCheckBox(x+addx, y-addy, width, height, "M4 ($"..ammu_select[temp_name]["gunprice"].."/$"..ammu_select[temp_name]["ammoprice"]..")", false, false)
  2486.         this = button["browser:ammu_checkbox_"..temp_name]
  2487.         guiSetFont(this, "default-bold-small")
  2488.         ammu_element[this] = this
  2489.        
  2490.         addx = 825
  2491.         addy = -67-add
  2492.         addx = addx/1920*sx
  2493.         addy = addy/1920*sx
  2494.         width, height = 100/1.5, 32/1.5
  2495.         width, height = width/1920*sx, height/1920*sx
  2496.         button["browser:ammu_edit_"..temp_name] = guiCreateEdit(x+addx, y-addy, width, height, "0", false)
  2497.         this = button["browser:ammu_edit_"..temp_name]
  2498.         guiSetFont(this, "default-bold-small")
  2499.         ammu_element[this] = this
  2500.         add = add+25
  2501.        
  2502.         local temp_name = "rifle"
  2503.        
  2504.         addx = 630
  2505.         addy = -55-add-17.25
  2506.         addx = addx/1920*sx
  2507.         addy = addy/1920*sx
  2508.         width, height = 275/1.5, 34.5/1.5
  2509.         width, height = width/1920*sx, height/1920*sx
  2510.         button["browser:ammu_checkbox_"..temp_name] = guiCreateCheckBox(x+addx, y-addy, width, height, "Gewehr ($"..ammu_select[temp_name]["gunprice"].."/$"..ammu_select[temp_name]["ammoprice"]..")", false, false)
  2511.         this = button["browser:ammu_checkbox_"..temp_name]
  2512.         guiSetFont(this, "default-bold-small")
  2513.         ammu_element[this] = this
  2514.        
  2515.         addx = 825
  2516.         addy = -67-add
  2517.         addx = addx/1920*sx
  2518.         addy = addy/1920*sx
  2519.         width, height = 100/1.5, 32/1.5
  2520.         width, height = width/1920*sx, height/1920*sx
  2521.         button["browser:ammu_edit_"..temp_name] = guiCreateEdit(x+addx, y-addy, width, height, "0", false)
  2522.         this = button["browser:ammu_edit_"..temp_name]
  2523.         guiSetFont(this, "default-bold-small")
  2524.         ammu_element[this] = this
  2525.         add = add+25
  2526.        
  2527.         local temp_name = "nachtsicht"
  2528.        
  2529.         addx = 630
  2530.         addy = -55-add-17.25
  2531.         addx = addx/1920*sx
  2532.         addy = addy/1920*sx
  2533.         width, height = 275/1.5, 34.5/1.5
  2534.         width, height = width/1920*sx, height/1920*sx
  2535.         button["browser:ammu_checkbox_"..temp_name] = guiCreateCheckBox(x+addx, y-addy, width, height, "Nachts. ($"..ammu_select[temp_name]["gunprice"].."/$"..ammu_select[temp_name]["ammoprice"]..")", false, false)
  2536.         this = button["browser:ammu_checkbox_"..temp_name]
  2537.         guiSetFont(this, "default-bold-small")
  2538.         ammu_element[this] = this
  2539.        
  2540.         addx = 825
  2541.         addy = -67-add
  2542.         addx = addx/1920*sx
  2543.         addy = addy/1920*sx
  2544.         width, height = 100/1.5, 32/1.5
  2545.         width, height = width/1920*sx, height/1920*sx
  2546.         button["browser:ammu_edit_"..temp_name] = guiCreateEdit(x+addx, y-addy, width, height, "0", false)
  2547.         this = button["browser:ammu_edit_"..temp_name]
  2548.         guiSetFont(this, "default-bold-small")
  2549.         guiSetEnabled(this, false)
  2550.         ammu_element[this] = this
  2551.         add = add+25
  2552.        
  2553.         local temp_name = "waerme"
  2554.        
  2555.         addx = 630
  2556.         addy = -55-add-17.25
  2557.         addx = addx/1920*sx
  2558.         addy = addy/1920*sx
  2559.         width, height = 275/1.5, 34.5/1.5
  2560.         width, height = width/1920*sx, height/1920*sx
  2561.         button["browser:ammu_checkbox_"..temp_name] = guiCreateCheckBox(x+addx, y-addy, width, height, "Waermes. ($"..ammu_select[temp_name]["gunprice"].."/$"..ammu_select[temp_name]["ammoprice"]..")", false, false)
  2562.         this = button["browser:ammu_checkbox_"..temp_name]
  2563.         guiSetFont(this, "default-bold-small")
  2564.         ammu_element[this] = this
  2565.        
  2566.         addx = 825
  2567.         addy = -67-add
  2568.         addx = addx/1920*sx
  2569.         addy = addy/1920*sx
  2570.         width, height = 100/1.5, 32/1.5
  2571.         width, height = width/1920*sx, height/1920*sx
  2572.         button["browser:ammu_edit_"..temp_name] = guiCreateEdit(x+addx, y-addy, width, height, "0", false)
  2573.         this = button["browser:ammu_edit_"..temp_name]
  2574.         guiSetFont(this, "default-bold-small")
  2575.         guiSetEnabled(this, false)
  2576.         ammu_element[this] = this
  2577.         add = add+25
  2578.        
  2579.         local temp_name = "armour"
  2580.        
  2581.         addx = 630
  2582.         addy = -55-add-17.25
  2583.         addx = addx/1920*sx
  2584.         addy = addy/1920*sx
  2585.         width, height = 275/1.5, 34.5/1.5
  2586.         width, height = width/1920*sx, height/1920*sx
  2587.         button["browser:ammu_checkbox_"..temp_name] = guiCreateCheckBox(x+addx, y-addy, width, height, "Weste ($"..ammu_select[temp_name]["gunprice"].."/$"..ammu_select[temp_name]["ammoprice"]..")", false, false)
  2588.         this = button["browser:ammu_checkbox_"..temp_name]
  2589.         guiSetFont(this, "default-bold-small")
  2590.         ammu_element[this] = this
  2591.        
  2592.         addx = 825
  2593.         addy = -67-add
  2594.         addx = addx/1920*sx
  2595.         addy = addy/1920*sx
  2596.         width, height = 100/1.5, 32/1.5
  2597.         width, height = width/1920*sx, height/1920*sx
  2598.         button["browser:ammu_edit_"..temp_name] = guiCreateEdit(x+addx, y-addy, width, height, "0", false)
  2599.         this = button["browser:ammu_edit_"..temp_name]
  2600.         guiSetFont(this, "default-bold-small")
  2601.         guiSetEnabled(this, false)
  2602.         ammu_element[this] = this
  2603.         add = add+25
  2604.        
  2605.         local temp_name = "knife"
  2606.        
  2607.         addx = 630
  2608.         addy = -55-add-17.25
  2609.         addx = addx/1920*sx
  2610.         addy = addy/1920*sx
  2611.         width, height = 275/1.5, 34.5/1.5
  2612.         width, height = width/1920*sx, height/1920*sx
  2613.         button["browser:ammu_checkbox_"..temp_name] = guiCreateCheckBox(x+addx, y-addy, width, height, "Messer ($"..ammu_select[temp_name]["gunprice"].."/$"..ammu_select[temp_name]["ammoprice"]..")", false, false)
  2614.         this = button["browser:ammu_checkbox_"..temp_name]
  2615.         guiSetFont(this, "default-bold-small")
  2616.         ammu_element[this] = this
  2617.        
  2618.         addx = 825
  2619.         addy = -67-add
  2620.         addx = addx/1920*sx
  2621.         addy = addy/1920*sx
  2622.         width, height = 100/1.5, 32/1.5
  2623.         width, height = width/1920*sx, height/1920*sx
  2624.         button["browser:ammu_edit_"..temp_name] = guiCreateEdit(x+addx, y-addy, width, height, "0", false)
  2625.         this = button["browser:ammu_edit_"..temp_name]
  2626.         guiSetFont(this, "default-bold-small")
  2627.         guiSetEnabled(this, false)
  2628.         ammu_element[this] = this
  2629.         add = add+25
  2630.        
  2631.         local temp_name = "bat"
  2632.        
  2633.         addx = 630
  2634.         addy = -55-add-17.25
  2635.         addx = addx/1920*sx
  2636.         addy = addy/1920*sx
  2637.         width, height = 275/1.5, 34.5/1.5
  2638.         width, height = width/1920*sx, height/1920*sx
  2639.         button["browser:ammu_checkbox_"..temp_name] = guiCreateCheckBox(x+addx, y-addy, width, height, "Baseball ($"..ammu_select[temp_name]["gunprice"].."/$"..ammu_select[temp_name]["ammoprice"]..")", false, false)
  2640.         this = button["browser:ammu_checkbox_"..temp_name]
  2641.         guiSetFont(this, "default-bold-small")
  2642.         ammu_element[this] = this
  2643.        
  2644.         addx = 825
  2645.         addy = -67-add
  2646.         addx = addx/1920*sx
  2647.         addy = addy/1920*sx
  2648.         width, height = 100/1.5, 32/1.5
  2649.         width, height = width/1920*sx, height/1920*sx
  2650.         button["browser:ammu_edit_"..temp_name] = guiCreateEdit(x+addx, y-addy, width, height, "0", false)
  2651.         this = button["browser:ammu_edit_"..temp_name]
  2652.         guiSetFont(this, "default-bold-small")
  2653.         guiSetEnabled(this, false)
  2654.         ammu_element[this] = this
  2655.         add = add+25
  2656.        
  2657.         addx = 710
  2658.         addy = -430
  2659.         addx = addx/1920*sx
  2660.         addy = addy/1920*sx
  2661.         width, height = 300/1.5, 30/1.5
  2662.         width, height = width/1920*sx, height/1920*sx
  2663.         button["browser:ammu_label_info3"] = guiCreateLabel(x+addx, y-addy, width, height, "Waffen liefern (0$)",false)
  2664.         this = button["browser:ammu_label_info3"]
  2665.         guiSetFont(this, "default-bold-small")
  2666.         ammu_element[this] = this
  2667.        
  2668.         guiLabelSetColor(this, 255, 255, 255)
  2669.        
  2670.         addEventHandler("onClientMouseEnter", this, function()
  2671.             guiLabelSetColor(source, 255, 0, 0)
  2672.         end)
  2673.        
  2674.         addEventHandler("onClientMouseLeave", this, function()
  2675.             guiLabelSetColor(source, 255, 255, 255)
  2676.         end)
  2677.        
  2678.         local function updateWeaponPrice()
  2679.             local accept = {}
  2680.             local accept2 = {}
  2681.             local price = 0
  2682.             accept["9mm"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_9mm"])
  2683.             accept["deagle"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_deagle"])
  2684.             accept["shotgun"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_shotgun"])
  2685.             accept["mp5"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_mp5"])
  2686.             accept["ak-47"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_ak-47"])
  2687.             accept["m4"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_m4"])
  2688.             accept["rifle"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_rifle"])
  2689.             accept["nachtsicht"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_nachtsicht"])
  2690.             accept["waerme"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_waerme"])
  2691.             accept["armour"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_armour"])
  2692.             accept["knife"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_knife"])
  2693.             accept["bat"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_bat"])
  2694.             local weap = "9mm"
  2695.             if(accept[weap]) then price = price+ammu_select[weap]["gunprice"] end
  2696.             weap = "deagle"
  2697.             if(accept[weap]) then price = price+ammu_select[weap]["gunprice"] end
  2698.             weap = "shotgun"
  2699.             if(accept[weap]) then price = price+ammu_select[weap]["gunprice"] end
  2700.             weap = "mp5"
  2701.             if(accept[weap]) then price = price+ammu_select[weap]["gunprice"] end
  2702.             weap = "ak-47"
  2703.             if(accept[weap]) then price = price+ammu_select[weap]["gunprice"] end
  2704.             weap = "m4"
  2705.             if(accept[weap]) then price = price+ammu_select[weap]["gunprice"] end
  2706.             weap = "rifle"
  2707.             if(accept[weap]) then price = price+ammu_select[weap]["gunprice"] end
  2708.             weap = "nachtsicht"
  2709.             if(accept[weap]) then price = price+ammu_select[weap]["gunprice"] end
  2710.             weap = "waerme"
  2711.             if(accept[weap]) then price = price+ammu_select[weap]["gunprice"] end
  2712.             weap = "armour"
  2713.             if(accept[weap]) then price = price+ammu_select[weap]["gunprice"] end
  2714.             weap = "knife"
  2715.             if(accept[weap]) then price = price+ammu_select[weap]["gunprice"] end
  2716.             weap = "bat"
  2717.             if(accept[weap]) then price = price+ammu_select[weap]["gunprice"] end
  2718.            
  2719.             accept2["9mm"] = tonumber(guiGetText(button["browser:ammu_edit_9mm"]))
  2720.             accept2["deagle"] = tonumber(guiGetText(button["browser:ammu_edit_deagle"]))
  2721.             accept2["shotgun"] = tonumber(guiGetText(button["browser:ammu_edit_shotgun"]))
  2722.             accept2["mp5"] = tonumber(guiGetText(button["browser:ammu_edit_mp5"]))
  2723.             accept2["ak-47"] = tonumber(guiGetText(button["browser:ammu_edit_ak-47"]))
  2724.             accept2["m4"] = tonumber(guiGetText(button["browser:ammu_edit_m4"]))
  2725.             accept2["rifle"] = tonumber(guiGetText(button["browser:ammu_edit_rifle"]))
  2726.             accept2["nachtsicht"] = tonumber(guiGetText(button["browser:ammu_edit_nachtsicht"]))
  2727.             accept2["waerme"] = tonumber(guiGetText(button["browser:ammu_edit_waerme"]))
  2728.             accept2["armour"] = tonumber(guiGetText(button["browser:ammu_edit_armour"]))
  2729.             accept2["knife"] = tonumber(guiGetText(button["browser:ammu_edit_knife"]))
  2730.             accept2["bat"] = tonumber(guiGetText(button["browser:ammu_edit_bat"]))
  2731.             for index, var in pairs(accept2) do
  2732.                 if(var < 0) then var = 0 end
  2733.             end
  2734.             local weap = "9mm"
  2735.             if(accept2[weap]) and (accept[weap]) then price = price+ammu_select[weap]["ammoprice"]*accept2[weap] end
  2736.             weap = "deagle"
  2737.             if(accept2[weap]) and (accept[weap]) then price = price+ammu_select[weap]["ammoprice"]*accept2[weap] end
  2738.             weap = "shotgun"
  2739.             if(accept2[weap]) and (accept[weap]) then price = price+ammu_select[weap]["ammoprice"]*accept2[weap] end
  2740.             weap = "mp5"
  2741.             if(accept2[weap]) and (accept[weap]) then price = price+ammu_select[weap]["ammoprice"]*accept2[weap] end
  2742.             weap = "ak-47"
  2743.             if(accept2[weap]) and (accept[weap]) then price = price+ammu_select[weap]["ammoprice"]*accept2[weap] end
  2744.             weap = "m4"
  2745.             if(accept2[weap]) and (accept[weap]) then price = price+ammu_select[weap]["ammoprice"]*accept2[weap] end
  2746.             weap = "rifle"
  2747.             if(accept2[weap]) and (accept[weap]) then price = price+ammu_select[weap]["ammoprice"]*accept2[weap] end
  2748.             weap = "nachtsicht"
  2749.             if(accept2[weap]) and (accept[weap]) then price = price+ammu_select[weap]["ammoprice"]*accept2[weap] end
  2750.             weap = "waerme"
  2751.             if(accept2[weap]) and (accept[weap]) then price = price+ammu_select[weap]["ammoprice"]*accept2[weap] end
  2752.             weap = "armour"
  2753.             if(accept2[weap]) and (accept[weap]) then price = price+ammu_select[weap]["ammoprice"]*accept2[weap] end
  2754.             weap = "knife"
  2755.             if(accept2[weap]) and (accept[weap]) then price = price+ammu_select[weap]["ammoprice"]*accept2[weap] end
  2756.             weap = "bat"
  2757.             if(accept2[weap]) and (accept[weap]) then price = price+ammu_select[weap]["ammoprice"]*accept2[weap] end
  2758.             -- Ammu --
  2759.             weapon_price = price
  2760.             guiSetText(button["browser:ammu_label_info3"], "Waffen liefern ("..price.."$)")
  2761.         end
  2762.         for index, ele in pairs(ammu_element) do
  2763.             addEventHandler("onClientGUIChanged", ele, updateWeaponPrice)
  2764.             addEventHandler("onClientGUIClick", ele, updateWeaponPrice)
  2765.         end
  2766.         addEventHandler("onClientGUIClick", this, function()
  2767.             local accept = {}
  2768.             local accept2 = {}
  2769.             accept["9mm"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_9mm"])
  2770.             accept["deagle"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_deagle"])
  2771.             accept["shotgun"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_shotgun"])
  2772.             accept["mp5"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_mp5"])
  2773.             accept["ak-47"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_ak-47"])
  2774.             accept["m4"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_m4"])
  2775.             accept["rifle"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_rifle"])
  2776.             accept["nachtsicht"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_nachtsicht"])
  2777.             accept["waerme"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_waerme"])
  2778.             accept["armour"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_armour"])
  2779.             accept["knife"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_knife"])
  2780.             accept["bat"] = guiCheckBoxGetSelected(button["browser:ammu_checkbox_bat"])
  2781.             accept2["9mm"] = tonumber(guiGetText(button["browser:ammu_edit_9mm"]))
  2782.             accept2["deagle"] = tonumber(guiGetText(button["browser:ammu_edit_deagle"]))
  2783.             accept2["shotgun"] = tonumber(guiGetText(button["browser:ammu_edit_shotgun"]))
  2784.             accept2["mp5"] = tonumber(guiGetText(button["browser:ammu_edit_mp5"]))
  2785.             accept2["ak-47"] = tonumber(guiGetText(button["browser:ammu_edit_ak-47"]))
  2786.             accept2["m4"] = tonumber(guiGetText(button["browser:ammu_edit_m4"]))
  2787.             accept2["rifle"] = tonumber(guiGetText(button["browser:ammu_edit_rifle"]))
  2788.            
  2789.             if(accept["9mm"]) and (accept2["9mm"] < 1) or (accept["deagle"]) and (accept2["deagle"] < 1) or (accept["shotgun"]) and (accept2["shotgun"] < 1) or (accept["mp5"]) and (accept2["mp5"] < 1) or (accept["ak-47"]) and (accept2["ak-47"] < 1) or (accept["m4"]) and (accept2["m4"] < 1) or (accept["rifle"]) and (accept2["rifle"] < 0) then outputChatBox("Bad ammo input!", 255, 0, 0) return end
  2790.             triggerServerEvent("onMTAmmunationBuy", gMe, weapon_price, accept, accept2)
  2791.             --[[
  2792.             triggerServerEvent("onMTAmmunationBuy", gMe, weapon_price, accept["9mm"], accept2["9mm"], accept["deagle"], accept2["deagle"], accept["shotgun"], accept2["shotgun"], accept["mp5"], accept2["mp5"], accept["ak-47"], accept2["ak-47"],accept["m4"], accept2["m4"], accept["rifle"], accept2["rifle"], accept["nachtsicht"], accept["waerme"], accept["armour"], accept["knife"], accept["bat"])]]
  2793.         end)
  2794.     elseif(name == "iqc") then
  2795.         iqc_text = ""
  2796.         triggerServerEvent("onMTHandyIQCJoin", gMe)
  2797.         addx = 725
  2798.         addy = -100
  2799.         addx = addx/1920*sx
  2800.         addy = addy/1920*sx
  2801.         width, height = 220/1.5, 100/1.5
  2802.         width, height = width/1920*sx, height/1920*sx
  2803.         button["browser:iqc_online"] = guiCreateLabel(x+addx, y-addy, width, height, "Leute im Chat: 0", false)
  2804.         this = button["browser:iqc_online"]
  2805.         guiLabelSetColor(this, 0, 255, 0)
  2806.         guiSetFont(this, "default-bold-small")
  2807.        
  2808.         addx = 620
  2809.         addy = -120
  2810.         addx = addx/1920*sx
  2811.         addy = addy/1920*sx
  2812.         width, height = 472/1.5, 430/1.5
  2813.         width, height = width/1920*sx, height/1920*sx
  2814.         button["browser:iqc_memo"] = guiCreateMemo(x+addx, y-addy, width, height, iqc_text, false)
  2815.         this = button["browser:iqc_memo"]
  2816.         guiSetFont(this, "default-bold-small")
  2817.         guiMemoSetReadOnly(this, true)
  2818.        
  2819.         addx = 620
  2820.         addy = -421
  2821.         addx = addx/1920*sx
  2822.         addy = addy/1920*sx
  2823.         width, height = 325/1.5, 49/1.5
  2824.         width, height = width/1920*sx, height/1920*sx
  2825.         button["browser:iqc_edit"] = guiCreateEdit(x+addx, y-addy, width, height, "", false)
  2826.         this = button["browser:iqc_edit"]
  2827.         guiSetFont(this, "default-bold-small")
  2828.         guiEditSetMaxLength(this, 128)
  2829.        
  2830.         addx = 860
  2831.         addy = -430
  2832.         addx = addx/1920*sx
  2833.         addy = addy/1920*sx
  2834.         width, height = 100/1.5, 30/1.5
  2835.         width, height = width/1920*sx, height/1920*sx
  2836.         button["browser:iqc_senden"] = guiCreateLabel(x+addx, y-addy, width, height, "Absenden", false)
  2837.         this = button["browser:iqc_senden"]
  2838.         guiSetFont(this, "default-bold-small")
  2839.         guiLabelSetColor(this, 0, 255, 0)
  2840.         addEventHandler("onClientGUIClick", this, function()
  2841.             local text = guiGetText(button["browser:iqc_edit"])
  2842.             triggerServerEvent("onMTHandyIQCSend", gMe, text)
  2843.             guiSetText(button["browser:iqc_edit"], "")
  2844.         end)
  2845.         addEventHandler("onClientMouseEnter", this, function()
  2846.             guiLabelSetColor(source, 100, 255, 100)
  2847.         end)
  2848.         addEventHandler("onClientMouseLeave", this, function()
  2849.             guiLabelSetColor(source, 0, 255, 0)
  2850.         end)
  2851.     elseif(name == "vehinfo") then
  2852.    
  2853.         addx = 615
  2854.         addy = 1
  2855.         addx = addx/1920*sx
  2856.         addy = addy/1920*sx
  2857.         width, height = 488/1.5, 650/1.5
  2858.         width, height = width/1920*sx, height/1920*sx
  2859.         button["browser:vehinfos_memo"] = guiCreateMemo(x+addx, y-addy, width, height, "ID oder Name eines Fahrzeuges unten eintippen.", false)
  2860.         guiMemoSetReadOnly(button["browser:vehinfos_memo"], true)
  2861.  
  2862.         local function refrehVehInfoMemo(id)
  2863.             local mstring = "Fahrzeugdaten fuer Fahrzeug "..getVehicleNameFromModel(id)..":"
  2864.             local handling = getOriginalHandling(id)
  2865.             if(handling) then
  2866.                 mstring = mstring.."\nAllgemeine Daten:"
  2867.                 mstring = mstring.."\nMasse: "..handling["mass"].." kg"
  2868.                 mstring = mstring.."\nAnzahl der Gaenge: "..handling["numberOfGears"]
  2869.                 mstring = mstring.."\nHoechstgeschwindigkeit: "..handling["maxVelocity"].." km/h"
  2870.                 mstring = mstring.."\nBeschleunigung: "..math.floor((handling["engineAcceleration"])).." m/s"
  2871.                 mstring = mstring.."\nAntrieb: "..handling["driveType"]
  2872.                 mstring = mstring.."\nMotortype: "..handling["engineType"]
  2873.                 mstring = mstring.."\nBremskraft: "..handling["brakeDeceleration"].." m/s"
  2874.                 local anzahl = 0
  2875.                 for i, k in pairs(getElementsByType("vehicle")) do if(getElementModel(k) == id) then anzahl = anzahl+1 end end
  2876.                 mstring = mstring.."\nZurzeit gespawnte Modelle auf dem Server: "..anzahl
  2877.                 mstring = mstring.."\n\nTechnische Daten:"
  2878.                 mstring = mstring.."\nABS: "..tostring(handling["ABS"])
  2879.                 mstring = mstring.."\nLenkkraft: "..handling["steeringLock"]
  2880.                 mstring = mstring.."\nUebersetzungsmultiplizierer: "..handling["tractionMultiplier"]
  2881.                 mstring = mstring.."\nUebersetzungsverlust: "..handling["tractionLoss"]
  2882.                 mstring = mstring.."\nUebersetzungsBias: "..handling["tractionBias"]
  2883.                 mstring = mstring.."\nKoordinaten der Masse:\nX: "..handling["centerOfMass"][1]..", Y: "..handling["centerOfMass"][2]..", Z: "..handling["centerOfMass"][3]
  2884.                 mstring = mstring.."\nDrehmasse: "..handling["turnMass"]
  2885.                 mstring = mstring.."\n\nDiese Daten entsprechen der Wirklichkeit.\nAlle Angaben der Einheit ohne Gewaehr!"
  2886.                 guiSetText(button["browser:vehinfos_memo"], mstring)
  2887.             end
  2888.         end    
  2889.         if(isPedInVehicle(gMe) == true) and (getPedOccupiedVehicle(gMe)) then
  2890.             local veh = getElementModel(getPedOccupiedVehicle(gMe))
  2891.             refrehVehInfoMemo(veh)
  2892.         end
  2893.         addx = 615
  2894.         addy = -435
  2895.         addx = addx/1920*sx
  2896.         addy = addy/1920*sx
  2897.         width, height = 488/1.5, 40/1.5
  2898.         width, height = width/1920*sx, height/1920*sx
  2899.         local id = "Suche..."
  2900.         if(isPedInVehicle(gMe) == true) and (getPedOccupiedVehicle(gMe)) then
  2901.             id = getElementModel(getPedOccupiedVehicle(gMe))
  2902.         end
  2903.         button["browser:vehinfos_edit"] = guiCreateEdit(x+addx, y-addy, width, height, id, false)
  2904.         addEventHandler("onClientGUIChanged", button["browser:vehinfos_edit"], function()
  2905.             local text = guiGetText(source)
  2906.             if(tonumber(text) == nil) then
  2907.                 if(getVehicleModelFromName(text)) then
  2908.                     refrehVehInfoMemo(getVehicleModelFromName(text))
  2909.                 else
  2910.                     guiSetText(button["browser:vehinfos_memo"], "Fahrzeug konnte nicht gefunden werden.")
  2911.                 end
  2912.             else
  2913.                 text = tonumber(text)
  2914.                 if(text > 410) and (text < 611) then
  2915.                     refrehVehInfoMemo(text)
  2916.                 else
  2917.                     guiSetText(button["browser:vehinfos_memo"], "ID des Fahrzeuges ist nicht richtig. Richtige ID's sind von 411 bis 611.")
  2918.                 end
  2919.             end
  2920.         end)
  2921.     elseif(name == "updates") then
  2922.         triggerServerEvent("onMTHandyUpdatesNeed", gMe)
  2923.         addx = 623
  2924.         addy = -80
  2925.         addx = addx/1920*sx
  2926.         addy = addy/1920*sx
  2927.         width, height = 461/1.5, 492/1.5
  2928.         width, height = width/1920*sx, height/1920*sx
  2929.         button["browser:updates_memo"] = guiCreateMemo(x+addx, y-addy, width, height, update_text, false)
  2930.         this = button["browser:updates_memo"]
  2931.         guiSetFont(this, "default-bold-small")
  2932.         guiMemoSetReadOnly(this, true)
  2933.        
  2934.         addx = 623
  2935.         addy = -420
  2936.         addx = addx/1920*sx
  2937.         addy = addy/1920*sx
  2938.         width, height = 231/1.5, 50/1.5
  2939.         width, height = width/1920*sx, height/1920*sx
  2940.         button["browser:updates_button1"] = guiCreateButton(x+addx, y-addy, width, height, "Bearbeiten", false)
  2941.         this = button["browser:updates_button1"]
  2942.         guiSetFont(this, "default-bold-small")
  2943.         local name = getPlayerName(gMe)
  2944.         if not(allowedPersons[name]) then
  2945.             guiSetVisible(this, false)
  2946.         end
  2947.         addEventHandler("onClientGUIClick", this, function()
  2948.             if(guiGetText(source) == "Bearbeiten") then
  2949.                 guiSetText(source, "Fertig!")
  2950.                 guiMemoSetReadOnly(button["browser:updates_memo"], false)
  2951.             else
  2952.                 guiSetText(source, "Bearbeiten")
  2953.                 guiMemoSetReadOnly(button["browser:updates_memo"], true)
  2954.                 local text = guiGetText(button["browser:updates_memo"])
  2955.                 triggerServerEvent("onMTHandyUpdatesEdit", gMe, text)
  2956.             end
  2957.         end, false)
  2958.     elseif(name == "nutten") then
  2959.         addx = 650
  2960.         addy = -90
  2961.         addx = addx/1920*sx
  2962.         addy = addy/1920*sx
  2963.         width, height = 410/1.5, 400/1.5
  2964.         width, height = width/1920*sx, height/1920*sx
  2965.         button["browser:nutten_label"] = guiCreateLabel(x+addx, y-addy, width, height, "Willkommen Suesser! Du hast Lust\nauf was anderes oder bist alleine?\nKein Problem, wir liefern dir eine\nperfekte Nutte per Luftpost zu\ndeiner Position! Der Partyknaller\nfuer Events schlechthin. Wir haben\nfuer jeden das Richtige! Mit einem\nKlick auf 'Bestellen' geht die Party ab!\n\nFuer einmalige 200$ bieten wir dir\nalles, was dein Herz begehrt.\nSolltest du mit uns nicht zufrieden\nsein, kannst du uns jederzeit\numbringen.", false)
  2966.         this = button["browser:nutten_label"]
  2967.         guiLabelSetColor(this, 255, 255, 255)
  2968.         guiSetFont(this, "default-bold-small")
  2969.        
  2970.         addx = 650
  2971.         addy = -360
  2972.         addx = addx/1920*sx
  2973.         addy = addy/1920*sx
  2974.         width, height = 406/1.5, 121/1.5
  2975.         width, height = width/1920*sx, height/1920*sx
  2976.         button["browser:nutten_button"] = guiCreateButton(x+addx, y-addy, width, height, "Nutte bestellen:\n$200", false)
  2977.         this = button["browser:nutten_button"]
  2978.        
  2979.         addEventHandler("onClientGUIClick", this, function()
  2980.             triggerServerEvent("onMTHandyAction", gMe, "nuttebestellung")
  2981.         end, false)
  2982.     elseif(name == "casino") then
  2983.         guiSetInputMode("no_binds_when_editing")
  2984.         addx = 650
  2985.         addy = -90
  2986.         addx = addx/1920*sx
  2987.         addy = addy/1920*sx
  2988.         width, height = 400/1.5, 100/1.5
  2989.         width, height = width/1920*sx, height/1920*sx
  2990.         button["browser:casino_label1"] = guiCreateLabel(x+addx, y-addy, width, height, "Willkommen auf www.casino.com!\nHier sind dem Glueck\nkeine Grenzen gesetzt!", false)
  2991.         this = button["browser:casino_label1"]
  2992.         guiLabelSetColor(this, 0, 0, 0)
  2993.         guiSetFont(this, "default-bold-small")
  2994.        
  2995.         addx = 650
  2996.         addy = -150
  2997.         addx = addx/1920*sx
  2998.         addy = addy/1920*sx
  2999.         width, height = 100/1.5, 50/1.5
  3000.         width, height = width/1920*sx, height/1920*sx
  3001.         button["browser:casino_label2"] = guiCreateLabel(x+addx, y-addy, width, height, "1 aus 10:", false)
  3002.         this = button["browser:casino_label2"]
  3003.         guiLabelSetColor(this, 255, 255, 255)
  3004.         guiSetFont(this, "default-bold-small")
  3005.        
  3006.         addx = 620
  3007.         addy = -190
  3008.         addx = addx/1920*sx
  3009.         addy = addy/1920*sx
  3010.         width, height = 50/1.5, 50/1.5
  3011.         width, height = width/1920*sx, height/1920*sx
  3012.         button["browser:casino_label3"] = guiCreateLabel(x+addx, y-addy, width, height, "Zahl:", false)
  3013.         this = button["browser:casino_label3"]
  3014.         guiLabelSetColor(this, 255, 255, 255)
  3015.         guiSetFont(this, "default-bold-small")
  3016.        
  3017.         addx = 655
  3018.         addy = -185
  3019.         addx = addx/1920*sx
  3020.         addy = addy/1920*sx
  3021.         width, height = 58/1.5, 36/1.5
  3022.         width, height = width/1920*sx, height/1920*sx
  3023.         button["browser:casino_edit1"] = guiCreateEdit(x+addx, y-addy, width, height, "", false)
  3024.         this = button["browser:casino_edit1"]
  3025.         guiEditSetMaxLength(this, 2)
  3026.         guiSetFont(this, "default-bold-small")
  3027.        
  3028.         addx = 700
  3029.         addy = -190
  3030.         addx = addx/1920*sx
  3031.         addy = addy/1920*sx
  3032.         width, height = 95/1.5, 50/1.5
  3033.         width, height = width/1920*sx, height/1920*sx
  3034.         button["browser:casino_label4"] = guiCreateLabel(x+addx, y-addy, width, height, ", Einsatz: $", false)
  3035.         this = button["browser:casino_label4"]
  3036.         guiLabelSetColor(this, 255, 255, 255)
  3037.         guiSetFont(this, "default-bold-small")
  3038.        
  3039.         addx = 775
  3040.         addy = -185
  3041.         addx = addx/1920*sx
  3042.         addy = addy/1920*sx
  3043.         width, height = 80/1.5, 36/1.5
  3044.         width, height = width/1920*sx, height/1920*sx
  3045.         button["browser:casino_edit2"] = guiCreateEdit(x+addx, y-addy, width, height, "", false)
  3046.         this = button["browser:casino_edit2"]
  3047.         guiEditSetMaxLength(this, 4)
  3048.         guiSetFont(this, "default-bold-small")
  3049.        
  3050.         addx = 835
  3051.         addy = -185
  3052.         addx = addx/1920*sx
  3053.         addy = addy/1920*sx
  3054.         width, height = 150/1.5, 50/1.5
  3055.         width, height = width/1920*sx, height/1920*sx
  3056.         button["browser:casino_button1"] = guiCreateButton(x+addx, y-addy, width, height, "Auf gut Glueck!", false)
  3057.         this = button["browser:casino_button1"]
  3058.         guiSetFont(this, "default-bold-smal3")
  3059.        
  3060.         addEventHandler("onClientGUIClick", this, function()
  3061.             local nummer = tonumber(guiGetText(button["browser:casino_edit1"]))
  3062.             if not(nummer) or (nummer < 1) or (nummer > 10) then outputChatBox("Ungueltige Nummer!", 255, 0, 0) return end
  3063.             local einsatz = tonumber(guiGetText(button["browser:casino_edit2"]))
  3064.             if not(einsatz) or (einsatz < 0) then outputChatBox("Ungueltiger Einsatz!", 255, 0, 0) return end
  3065.             triggerServerEvent("onMTHandyCasinoAction", gMe, nummer, einsatz, 1)
  3066.         end, false)
  3067.        
  3068.         addx = 630
  3069.         addy = -220
  3070.         addx = addx/1920*sx
  3071.         addy = addy/1920*sx
  3072.         width, height = 450/1.5, 100/1.5
  3073.         width, height = width/1920*sx, height/1920*sx
  3074.         button["browser:casino_label5"] = guiCreateLabel(x+addx, y-addy, width, height, "Waehle eine Zahl von 1-10 aus.\nWird deine Zahl gezogen, erhaeltst du\ndas Doppelte deines Einsatzes.", false)
  3075.         this = button["browser:casino_label5"]
  3076.         guiLabelSetColor(this, 255, 255, 255)
  3077.         guiSetFont(this, "default-bold-small")
  3078.        
  3079.         -- 1 aus 50 --
  3080.        
  3081.         addx = 650
  3082.         addy = -350+50
  3083.         addx = addx/1920*sx
  3084.         addy = addy/1920*sx
  3085.         width, height = 100/1.5, 50/1.5
  3086.         width, height = width/1920*sx, height/1920*sx
  3087.         button["browser:casino_label6"] = guiCreateLabel(x+addx, y-addy, width, height, "1 aus 50:", false)
  3088.         this = button["browser:casino_label6"]
  3089.         guiLabelSetColor(this, 255, 255, 255)
  3090.         guiSetFont(this, "default-bold-small")
  3091.        
  3092.         addx = 620
  3093.         addy = -390+50
  3094.         addx = addx/1920*sx
  3095.         addy = addy/1920*sx
  3096.         width, height = 50/1.5, 50/1.5
  3097.         width, height = width/1920*sx, height/1920*sx
  3098.         button["browser:casino_label7"] = guiCreateLabel(x+addx, y-addy, width, height, "Zahl:", false)
  3099.         this = button["browser:casino_label7"]
  3100.         guiLabelSetColor(this, 255, 255, 255)
  3101.         guiSetFont(this, "default-bold-small")
  3102.        
  3103.         addx = 655
  3104.         addy = -385+50
  3105.         addx = addx/1920*sx
  3106.         addy = addy/1920*sx
  3107.         width, height = 58/1.5, 38/1.5
  3108.         width, height = width/1920*sx, height/1920*sx
  3109.         button["browser:casino_edit3"] = guiCreateEdit(x+addx, y-addy, width, height, "", false)
  3110.         this = button["browser:casino_edit3"]
  3111.         guiEditSetMaxLength(this, 2)
  3112.         guiSetFont(this, "default-bold-small")
  3113.        
  3114.         addx = 700
  3115.         addy = -390+50
  3116.         addx = addx/1920*sx
  3117.         addy = addy/1920*sx
  3118.         width, height = 95/1.5, 50/1.5
  3119.         width, height = width/1920*sx, height/1920*sx
  3120.         button["browser:casino_label8"] = guiCreateLabel(x+addx, y-addy, width, height, ", Einsatz: $", false)
  3121.         this = button["browser:casino_label8"]
  3122.         guiLabelSetColor(this, 255, 255, 255)
  3123.         guiSetFont(this, "default-bold-small")
  3124.        
  3125.         addx = 775
  3126.         addy = -385+50
  3127.         addx = addx/1920*sx
  3128.         addy = addy/1920*sx
  3129.         width, height = 80/1.5, 38/1.5
  3130.         width, height = width/1920*sx, height/1920*sx
  3131.         button["browser:casino_edit4"] = guiCreateEdit(x+addx, y-addy, width, height, "", false)
  3132.         this = button["browser:casino_edit4"]
  3133.         guiEditSetMaxLength(this, 5)
  3134.         guiSetFont(this, "default-bold-small")
  3135.        
  3136.         addx = 835
  3137.         addy = -385+50
  3138.         addx = addx/1920*sx
  3139.         addy = addy/1920*sx
  3140.         width, height = 150/1.5, 50/1.5
  3141.         width, height = width/1920*sx, height/1920*sx
  3142.         button["browser:casino_button2"] = guiCreateButton(x+addx, y-addy, width, height, "Auf gut Glueck!", false)
  3143.         this = button["browser:casino_button2"]
  3144.         guiSetFont(this, "default-bold-smal3")
  3145.        
  3146.         addEventHandler("onClientGUIClick", this, function()
  3147.             local nummer = tonumber(guiGetText(button["browser:casino_edit3"]))
  3148.             if not(nummer) or (nummer < 1) or (nummer > 50) then outputChatBox("Ungueltige Nummer!", 255, 0, 0) return end
  3149.             local einsatz = tonumber(guiGetText(button["browser:casino_edit4"]))
  3150.             if not(einsatz) or (einsatz < 0) then outputChatBox("Ungueltiger Einsatz!", 255, 0, 0) return end
  3151.             triggerServerEvent("onMTHandyCasinoAction", gMe, nummer, einsatz, 2)
  3152.         end, false)
  3153.        
  3154.         addx = 630
  3155.         addy = -420+50
  3156.         addx = addx/1920*sx
  3157.         addy = addy/1920*sx
  3158.         width, height = 450/1.5, 100/1.5
  3159.         width, height = width/1920*sx, height/1920*sx
  3160.         button["browser:casino_label9"] = guiCreateLabel(x+addx, y-addy, width, height, "Waehle eine Zahl von 1-50 aus.\nWird deine Zahl gezogen, erhaeltst du\ndas Dreifache deines Einsatzes.", false)
  3161.         this = button["browser:casino_label9"]
  3162.         guiLabelSetColor(this, 255, 255, 255)
  3163.         guiSetFont(this, "default-bold-small")
  3164.     end
  3165. end
  3166.  
  3167. addEventHandler("onClientMTHandyIQCMessageSend", getLocalPlayer(), function(message, value)
  3168.     iqc_text = iqc_text.."\n"..message
  3169.     if(isElement(button["browser:iqc_memo"])) then
  3170.         guiSetText(button["browser:iqc_memo"], iqc_text)
  3171.         guiMemoSetCaratIndex(button["browser:iqc_memo"], #iqc_text)
  3172.         if(value) then
  3173.             guiSetText(button["browser:iqc_online"], "Leute im Chat: "..value)
  3174.         end
  3175.     end
  3176. end)
  3177.  
  3178. function hide_browsersite(name)
  3179.     if not(page_images[c_url]) then name = "404" end
  3180.     if(site[name] ~= name) then return end
  3181.     site[name] = false
  3182.     if(name == "startpage") then
  3183.         destroyElement(button["browser:startpage_edit"])
  3184.         destroyElement(button["browser:startpage_button"])
  3185.         destroyElement(button["browser:startpage_btn_auswahl"])
  3186.         destroyElement(button["browser:startpage_btn_auswahl2"])
  3187.     elseif(name == "vehinfo") then
  3188.         destroyElement(button["browser:vehinfos_memo"])
  3189.         destroyElement(button["browser:vehinfos_edit"])
  3190.     elseif(name == "backgrounds") then
  3191.         destroyElement(button["browser:backgrounds_grid"])
  3192.         destroyElement(button["browser:backgrounds_button"])
  3193.     elseif(name == "fahrzeuge") then
  3194.         destroyElement(button["browser:car_grid"])
  3195.         destroyElement(button["browser:car_button1"])
  3196.         destroyElement(button["browser:car_button2"])
  3197.         destroyElement(button["browser:car_button3"])
  3198.         destroyElement(button["browser:car_button4"])
  3199.         destroyElement(button["browser:car_checkbox1"])
  3200.     elseif(name == "updates") then
  3201.         destroyElement(button["browser:updates_memo"])
  3202.         destroyElement(button["browser:updates_button1"])
  3203.     elseif(name == "nutten") then
  3204.         destroyElement(button["browser:nutten_label"])
  3205.         destroyElement(button["browser:nutten_button"])
  3206.     elseif(name == "casino") then
  3207.         destroyElement(button["browser:casino_label1"])
  3208.         destroyElement(button["browser:casino_label2"])
  3209.         destroyElement(button["browser:casino_label3"])
  3210.         destroyElement(button["browser:casino_label4"])
  3211.         destroyElement(button["browser:casino_label5"])
  3212.         destroyElement(button["browser:casino_label6"])
  3213.         destroyElement(button["browser:casino_label7"])
  3214.         destroyElement(button["browser:casino_label8"])
  3215.         destroyElement(button["browser:casino_label9"])
  3216.        
  3217.         destroyElement(button["browser:casino_edit1"])
  3218.         destroyElement(button["browser:casino_edit2"])
  3219.         destroyElement(button["browser:casino_edit3"])
  3220.         destroyElement(button["browser:casino_edit4"])
  3221.        
  3222.         destroyElement(button["browser:casino_button1"])
  3223.         destroyElement(button["browser:casino_button2"])
  3224.     elseif(name == "iqc") then
  3225.         destroyElement(button["browser:iqc_online"])
  3226.         destroyElement(button["browser:iqc_memo"])
  3227.         destroyElement(button["browser:iqc_edit"])
  3228.         destroyElement(button["browser:iqc_senden"])
  3229.         triggerServerEvent("onMTHandyIQCQuit", gMe)
  3230.        
  3231.     elseif(name == "hospital") then
  3232.         destroyElement(button["browser:hospital_buy"])
  3233.     elseif(name == "pizza") then
  3234.         destroyElement(button["browser:pizza_buy"])
  3235.     elseif(name == "house") then
  3236.         destroyElement(button["browser:house_grid"])
  3237.         destroyElement(button["browser:house_mark"])
  3238.     elseif(name == "auswahlpage") then
  3239.         destroyElement(button["browser:auswahl_clucking"])
  3240.         destroyElement(button["browser:auswahl_google"])
  3241.         destroyElement(button["browser:auswahl_pns"])
  3242.         destroyElement(button["browser:auswahl_bank"])
  3243.         destroyElement(button["browser:auswahl_hospital"])
  3244.     elseif(name == "auswahlpage2") then
  3245.         destroyElement(button["browser:auswahl_ammu"])
  3246.         destroyElement(button["browser:auswahl_casino"])
  3247.         destroyElement(button["browser:auswahl_google"])
  3248.         destroyElement(button["browser:auswahl_background"])
  3249.         destroyElement(button["browser:auswahl_pizza"])
  3250.     elseif(name == "newsmain") then
  3251.         for i = 0, 20, 1 do
  3252.             if(isElement(button["browser:news_"..i])) then
  3253.                 destroyElement(button["browser:news_"..i])
  3254.             end
  3255.         end
  3256.     elseif(name == "bank") then
  3257.         destroyElement(button["browser:bank_account_button"])
  3258.         destroyElement(button["browser:bank_account_button_liefern"])
  3259.         destroyElement(button["browser:bank_account_label_to"])
  3260.         destroyElement(button["browser:bank_account_edit_to"])
  3261.         destroyElement(button["browser:bank_account_edit_value"])
  3262.         destroyElement(button["browser:bank_account_label_value"])
  3263.         destroyElement(button["browser:bank_account_label"])
  3264.     elseif(name == "404") then
  3265.         destroyElement(button["browser:404_infolabel"])
  3266.     elseif(name == "ammunation") then
  3267.         for index, ele in pairs(ammu_element) do
  3268.             destroyElement(ele)
  3269.         end
  3270.         ammu_element = nil
  3271.         ammu_element = {}
  3272.     end
  3273. end
  3274.  
  3275. --[[
  3276. addCommandHandler("outofthandy", function()
  3277.     for index, but in pairs(button) do
  3278.         destroyElement(but)
  3279.     end
  3280.     for index, ele in pairs(ammu_element) do
  3281.         destroyElement(ele)
  3282.     end
  3283.     outputChatBox("Handy Items wurden geelernt. Falls ein Fehler auftrat, bitte Reconnecten", 0, 255, 0)
  3284. end)
  3285. -]]
  3286. function show_browser()
  3287.     if(browser == true) then return end
  3288.     browser = true
  3289.     -- browser buttons --
  3290.     local sx, sy = guiGetScreenSize()
  3291.     local x, y = sx/2, sy/2
  3292.     addx = 891
  3293.     addy = 50
  3294.     addx = addx/1920*sx
  3295.     addy = addy/1920*sx
  3296.     width, height = 62/1.5, 62/1.5
  3297.     width, height = width/1920*sx, height/1920*sx
  3298.     button["browser:button_ioogle"] = guiCreateButton(x+addx, y-addy, width, height, "ioogle", false)
  3299.     guiSetAlpha(button["browser:button_ioogle"], 0)
  3300.    
  3301.     addEventHandler("onClientGUIClick", button["browser:button_ioogle"], function()
  3302.             local url = "www.loogle.com"
  3303.             local curl = c_url
  3304.             last_url = c_url
  3305.             hide_browsersite(page_images[curl])
  3306.             local image = page_images[url]
  3307.             if not(image) then image = "404" end
  3308.             show_browsersite(image)
  3309.             c_url = url
  3310.         end, false)
  3311.    
  3312.     addx = 625
  3313.     addy = 50
  3314.     addx = addx/1920*sx
  3315.     addy = addy/1920*sx
  3316.     width, height = 62/1.5, 62/1.5
  3317.     width, height = width/1920*sx, height/1920*sx
  3318.     button["browser:button_refresh"] = guiCreateButton(x+addx, y-addy, width, height, "refresh", false)
  3319.     guiSetAlpha(button["browser:button_refresh"], 0)
  3320.    
  3321.     addEventHandler("onClientGUIClick", button["browser:button_refresh"], function()
  3322.             local url = c_url
  3323.             hide_browsersite(page_images[url])
  3324.             local image = page_images[url]
  3325.             if not(image) then image = "404" end
  3326.             show_browsersite(image)
  3327.             c_url = url
  3328.         end, false)
  3329. end
  3330.  
  3331. function hide_browser()
  3332.     if(browser == false) then return end
  3333.     browser = false
  3334.     for index, page in pairs(site) do
  3335.         hide_browsersite(page)
  3336.     end
  3337.     destroyElement(button["browser:button_ioogle"])
  3338.     destroyElement(button["browser:button_refresh"])
  3339. end
  3340.  
  3341. function show_dialer()
  3342.     if(dialer == true) then return end
  3343.     dialer = true
  3344.     hide_browser()
  3345.     hide_browsersite("hospital")
  3346.     local sx, sy = guiGetScreenSize()
  3347.     local x, y = sx/2, sy/2
  3348.    
  3349.     local addx, addy, width, height, scale
  3350.    
  3351.    
  3352.     -- Special numbers --
  3353.    
  3354.     addx = 640
  3355.     addy = -410
  3356.     addx = addx/1920*sx
  3357.     addy = addy/1920*sx
  3358.     width, height = 100/1.5, 62/1.5
  3359.     width, height = width/1920*sx, height/1920*sx
  3360.     button["CALL"] = guiCreateButton(x+addx, y-addy, width, height, "ANRUFEN", false)
  3361.    
  3362.     addx = 840
  3363.     addy = -410
  3364.     addx = addx/1920*sx
  3365.     addy = addy/1920*sx
  3366.     width, height = 100/1.5, 62/1.5
  3367.     width, height = width/1920*sx, height/1920*sx
  3368.     button["DELETE"] = guiCreateButton(x+addx, y-addy, width, height, "LדCHEN", false)
  3369.    
  3370.     -- Define the numbers --
  3371.     addx = 740
  3372.     addy = -350
  3373.     addx = addx/1920*sx
  3374.     addy = addy/1920*sx
  3375.     width, height = 100/1.5, 62/1.5
  3376.     width, height = width/1920*sx, height/1920*sx
  3377.     button["NUM0"] = guiCreateButton(x+addx, y-addy, width, height, "NUM0", false)
  3378.  
  3379.     addx = 740
  3380.     addy = -290
  3381.     addx = addx/1920*sx
  3382.     addy = addy/1920*sx
  3383.     width, height = 100/1.5, 62/1.5
  3384.     width, height = width/1920*sx, height/1920*sx
  3385.     button["NUM8"] = guiCreateButton(x+addx, y-addy, width, height, "NUM8", false)
  3386.    
  3387.     addx = 840
  3388.     addy = -290
  3389.     addx = addx/1920*sx
  3390.     addy = addy/1920*sx
  3391.     width, height = 100/1.5, 62/1.5
  3392.     width, height = width/1920*sx, height/1920*sx
  3393.     button["NUM9"] = guiCreateButton(x+addx, y-addy, width, height, "NUM9", false)
  3394.    
  3395.     addx = 640
  3396.     addy = -290
  3397.     addx = addx/1920*sx
  3398.     addy = addy/1920*sx
  3399.     width, height = 100/1.5, 62/1.5
  3400.     width, height = width/1920*sx, height/1920*sx
  3401.     button["NUM7"] = guiCreateButton(x+addx, y-addy, width, height, "NUM7", false)
  3402.    
  3403.     addx = 740
  3404.     addy = -230
  3405.     addx = addx/1920*sx
  3406.     addy = addy/1920*sx
  3407.     width, height = 100/1.5, 62/1.5
  3408.     width, height = width/1920*sx, height/1920*sx
  3409.     button["NUM5"] = guiCreateButton(x+addx, y-addy, width, height, "NUM5", false)
  3410.    
  3411.     addx = 840
  3412.     addy = -230
  3413.     addx = addx/1920*sx
  3414.     addy = addy/1920*sx
  3415.     width, height = 100/1.5, 62/1.5
  3416.     width, height = width/1920*sx, height/1920*sx
  3417.     button["NUM6"] = guiCreateButton(x+addx, y-addy, width, height, "NUM6", false)
  3418.    
  3419.     addx = 640
  3420.     addy = -230
  3421.     addx = addx/1920*sx
  3422.     addy = addy/1920*sx
  3423.     width, height = 100/1.5, 62/1.5
  3424.     width, height = width/1920*sx, height/1920*sx
  3425.     button["NUM4"] = guiCreateButton(x+addx, y-addy, width, height, "NUM4", false)
  3426.    
  3427.     addx = 740
  3428.     addy = -170
  3429.     addx = addx/1920*sx
  3430.     addy = addy/1920*sx
  3431.     width, height = 100/1.5, 62/1.5
  3432.     width, height = width/1920*sx, height/1920*sx
  3433.     button["NUM2"] = guiCreateButton(x+addx, y-addy, width, height, "NUM2", false)
  3434.    
  3435.     addx = 640
  3436.     addy = -170
  3437.     addx = addx/1920*sx
  3438.     addy = addy/1920*sx
  3439.     width, height = 100/1.5, 62/1.5
  3440.     width, height = width/1920*sx, height/1920*sx
  3441.     button["NUM1"] = guiCreateButton(x+addx, y-addy, width, height, "NUM1", false)
  3442.    
  3443.     addx = 840
  3444.     addy = -170
  3445.     addx = addx/1920*sx
  3446.     addy = addy/1920*sx
  3447.     width, height = 100/1.5, 62/1.5
  3448.     width, height = width/1920*sx, height/1920*sx
  3449.     button["NUM3"] = guiCreateButton(x+addx, y-addy, width, height, "NUM3", false)
  3450.    
  3451.     guiSetAlpha(button["NUM0"], 0)
  3452.     guiSetAlpha(button["NUM1"], 0)
  3453.     guiSetAlpha(button["NUM2"], 0)
  3454.     guiSetAlpha(button["NUM3"], 0)
  3455.     guiSetAlpha(button["NUM4"], 0)
  3456.     guiSetAlpha(button["NUM5"], 0)
  3457.     guiSetAlpha(button["NUM6"], 0)
  3458.     guiSetAlpha(button["NUM7"], 0)
  3459.     guiSetAlpha(button["NUM8"], 0)
  3460.     guiSetAlpha(button["NUM9"], 0)
  3461.     guiSetAlpha(button["DELETE"], 0)
  3462.     guiSetAlpha(button["CALL"], 0)
  3463.    
  3464.     addEventHandler("onClientGUIClick", button["NUM0"], function()
  3465.         local l = #auswahl
  3466.         if(l > 38) then return end
  3467.         auswahl = auswahl.."0"
  3468.     end, false)
  3469.    
  3470.     addEventHandler("onClientGUIClick", button["NUM1"], function()
  3471.         local l = #auswahl
  3472.         if(l > 38) then return end
  3473.         auswahl = auswahl.."1"
  3474.     end, false)
  3475.    
  3476.     addEventHandler("onClientGUIClick", button["NUM2"], function()
  3477.         local l = #auswahl
  3478.         if(l > 38) then return end
  3479.         auswahl = auswahl.."2"
  3480.     end, false)
  3481.    
  3482.     addEventHandler("onClientGUIClick", button["NUM3"], function()
  3483.         local l = #auswahl
  3484.         if(l > 38) then return end
  3485.         auswahl = auswahl.."3"
  3486.     end, false)
  3487.    
  3488.     addEventHandler("onClientGUIClick", button["NUM4"], function()
  3489.         local l = #auswahl
  3490.         if(l > 38) then return end
  3491.         auswahl = auswahl.."4"
  3492.     end, false)
  3493.    
  3494.     addEventHandler("onClientGUIClick", button["NUM5"], function()
  3495.         local l = #auswahl
  3496.         if(l > 38) then return end
  3497.         auswahl = auswahl.."5"
  3498.     end, false)
  3499.    
  3500.     addEventHandler("onClientGUIClick", button["NUM6"], function()
  3501.         local l = #auswahl
  3502.         if(l > 38) then return end
  3503.         auswahl = auswahl.."6"
  3504.     end, false)
  3505.    
  3506.     addEventHandler("onClientGUIClick", button["NUM7"], function()
  3507.         local l = #auswahl
  3508.         if(l > 38) then return end
  3509.         auswahl = auswahl.."7"
  3510.     end, false)
  3511.    
  3512.     addEventHandler("onClientGUIClick", button["NUM8"], function()
  3513.         local l = #auswahl
  3514.         if(l > 38) then return end
  3515.         auswahl = auswahl.."8"
  3516.     end, false)
  3517.    
  3518.     addEventHandler("onClientGUIClick", button["NUM9"], function()
  3519.         local l = #auswahl
  3520.         if(l > 38) then return end
  3521.         auswahl = auswahl.."9"
  3522.     end, false)
  3523.    
  3524.     addEventHandler("onClientGUIClick", button["DELETE"], function()
  3525.         local length = #auswahl
  3526.         auswahl = string.sub(auswahl, 1, length-1)
  3527.     end, false)
  3528. end
  3529.  
  3530. function hide_dialer()
  3531.     if(dialer == false) then return end
  3532.     dialer = false
  3533.     destroyElement(button["NUM0"])
  3534.     destroyElement(button["NUM9"])
  3535.     destroyElement(button["NUM8"])
  3536.     destroyElement(button["NUM7"])
  3537.     destroyElement(button["NUM6"])
  3538.     destroyElement(button["NUM5"])
  3539.     destroyElement(button["NUM4"])
  3540.     destroyElement(button["NUM3"])
  3541.     destroyElement(button["NUM2"])
  3542.     destroyElement(button["NUM1"])
  3543.     destroyElement(button["CALL"])
  3544.     destroyElement(button["DELETE"])
  3545. end
  3546. addCommandHandler("handyinfo", function() outputChatBox("Galaxy SII made by Noneatme! You are not allowed to copy this.", 0, 255, 0) end)
  3547.  
  3548. local function refreshRadio(table)
  3549.     if(radio == true) and (isElement(button["radio:button_grid"])) then
  3550.         guiGridListClear(button["radio:button_grid"])
  3551.         for index, spalte in pairs(table) do
  3552.             local string = spalte['RADIO']
  3553.             local name, url = gettok(string, 1, "|"), gettok(string, 2, "|")
  3554.             local row = guiGridListAddRow(button["radio:button_grid"])
  3555.             guiGridListSetItemText(button["radio:button_grid"], row, 1, name, false, false)
  3556.             guiGridListSetItemText(button["radio:button_grid"], row, 2, url, false, false)
  3557.         end
  3558.     end
  3559. end
  3560. addEventHandler("onMTHandyRadiosGetBack", getLocalPlayer(), refreshRadio)
  3561.  
  3562. function show_radio(id)
  3563.     if(radio == true) then return end
  3564.     if not(id) then id = 0 end
  3565.     radioauswahl = id
  3566.     local sx, sy = guiGetScreenSize()
  3567.     local x, y = sx/2, sy/2
  3568.    
  3569.     local addx, addy, width, height, scale
  3570.     if(id == 0) then
  3571.         radiosite = 1
  3572.         addx = 618
  3573.         addy = 50
  3574.         addx = addx/1920*sx
  3575.         addy = addy/1920*sx
  3576.         width, height = 164/1.5, 50/1.5
  3577.         width, height = width/1920*sx, height/1920*sx
  3578.        
  3579.         button["radio:button_radio"] = guiCreateButton(x+addx, y-addy, width, height, "Radio", false)
  3580.         this = button["radio:button_radio"]
  3581.         guiSetAlpha(this, 0)
  3582.        
  3583.         addx = 730
  3584.         addy = 50
  3585.         addx = addx/1920*sx
  3586.         addy = addy/1920*sx
  3587.         width, height = 164/1.5, 50/1.5
  3588.         width, height = width/1920*sx, height/1920*sx
  3589.        
  3590.         button["radio:button_settings"] = guiCreateButton(x+addx, y-addy, width, height, "Settings", false)
  3591.         this = button["radio:button_settings"]
  3592.         guiSetAlpha(this, 0)
  3593.        
  3594.         addEventHandler("onClientGUIClick", this, function()
  3595.             hide_radio(radioauswahl)
  3596.             radio = false
  3597.             show_radio(1)
  3598.             radio = true
  3599.         end, false)
  3600.        
  3601.         addx = 845
  3602.         addy = 55
  3603.         addx = addx/1920*sx
  3604.         addy = addy/1920*sx
  3605.         width, height = 130/1.5, 60/1.5
  3606.         width, height = width/1920*sx, height/1920*sx
  3607.        
  3608.         button["radio:button_more"] = guiCreateButton(x+addx, y-addy, width, height, "More", false)
  3609.         this = button["radio:button_more"]
  3610.         guiSetAlpha(this, 0)
  3611.        
  3612.         addEventHandler("onClientGUIClick", this, function()
  3613.             hide_radio(radioauswahl)
  3614.             radio = false
  3615.             show_radio(2)
  3616.             radio = true
  3617.         end, false)
  3618.        
  3619.        
  3620.         addx = 620
  3621.         addy = 10
  3622.         addx = addx/1920*sx
  3623.         addy = addy/1920*sx
  3624.         width, height = 470/1.5, 430/1.5
  3625.         width, height = width/1920*sx, height/1920*sx
  3626.        
  3627.         button["radio:button_grid"] = guiCreateGridList(x+addx, y-addy, width, height, false)
  3628.         this = button["radio:button_grid"]
  3629.        
  3630.         guiGridListAddColumn(this, "Name", 0.3)
  3631.         guiGridListAddColumn(this, "URL", 0.65)
  3632.         guiGridListSetSortingEnabled(this, false)
  3633.         guiGridListSetSelectionMode(this, 0)
  3634.         guiSetFont(this, "default-bold-small")
  3635.        
  3636.         addEventHandler("onClientGUIClick", this, function(b)
  3637.             if(b == "right") then
  3638.                 local url = guiGridListGetItemText(button["radio:button_grid"], guiGridListGetSelectedItem(button["radio:button_grid"]), 2)
  3639.                 if(url ~= "") then
  3640.                     setClipboard(url)
  3641.                     showInfobar("Information: Ausgewaehlte Stream-URL in Zwischenablage kopiert.", 5000, 0, 100, 0, true)
  3642.                 end
  3643.             end
  3644.         end, false)
  3645.        
  3646.         addx = 620
  3647.         addy = -280
  3648.         addx = addx/1920*sx
  3649.         addy = addy/1920*sx
  3650.         width, height = 400/1.5, 30/1.5
  3651.         width, height = width/1920*sx, height/1920*sx
  3652.        
  3653.         button["radio:label_1"] = guiCreateLabel(x+addx, y-addy, width, height, "Neuen Sender Einfuegen: (Name, URL)", false)
  3654.         this = button["radio:label_1"]
  3655.         guiSetFont(this, "default-bold-small")
  3656.        
  3657.         addx = 620
  3658.         addy = -300
  3659.         addx = addx/1920*sx
  3660.         addy = addy/1920*sx
  3661.         width, height = 133/1.5, 35/1.5
  3662.         width, height = width/1920*sx, height/1920*sx
  3663.        
  3664.         button["radio:edit_1"] = guiCreateEdit(x+addx, y-addy, width, height, "", false) -- Name
  3665.         this = button["radio:edit_1"]
  3666.         guiSetFont(this, "default-bold-small")
  3667.         guiEditSetMaxLength(this, 50)
  3668.        
  3669.         addx = 720
  3670.         addy = -300
  3671.         addx = addx/1920*sx
  3672.         addy = addy/1920*sx
  3673.         width, height = 266/1.5, 35/1.5
  3674.         width, height = width/1920*sx, height/1920*sx
  3675.        
  3676.         button["radio:edit_2"] = guiCreateEdit(x+addx, y-addy, width, height, "", false) -- url
  3677.         this = button["radio:edit_2"]
  3678.         guiSetFont(this, "default-bold-small")
  3679.         guiEditSetMaxLength(this, 205)
  3680.        
  3681.         addx = 620
  3682.         addy = -330
  3683.         addx = addx/1920*sx
  3684.         addy = addy/1920*sx
  3685.         width, height = 133/1.5, 40/1.5
  3686.         width, height = width/1920*sx, height/1920*sx
  3687.        
  3688.         button["radio:button_einfuegen"] = guiCreateButton(x+addx, y-addy, width, height, "Einfuegen", false)
  3689.         this = button["radio:button_einfuegen"]
  3690.         guiSetFont(this, "default-bold-small")
  3691.        
  3692.         addEventHandler("onClientGUIClick", this, function()
  3693.             local name, url = guiGetText(button["radio:edit_1"]), guiGetText(button["radio:edit_2"])
  3694.             if(name == "") or (name == " ") or (url == "") or (url == " ") or (gettok(name, 2, "|") ~= false) or (gettok(url, 2, "|") ~= false) then outputChatBox("Bitte gebe einen richtigen Name und eine richtige URL ein!", 255, 0, 0) return end
  3695.             triggerServerEvent("onMTHandyRadioInsert", gMe, name, url)
  3696.         end, false)
  3697.        
  3698.         addx = 730
  3699.         addy = -330
  3700.         addx = addx/1920*sx
  3701.         addy = addy/1920*sx
  3702.         width, height = 133/1.5, 40/1.5
  3703.         width, height = width/1920*sx, height/1920*sx
  3704.        
  3705.         button["radio:button_loeschen"] = guiCreateButton(x+addx, y-addy, width, height, "Loeschen", false)
  3706.         this = button["radio:button_loeschen"]
  3707.         guiSetFont(this, "default-bold-small")
  3708.        
  3709.         addEventHandler("onClientGUIClick", this, function()
  3710.             local name, url = guiGridListGetItemText(button["radio:button_grid"], guiGridListGetSelectedItem(button["radio:button_grid"]), 1), guiGridListGetItemText(button["radio:button_grid"], guiGridListGetSelectedItem(button["radio:button_grid"]), 2)
  3711.             if(name == "") or (name == " ") or (url == "") or (url == " ") then outputChatBox("Bitte waehle ein Radiosender aus!", 255, 0, 0) return end
  3712.             triggerServerEvent("onMTHandyRadioDelete", gMe, name, url)
  3713.         end, false)
  3714.  
  3715.         addx = 640
  3716.         addy = -375
  3717.         addx = addx/1920*sx
  3718.         addy = addy/1920*sx
  3719.         width, height = 92/1.5, 89/1.5
  3720.         width, height = width/1920*sx, height/1920*sx
  3721.        
  3722.         button["radio:button_play"] = guiCreateButton(x+addx, y-addy, width, height, "play", false)
  3723.         this = button["radio:button_play"]
  3724.         guiSetFont(this, "default-bold-small")
  3725.         guiSetAlpha(this, 0)
  3726.        
  3727.         addEventHandler("onClientGUIClick", this, function()
  3728.             local name, url = guiGridListGetItemText(button["radio:button_grid"], guiGridListGetSelectedItem(button["radio:button_grid"]), 1), guiGridListGetItemText(button["radio:button_grid"], guiGridListGetSelectedItem(button["radio:button_grid"]), 2)
  3729.             if(name == "") or (name == " ") or (url == "") or (url == " ") then outputChatBox("Bitte waehle ein Radiosender aus!", 255, 0, 0) return end
  3730.             if(radioData["playing"] == true) then
  3731.                 outputChatBox("Das Radio laeuft bereits! Stoppe es erst, bevor du ein anderen Sender hoeren moechtest.", 255, 0, 0)
  3732.                 return
  3733.             end
  3734.             radioData["playing"] = true
  3735.             radioData["sound"] = playSound(url, false)
  3736.             radioData["url"] = url
  3737.             radioData["name"] = name
  3738.             radioData["starttick"] = getTickCount()
  3739.             radioData["titel"] = ""
  3740.             setSoundVolume(radioData["sound"], radioData["volume"])
  3741.             outputChatBox("Das Radio versucht, den Stream abzuspielen.", 255, 255, 0)
  3742.             -- STREAM CHECK --
  3743.             addEventHandler("onClientSoundStream", radioData["sound"], function(suc,length,streamN)
  3744.                 if not (suc) then outputChatBox("Der Stream "..radioData["name"].." konnte nicht gefunden werden.", 255, 0, 0) return end
  3745.                 showInfobar("Der Stream '"..radioData["name"].."' wird abgespielt.", 3000, 0, 50, 50, true)
  3746.                 outputChatBox("Stream wird abgespielt! Uebertragungslatenzzeit(Ping): "..getTickCount()-radioData["starttick"].." MS ("..math.round(((getTickCount()-radioData["starttick"])/1000), 2, "round").." Sekunden)", 0, 255, 0)
  3747.             end)
  3748.             addEventHandler("onClientSoundChangedMeta", radioData["sound"], function(streamTitle)
  3749.                 if(radioData["titel"] == streamTitle) then return end
  3750.                 radioData["titel"] = streamTitle
  3751.                 outputChatBox("#FFFFFF[#00FF00RADIO#FFFFFF] #00FFFFStream Info: Titel: "..streamTitle, 0, 255, 255, true)
  3752.                 showInfobar("Radio Stream Titel: "..streamTitle, 3000, 0, 0, 50, true)
  3753.             end)
  3754.         end, false)
  3755.        
  3756.         addx = 848
  3757.         addy = -375
  3758.         addx = addx/1920*sx
  3759.         addy = addy/1920*sx
  3760.         width, height = 92/1.5, 89/1.5
  3761.         width, height = width/1920*sx, height/1920*sx
  3762.        
  3763.         button["radio:button_stop"] = guiCreateButton(x+addx, y-addy, width, height, "stop", false)
  3764.         this = button["radio:button_stop"]
  3765.         guiSetFont(this, "default-bold-small")
  3766.         guiSetAlpha(this, 0)
  3767.        
  3768.         addEventHandler("onClientGUIClick", this, function()
  3769.             if(radioData["playing"] == false) then
  3770.                 outputChatBox("Das Radio laeuft nicht.", 255, 0, 0)
  3771.                 return
  3772.             end
  3773.             radioData["playing"] = false
  3774.             destroyElement(radioData["sound"])
  3775.             radioData["url"] = false
  3776.             radioData["name"] = false
  3777.             outputChatBox("Das Radio wurde gestoppt.", 255, 255, 0)
  3778.            
  3779.         end, false)
  3780.        
  3781.         triggerServerEvent("onMTHandyRadiosGet", gMe)
  3782.     elseif(id == 1) then
  3783.         radiosite = 2
  3784.         addx = 618
  3785.         addy = 50
  3786.         addx = addx/1920*sx
  3787.         addy = addy/1920*sx
  3788.         width, height = 164/1.5, 50/1.5
  3789.         width, height = width/1920*sx, height/1920*sx
  3790.        
  3791.         button["radio:button_radio"] = guiCreateButton(x+addx, y-addy, width, height, "Radio", false)
  3792.         this = button["radio:button_radio"]
  3793.         guiSetAlpha(this, 0)
  3794.        
  3795.         addEventHandler("onClientGUIClick", this, function()
  3796.             hide_radio(radioauswahl)
  3797.             radio = false
  3798.             show_radio(0)
  3799.             radio = true
  3800.         end, false)
  3801.        
  3802.         addx = 730
  3803.         addy = 50
  3804.         addx = addx/1920*sx
  3805.         addy = addy/1920*sx
  3806.         width, height = 164/1.5, 50/1.5
  3807.         width, height = width/1920*sx, height/1920*sx
  3808.        
  3809.         button["radio:button_settings"] = guiCreateButton(x+addx, y-addy, width, height, "Settings", false)
  3810.         this = button["radio:button_settings"]
  3811.         guiSetAlpha(this, 0)
  3812.    
  3813.         addx = 845
  3814.         addy = 55
  3815.         addx = addx/1920*sx
  3816.         addy = addy/1920*sx
  3817.         width, height = 130/1.5, 60/1.5
  3818.         width, height = width/1920*sx, height/1920*sx
  3819.        
  3820.         button["radio:button_more"] = guiCreateButton(x+addx, y-addy, width, height, "More", false)
  3821.         this = button["radio:button_more"]
  3822.         guiSetAlpha(this, 0)
  3823.        
  3824.         addEventHandler("onClientGUIClick", this, function()
  3825.             hide_radio(radioauswahl)
  3826.             radio = false
  3827.             show_radio(2)
  3828.             radio = true
  3829.         end, false)
  3830.        
  3831.         addx = 620
  3832.         addy = 0
  3833.         addx = addx/1920*sx
  3834.         addy = addy/1920*sx
  3835.         width, height = 458/1.5, 49/1.5
  3836.         width, height = width/1920*sx, height/1920*sx
  3837.         button["radio:scrollbar_1"] = guiCreateScrollBar(x+addx, y-addy, width, height, true, false)
  3838.         this = button["radio:scrollbar_1"]
  3839.         guiScrollBarSetScrollPosition(this, radioData["volume"]*100)
  3840.        
  3841.         addEventHandler("onClientGUIScroll", this, function()
  3842.             radioData["volume"] = math.round(guiScrollBarGetScrollPosition(source)/100, 2, "round")
  3843.             if(isElement(button["radio:label_2"])) then
  3844.                 guiSetText(button["radio:label_2"], "Lautstaerke: "..radioData["volume"])
  3845.                 if(radioData["playing"] == true) and (isElement(radioData["sound"])) then
  3846.                     setSoundVolume(radioData["sound"], radioData["volume"])
  3847.                 end
  3848.             end
  3849.         end)
  3850.        
  3851.         addx = 620
  3852.         addy = -40
  3853.         addx = addx/1920*sx
  3854.         addy = addy/1920*sx
  3855.         width, height = 458/1.5, 49/1.5
  3856.         width, height = width/1920*sx, height/1920*sx
  3857.         button["radio:label_2"] = guiCreateLabel(x+addx, y-addy, width, height, "Laustaerke: "..radioData["volume"], false)
  3858.         this = button["radio:label_2"]
  3859.         guiSetFont(this, "default-bold-small")
  3860.         guiLabelSetColor(this, 0, 255, 0)
  3861.         guiLabelSetHorizontalAlign(this, "center")
  3862.        
  3863.        
  3864.         addx = 640
  3865.         addy = -375
  3866.         addx = addx/1920*sx
  3867.         addy = addy/1920*sx
  3868.         width, height = 92/1.5, 89/1.5
  3869.         width, height = width/1920*sx, height/1920*sx
  3870.        
  3871.         button["radio:button_play"] = guiCreateButton(x+addx, y-addy, width, height, "play", false)
  3872.         this = button["radio:button_play"]
  3873.         guiSetFont(this, "default-bold-small")
  3874.         guiSetAlpha(this, 0)
  3875.        
  3876.         addEventHandler("onClientGUIClick", this, function()
  3877.             outputChatBox("Du musst ein Radiosender auswaehlen!", 255, 0, 0)
  3878.         end, false)
  3879.        
  3880.         addx = 848
  3881.         addy = -375
  3882.         addx = addx/1920*sx
  3883.         addy = addy/1920*sx
  3884.         width, height = 92/1.5, 89/1.5
  3885.         width, height = width/1920*sx, height/1920*sx
  3886.        
  3887.         button["radio:button_stop"] = guiCreateButton(x+addx, y-addy, width, height, "stop", false)
  3888.         this = button["radio:button_stop"]
  3889.         guiSetFont(this, "default-bold-small")
  3890.         guiSetAlpha(this, 0)
  3891.        
  3892.         addEventHandler("onClientGUIClick", this, function()
  3893.             if(radioData["playing"] == false) then
  3894.                 outputChatBox("Das Radio laeuft nicht.", 255, 0, 0)
  3895.                 return
  3896.             end
  3897.             radioData["playing"] = false
  3898.             destroyElement(radioData["sound"])
  3899.             radioData["url"] = false
  3900.             radioData["name"] = false
  3901.             outputChatBox("Das Radio wurde gestoppt.", 255, 255, 0)
  3902.            
  3903.         end, false)
  3904.     elseif(id == 2) then
  3905.         radiosite = 3
  3906.         addx = 618
  3907.         addy = 50
  3908.         addx = addx/1920*sx
  3909.         addy = addy/1920*sx
  3910.         width, height = 164/1.5, 50/1.5
  3911.         width, height = width/1920*sx, height/1920*sx
  3912.        
  3913.         button["radio:button_radio"] = guiCreateButton(x+addx, y-addy, width, height, "Radio", false)
  3914.         this = button["radio:button_radio"]
  3915.         guiSetAlpha(this, 0)
  3916.        
  3917.         addEventHandler("onClientGUIClick", this, function()
  3918.             hide_radio(radioauswahl)
  3919.             radio = false
  3920.             show_radio(0)
  3921.             radio = true
  3922.         end, false)
  3923.        
  3924.         addx = 730
  3925.         addy = 50
  3926.         addx = addx/1920*sx
  3927.         addy = addy/1920*sx
  3928.         width, height = 164/1.5, 50/1.5
  3929.         width, height = width/1920*sx, height/1920*sx
  3930.        
  3931.         button["radio:button_settings"] = guiCreateButton(x+addx, y-addy, width, height, "Settings", false)
  3932.         this = button["radio:button_settings"]
  3933.         guiSetAlpha(this, 0)
  3934.        
  3935.         addEventHandler("onClientGUIClick", this, function()
  3936.             hide_radio(radioauswahl)
  3937.             radio = false
  3938.             show_radio(1)
  3939.             radio = true
  3940.         end, false)
  3941.        
  3942.         addx = 845
  3943.         addy = 55
  3944.         addx = addx/1920*sx
  3945.         addy = addy/1920*sx
  3946.         width, height = 130, 60
  3947.         width, height = width/1920*sx, height/1920*sx
  3948.        
  3949.         button["radio:button_more"] = guiCreateButton(x+addx, y-addy, width, height, "More", false)
  3950.         this = button["radio:button_more"]
  3951.         guiSetAlpha(this, 0)
  3952.        
  3953.         -- THE THINGS --
  3954.        
  3955.         addx = 1602
  3956.         addy = 543
  3957.         addx = addx/1920*sx
  3958.         addy = addy/1920*sx
  3959.         width, height = 254, 27
  3960.         width, height = width/1920*sx, height/1920*sx
  3961.        
  3962.         button["radio:more_label1"] = guiCreateLabel(addx, addy, width, height, "Soundposition: 0:0/0:0",false)
  3963.         guiLabelSetHorizontalAlign(button["radio:more_label1"],"center",false)
  3964.         guiSetFont(button["radio:more_label1"], "default-bold-small")
  3965.        
  3966.         local t1, t2, t3, t4 -- Ich mach das so weil ich zu faul bin
  3967.  
  3968.         addx = 1587
  3969.         addy = 908
  3970.         addx = addx/1920*sx
  3971.         addy = addy/1920*sx
  3972.         width, height = 121, 35
  3973.         width, height = width/1920*sx, height/1920*sx
  3974.         button["radio:more_button1"] = guiCreateButton(addx, addy, width, height,"Aktivieren",false)
  3975.         guiSetFont(button["radio:more_button1"], "default-bold-small")
  3976.        
  3977.         addx = 1765
  3978.         addy = 907
  3979.         addx = addx/1920*sx
  3980.         addy = addy/1920*sx
  3981.         width, height = 121, 35
  3982.         width, height = width/1920*sx, height/1920*sx
  3983.         button["radio:more_button2"] = guiCreateButton(addx, addy, width, height,"Deaktivieren",false)
  3984.         guiSetFont(button["radio:more_button2"], "default-bold-small")
  3985.        
  3986.         addx = 1591
  3987.         addy = 581
  3988.         addx = addx/1920*sx
  3989.         addy = addy/1920*sx
  3990.         width, height = 299, 23
  3991.         width, height = width/1920*sx, height/1920*sx
  3992.         button["radio:more_scrollbar1"] = guiCreateScrollBar(addx, addy, width, height, true, false)
  3993.         addEventHandler("onClientGUIScroll", button["radio:more_scrollbar1"] , function()
  3994.             if(can_scroll == true) then
  3995.                 if(radioData["playing"] == true) and (isElement(radioData["sound"])) then
  3996.                     local l = getSoundLength(radioData["sound"])
  3997.                     if(l ~= 0) then
  3998.                         setSoundPosition(radioData["sound"], l/100*guiScrollBarGetScrollPosition(source))
  3999.                     end
  4000.                 end
  4001.             end
  4002.         end)
  4003.         if(isElement(radioData["sound"])) then
  4004.             can_scroll = false
  4005.             guiScrollBarSetScrollPosition(button["radio:more_scrollbar1"], getSoundPosition(radioData["sound"])*100/getSoundLength(radioData["sound"]))
  4006.             setTimer(function()
  4007.                 can_scroll = true
  4008.             end, 50, 1)
  4009.         end
  4010.         if(isTimer(can_scrolltimer)) then killTimer(can_scrolltimer) end
  4011.         can_scrolltimer = setTimer(function()
  4012.             if(isElement(radioData["sound"])) and (isElement(button["radio:more_scrollbar1"])) then
  4013.                 can_scroll = false
  4014.                 guiScrollBarSetScrollPosition(button["radio:more_scrollbar1"], getSoundPosition(radioData["sound"])*100/getSoundLength(radioData["sound"]))
  4015.                 setTimer(function()
  4016.                     can_scroll = true
  4017.                 end, 50, 1)
  4018.             else
  4019.                 killTimer(can_scrolltimer)
  4020.             end
  4021.         end, 1000, -1)
  4022.         t1, t2, t3, t4 = 1590,616,97,16
  4023.         addx = t1
  4024.         addy = t2
  4025.         addx = addx/1920*sx
  4026.         addy = addy/1920*sx
  4027.         width, height = t3, t4
  4028.         width, height = width/1920*sx, height/1920*sx
  4029.         button["radio:more_label2"] = guiCreateLabel(addx, addy, width, height, "Einstellungen:", false)
  4030.         guiSetFont(button["radio:more_label2"], "default-bold-small")
  4031.        
  4032.         t1, t2, t3, t4 = 1591,645,72,18
  4033.         addx = t1
  4034.         addy = t2
  4035.         addx = addx/1920*sx
  4036.         addy = addy/1920*sx
  4037.         width, height = t3, t4
  4038.         width, height = width/1920*sx, height/1920*sx
  4039.         button["radio:more_label3"] = guiCreateLabel(addx, addy, width, height, "Sample rate:", false)
  4040.         guiSetFont(button["radio:more_label3"], "default-bold-small")
  4041.        
  4042.         t1, t2, t3, t4 = 1590,676,72,18
  4043.         addx = t1
  4044.         addy = t2
  4045.         addx = addx/1920*sx
  4046.         addy = addy/1920*sx
  4047.         width, height = t3, t4
  4048.         width, height = width/1920*sx, height/1920*sx
  4049.         button["radio:more_label4"] = guiCreateLabel(addx, addy, width, height, "Tempo:", false)
  4050.         guiSetFont(button["radio:more_label4"], "default-bold-small")
  4051.        
  4052.         t1, t2, t3, t4 = 1591,702,72,18
  4053.         addx = t1
  4054.         addy = t2
  4055.         addx = addx/1920*sx
  4056.         addy = addy/1920*sx
  4057.         width, height = t3, t4
  4058.         width, height = width/1920*sx, height/1920*sx
  4059.         button["radio:more_label5"] = guiCreateLabel(addx, addy, width, height, "Pitch:", false)
  4060.         guiSetFont(button["radio:more_label5"], "default-bold-small")
  4061.        
  4062.         t1, t2, t3, t4 = 1768,641,69,25
  4063.         addx = t1
  4064.         addy = t2
  4065.         addx = addx/1920*sx
  4066.         addy = addy/1920*sx
  4067.         width, height = t3, t4
  4068.         width, height = width/1920*sx, height/1920*sx
  4069.         button["radio:more_edit1"] = guiCreateEdit(addx, addy, width, height, "", false) -- rate
  4070.         guiSetFont(button["radio:more_edit1"], "default-bold-small")
  4071.        
  4072.         t1, t2, t3, t4 = 1768,670,69,25
  4073.         addx = t1
  4074.         addy = t2
  4075.         addx = addx/1920*sx
  4076.         addy = addy/1920*sx
  4077.         width, height = t3, t4
  4078.         width, height = width/1920*sx, height/1920*sx
  4079.         button["radio:more_edit2"] = guiCreateEdit(addx, addy, width, height, "", false) -- tempo
  4080.         guiSetFont(button["radio:more_edit2"], "default-bold-small")
  4081.        
  4082.         t1, t2, t3, t4 = 1768,698,69,25
  4083.         addx = t1
  4084.         addy = t2
  4085.         addx = addx/1920*sx
  4086.         addy = addy/1920*sx
  4087.         width, height = t3, t4
  4088.         width, height = width/1920*sx, height/1920*sx
  4089.         button["radio:more_edit3"] = guiCreateEdit(addx, addy, width, height, "", false) -- pitch
  4090.         guiSetFont(button["radio:more_edit3"], "default-bold-small")
  4091.        
  4092.         if(isRadioPlaying()) then
  4093.             local sample, tempo, pitch = getSoundProperties( radioData["sound"] )
  4094.             guiSetText(button["radio:more_edit1"], sample)
  4095.             guiSetText(button["radio:more_edit2"], tempo)
  4096.             guiSetText(button["radio:more_edit1"], pitch)
  4097.         end
  4098.         t1, t2, t3, t4 = 1587,749,301,144
  4099.         addx = t1
  4100.         addy = t2
  4101.         addx = addx/1920*sx
  4102.         addy = addy/1920*sx
  4103.         width, height = t3, t4
  4104.         width, height = width/1920*sx, height/1920*sx
  4105.         button["radio:more_grid1"] = guiCreateGridList(addx, addy, width, height, false)
  4106.         guiSetFont(button["radio:more_grid1"], "default-bold-small")
  4107.        
  4108.         guiGridListAddColumn(button["radio:more_grid1"],"Effekt name",0.4)
  4109.         guiGridListAddColumn(button["radio:more_grid1"],"Zurzeit aktiviert",0.4)
  4110.        
  4111.        
  4112.         -- SOUND EFFECTS --
  4113.         local function refreshMoreGrid()
  4114.             guiGridListClear(button["radio:more_grid1"])
  4115.             for index, name in pairs(effect_names) do
  4116.                 local row = guiGridListAddRow(button["radio:more_grid1"])
  4117.                 guiGridListSetItemText(button["radio:more_grid1"], row, 1, name, false, false)
  4118.                 if(radioData["playing"] == true) and (isElement(radioData["sound"])) then  
  4119.                     local enabled = getSoundEffects(radioData["sound"])[name]
  4120.                     local text = "Nein"
  4121.                     if(enabled) then text = "Ja" end
  4122.                     guiGridListSetItemText(button["radio:more_grid1"], row, 2, text, false, false)
  4123.                 else
  4124.                     guiGridListSetItemText(button["radio:more_grid1"], row, 2, "Nein", false, false)
  4125.                 end
  4126.             end
  4127.         end
  4128.        
  4129.         refreshMoreGrid()
  4130.         -- EVENT HANDLERS --
  4131.        
  4132.         addEventHandler("onClientGUIClick", button["radio:more_button1"], function()
  4133.             if(isRadioPlaying()) then
  4134.                 local text, enabled = guiGridListGetItemText(button["radio:more_grid1"], guiGridListGetSelectedItem(button["radio:more_grid1"]), 1), guiGridListGetItemText(button["radio:more_grid1"], guiGridListGetSelectedItem(button["radio:more_grid1"]), 2)
  4135.                 if(enabled == "Ja") then
  4136.                     outputChatBox("Diesen Sound-Effekt hast du Bereits aktiviert!", 255, 0, 0)
  4137.                     return
  4138.                 end
  4139.                 if(text ~= "") then
  4140.                     setSoundEffectEnabled(radioData["sound"], text, true)
  4141.                     outputChatBox("Der Sound Effekt: "..text.." wurde aktiviert.", 0, 255, 0)
  4142.                     refreshMoreGrid()
  4143.                 else
  4144.                     outputChatBox("Du musst ein Sound Effekt auswaehlen!", 255, 0, 0)
  4145.                 end
  4146.             else
  4147.                 outputChatBox("Du musst ein Stream abgespielt haben!", 255, 0, 0)
  4148.             end
  4149.         end, false)
  4150.        
  4151.         addEventHandler("onClientGUIClick", button["radio:more_button2"], function()
  4152.             if(isRadioPlaying()) then
  4153.                 local text, enabled = guiGridListGetItemText(button["radio:more_grid1"], guiGridListGetSelectedItem(button["radio:more_grid1"]), 1), guiGridListGetItemText(button["radio:more_grid1"], guiGridListGetSelectedItem(button["radio:more_grid1"]), 2)
  4154.                 if(enabled == "Nein") then
  4155.                     outputChatBox("Diesen Sound-Effekt hast du nicht Aktiviert!", 255, 0, 0)
  4156.                     return
  4157.                 end
  4158.                 if(text ~= "") then
  4159.                     setSoundEffectEnabled(radioData["sound"], text, false)
  4160.                     outputChatBox("Der Sound Effekt: "..text.." wurde deaktiviert.", 255, 0, 0)
  4161.                     refreshMoreGrid()
  4162.                 else
  4163.                     outputChatBox("Du musst ein Sound Effekt auswaehlen!", 255, 0, 0)
  4164.                 end
  4165.             else
  4166.                 outputChatBox("Du musst ein Stream abgespielt haben!", 255, 0, 0)
  4167.             end
  4168.         end, false)
  4169.         if(radioData["playing"] == true) and (isElement(radioData["sound"])) then
  4170.             local l = getSoundLength(radioData["sound"])
  4171.             if not(l) then
  4172.                 outputChatBox("Diese Einstellungen Funktionieren nicht bei Radio-Streams.", 255, 0, 0)
  4173.             else
  4174.                 local pos = getSoundPosition(radioData["sound"])
  4175.                 pos = math.round(pos, 2, "round")
  4176.                 guiSetText(button["radio:more_label1"], "Soundposition: "..pos.."/"..math.round(l, 2, "round"))
  4177.             end
  4178.         else
  4179.  
  4180.         end
  4181.     end
  4182. end
  4183.  
  4184.  
  4185. function hide_radio(id)
  4186.     if(radio == false) then return end
  4187.     if(id == 0) then
  4188.         destroyElement(button["radio:button_settings"])
  4189.         destroyElement(button["radio:button_radio"])
  4190.         destroyElement(button["radio:button_more"])
  4191.         destroyElement(button["radio:button_grid"])
  4192.         destroyElement(button["radio:label_1"])
  4193.         destroyElement(button["radio:edit_1"])
  4194.         destroyElement(button["radio:edit_2"])
  4195.         destroyElement(button["radio:button_loeschen"])
  4196.         destroyElement(button["radio:button_einfuegen"])
  4197.         destroyElement(button["radio:button_play"])
  4198.         destroyElement(button["radio:button_stop"])
  4199.     elseif(id == 1) then
  4200.         destroyElement(button["radio:button_settings"])
  4201.         destroyElement(button["radio:button_radio"])
  4202.         destroyElement(button["radio:button_more"])
  4203.         destroyElement(button["radio:button_play"])
  4204.         destroyElement(button["radio:button_stop"])
  4205.         destroyElement(button["radio:scrollbar_1"])
  4206.         destroyElement(button["radio:label_2"])
  4207.     elseif(id == 2) then
  4208.         destroyElement(button["radio:button_settings"])
  4209.         destroyElement(button["radio:button_radio"])
  4210.         destroyElement(button["radio:button_more"])
  4211.         destroyElement(button["radio:more_label1"])
  4212.         destroyElement(button["radio:more_label2"])
  4213.         destroyElement(button["radio:more_label3"])
  4214.         destroyElement(button["radio:more_label4"])
  4215.         destroyElement(button["radio:more_label5"])
  4216.         destroyElement(button["radio:more_scrollbar1"])
  4217.         destroyElement(button["radio:more_button1"])
  4218.         destroyElement(button["radio:more_button2"])
  4219.         destroyElement(button["radio:more_edit1"])
  4220.         destroyElement(button["radio:more_edit2"])
  4221.         destroyElement(button["radio:more_edit3"])
  4222.         destroyElement(button["radio:more_grid1"])
  4223.     end
  4224. end
  4225.  
  4226.  
  4227. function show_startartbuttons()
  4228.     if(standartbuttons == true) then return end
  4229.     standartbuttons = true
  4230.     local sx, sy = guiGetScreenSize()
  4231.     local x, y = sx/2, sy/2
  4232.    
  4233.     local addx, addy, width, height, scale
  4234.         -- HOME --
  4235.     addx = 750
  4236.     addy = -485
  4237.     addx = addx/1920*sx
  4238.     addy = addy/1920*sx
  4239.     width, height = 70/1.5, 60/1.5
  4240.     width, height = width/1920*sx, height/1920*sx
  4241.     button["home"] = guiCreateButton(x+addx, y-addy, width, height, "Home", false)
  4242.     guiSetAlpha(button["home"], 0)
  4243.     noSoundButton[button["home"]] = true
  4244.    
  4245.     addEventHandler("onClientGUIClick", button["home"], function()
  4246.        
  4247.         hide_dialer()
  4248.         hide_browser()
  4249.         hide_radio(radioauswahl)
  4250.         hide_appsite()
  4251.         hide_faq(faqsite)
  4252.         radio = false
  4253.         if(memo == true) then
  4254.             local text = guiGetText(button["memo:memo"])
  4255.             triggerServerEvent("onMTHandyAction", gMe, "memoupdate", text)
  4256.             hide_memo()
  4257.         end
  4258.         hide_calculator()
  4259.         hide_browsersite(page_images[c_url])
  4260.         hide_messenger(messengersite)
  4261.         menue = true
  4262.         show_buttonMain()
  4263.     end, false)
  4264.    
  4265.     -- BACK --
  4266.     addx = 850
  4267.     addy = -485
  4268.     addx = addx/1920*sx
  4269.     addy = addy/1920*sx
  4270.     width, height = 70/1.5, 60/1.5
  4271.     width, height = width/1920*sx, height/1920*sx
  4272.     button["back"] = guiCreateButton(x+addx, y-addy, width, height, "Zurueck", false)
  4273.     guiSetAlpha(button["back"], 0)
  4274.     noSoundButton[button["back"]] = true
  4275.     addEventHandler("onClientGUIClick", button["back"], function()
  4276.         if(browser == true) then
  4277.             if(page_images[c_url]) then
  4278.                 hide_browsersite(page_images[c_url])
  4279.             else
  4280.                 hide_browsersite("404")
  4281.             end
  4282.             c_url = last_url
  4283.             if not(c_url) then c_url = "www.loogle.com" end
  4284.             show_browsersite(page_images[last_url])
  4285.         end
  4286.         if(memo == true) then
  4287.             hide_memo()
  4288.             memo = false
  4289.             menue = true
  4290.             show_buttonMain()
  4291.         end
  4292.         if(messenger == true) then
  4293.             hide_messenger(messengersite)
  4294.             show_messenger("1")
  4295.             messengersite = "1"
  4296.         end
  4297.         if(radio == true) then
  4298.             hide_radio(radioauswahl)
  4299.             radio = false
  4300.             menue = true
  4301.             show_buttonMain()
  4302.         end
  4303.         if(faq == true) then
  4304.             if(faqsite == 1) then
  4305.                 hide_faq(faqsite)
  4306.                 show_faq(0)
  4307.                 faqsite = 0
  4308.             end
  4309.         end
  4310.     end, false)
  4311. end
  4312.  
  4313. addCommandHandler("faq", function()
  4314.     outputChatBox(faq)
  4315.     outputChatBox(faqsite)
  4316. end)
  4317.  
  4318. function hide_standartbuttons()
  4319.     if(standartbuttons == false) then return end
  4320.     standartbuttons = false
  4321.     destroyElement(button["home"])
  4322.     destroyElement(button["back"])
  4323. end
  4324.  
  4325.  
  4326. function show_appsite()
  4327.     if(appsite == false) then
  4328.         appsite = true
  4329.        
  4330.         -- CLOCK --
  4331.         local sx, sy = guiGetScreenSize()
  4332.         local x, y = sx/2, sy/2
  4333.        
  4334.         local addx, addy, width, height, scale
  4335.         addx = 640
  4336.         addy = 40
  4337.         addx = addx/1920*sx
  4338.         addy = addy/1920*sx
  4339.         width, height = 62/1.5, 62/1.5
  4340.         width, height = width/1920*sx, height/1920*sx
  4341.         button["app:clock"] = guiCreateButton(x+addx, y-addy, width, height, "Clock", false)
  4342.         guiSetAlpha(button["app:clock"], 0)
  4343.        
  4344.         addEventHandler("onClientMouseEnter", button["app:clock"], function()
  4345.             light["app:clock"] = true
  4346.         end)
  4347.        
  4348.         addEventHandler("onClientMouseLeave", button["app:clock"], function()
  4349.             light["app:clock"] = false
  4350.         end)
  4351.     end
  4352. end
  4353. function hide_appsite()
  4354.     if(appsite == true) then
  4355.         appsite = false
  4356.         destroyElement(button["app:clock"])
  4357.     end
  4358. end
  4359.  
  4360. function show_buttonMain()
  4361.     if(buttonmain == true) then return end
  4362.     buttonmain = true
  4363.     -- KNOEPFTE MAIN --
  4364.    
  4365.     -- CALL --
  4366.     local sx, sy = guiGetScreenSize()
  4367.     local x, y = sx/2, sy/2
  4368.    
  4369.     local addx, addy, width, height, scale
  4370.     addx = 640
  4371.     addy = -390
  4372.     addx = addx/1920*sx
  4373.     addy = addy/1920*sx
  4374.     width, height = 62/1.5, 62/1.5
  4375.     width, height = width/1920*sx, height/1920*sx
  4376.     button["Phone"] = guiCreateButton(x+addx, y-addy, width, height, "Telefon", false)
  4377.     guiSetAlpha(button["Phone"], 0)
  4378.    
  4379.     addEventHandler("onClientMouseEnter", button["Phone"], function()
  4380.         light["Phone"] = true
  4381.     end)
  4382.    
  4383.     addEventHandler("onClientMouseLeave", button["Phone"], function()
  4384.         light["Phone"] = false
  4385.     end)
  4386.    
  4387.     addEventHandler("onClientGUIClick", button["Phone"], function()
  4388.         outputChatBox("Nutze /call [Nummer].", 0, 255, 0)
  4389.     end)
  4390.    
  4391.     -- DIALER RAUSGENOMMNEN --
  4392.     --[[
  4393.     addEventHandler("onClientGUIClick", button["Phone"], function()
  4394.         hide_buttonMain()
  4395.         menue = false
  4396.         show_dialer()
  4397.     end)]]
  4398.    
  4399.  
  4400.  
  4401.    
  4402.     addx = 640+75
  4403.     addy = -390
  4404.     addx = addx/1920*sx
  4405.     addy = addy/1920*sx
  4406.     width, height = 64/1.5, 61/1.5
  4407.     width, height = width/1920*sx, height/1920*sx
  4408.     button["Contacts"] = guiCreateButton(x+addx, y-addy, width, height, "Kontakte", false)
  4409.     guiSetAlpha(button["Contacts"], 0)
  4410.    
  4411.     addEventHandler("onClientMouseEnter", button["Contacts"], function()
  4412.         light["Contacts"] = true
  4413.     end)
  4414.    
  4415.     addEventHandler("onClientMouseLeave", button["Contacts"], function()
  4416.         light["Contacts"] = false
  4417.     end)
  4418.    
  4419.    
  4420.     addx = 640+(75*2)
  4421.     addy = -390
  4422.     addx = addx/1920*sx
  4423.     addy = addy/1920*sx
  4424.     width, height = 64/1.5, 61/1.5
  4425.     width, height = width/1920*sx, height/1920*sx
  4426.     button["Messaging"] = guiCreateButton(x+addx, y-addy, width, height, "Nachrichten", false)
  4427.     guiSetAlpha(button["Messaging"], 0)
  4428.    
  4429.     addEventHandler("onClientMouseEnter", button["Messaging"], function()
  4430.         light["Messaging"] = true
  4431.     end)
  4432.    
  4433.     addEventHandler("onClientMouseLeave", button["Messaging"], function()
  4434.         light["Messaging"] = false
  4435.     end)
  4436.     addEventHandler("onClientGUIClick", button["Messaging"], function()
  4437.         menue = false
  4438.         hide_buttonMain()
  4439.         show_messenger("1")
  4440.         messengersite = "1"
  4441.     end)
  4442.     addx = 640+(75*3)
  4443.     addy = -390
  4444.     addx = addx/1920*sx
  4445.     addy = addy/1920*sx
  4446.     width, height = 64/1.5, 61/1.5
  4447.     width, height = width/1920*sx, height/1920*sx
  4448.     button["Apps"] = guiCreateButton(x+addx, y-addy, width, height, "Apps", false)
  4449.     guiSetAlpha(button["Apps"], 0)
  4450.    
  4451.     addEventHandler("onClientMouseEnter", button["Apps"], function()
  4452.         light["Apps"] = true
  4453.     end)
  4454.    
  4455.     addEventHandler("onClientMouseLeave", button["Apps"], function()
  4456.         light["Apps"] = false
  4457.     end)
  4458.     addEventHandler("onClientGUIClick", button["Apps"], function()
  4459.         menue = false
  4460.         hide_buttonMain()
  4461.         show_appsite()
  4462.     end)
  4463.     addx = 640
  4464.     addy = -220
  4465.     addx = addx/1920*sx
  4466.     addy = addy/1920*sx
  4467.     width, height = 62/1.5, 62/1.5
  4468.     width, height = width/1920*sx, height/1920*sx
  4469.     button["Browser"] = guiCreateButton(x+addx, y-addy, width, height, "Browser", false)
  4470.     guiSetAlpha(button["Browser"], 0)
  4471.    
  4472.     addEventHandler("onClientMouseEnter", button["Browser"], function()
  4473.         light["Browser"] = true
  4474.     end)
  4475.    
  4476.     addEventHandler("onClientMouseLeave", button["Browser"], function()
  4477.         light["Browser"] = false
  4478.     end)
  4479.     addEventHandler("onClientGUIClick", button["Browser"], function()
  4480.         menue = false
  4481.         hide_buttonMain()
  4482.         show_browser()
  4483.     end, false)
  4484.    
  4485.     addx = 640
  4486.     addy = -295
  4487.     addx = addx/1920*sx
  4488.     addy = addy/1920*sx
  4489.     width, height = 62/1.5, 62/1.5
  4490.     width, height = width/1920*sx, height/1920*sx
  4491.     button["FAQ"] = guiCreateButton(x+addx, y-addy, width, height, "FAQ", false)
  4492.     guiSetAlpha(button["FAQ"], 0)
  4493.    
  4494.     addEventHandler("onClientMouseEnter", button["FAQ"], function()
  4495.         light["FAQ"] = true
  4496.     end)
  4497.  
  4498.  
  4499.    
  4500.     addEventHandler("onClientMouseLeave", button["FAQ"], function()
  4501.         light["FAQ"] = false
  4502.     end)
  4503.     addEventHandler("onClientGUIClick", button["FAQ"], function()
  4504.         menue = false
  4505.         hide_buttonMain()
  4506.         show_faq(faqsite)
  4507.     end, false)
  4508.    
  4509.  
  4510.     addx = 640+75
  4511.     addy = -295
  4512.     addx = addx/1920*sx
  4513.     addy = addy/1920*sx
  4514.     width, height = 62/1.5, 62/1.5
  4515.     width, height = width/1920*sx, height/1920*sx
  4516.     button["Update"] = guiCreateButton(x+addx, y-addy, width, height, "Update", false)
  4517.     guiSetAlpha(button["Update"], 0)
  4518.    
  4519.     addEventHandler("onClientMouseEnter", button["Update"], function()
  4520.         light["Update"] = true
  4521.     end)
  4522.  
  4523.     addEventHandler("onClientMouseLeave", button["Update"], function()
  4524.         light["Update"] = false
  4525.     end)
  4526.     addEventHandler("onClientGUIClick", button["Update"], function()
  4527.         menue = false
  4528.         hide_buttonMain()
  4529.         show_browser()
  4530.         c_url = "www.updates.com"
  4531.         show_browsersite("updates")
  4532.     end, false)
  4533.    
  4534.     addx = 640+(75*2)
  4535.     addy = -295
  4536.     addx = addx/1920*sx
  4537.     addy = addy/1920*sx
  4538.     width, height = 62/1.5, 62/1.5
  4539.     width, height = width/1920*sx, height/1920*sx
  4540.     button["Radio"] = guiCreateButton(x+addx, y-addy, width, height, "Radio", false)
  4541.     guiSetAlpha(button["Radio"], 0)
  4542.    
  4543.     addEventHandler("onClientMouseEnter", button["Radio"], function()
  4544.         light["Radio"] = true
  4545.     end)
  4546.  
  4547.     addEventHandler("onClientMouseLeave", button["Radio"], function()
  4548.         light["Radio"] = false
  4549.     end)
  4550.     addEventHandler("onClientGUIClick", button["Radio"], function()
  4551.         menue = false
  4552.         hide_buttonMain()
  4553.         show_radio(0)
  4554.         radio = true
  4555.     end, false)
  4556.    
  4557.     addx = 640+(73*3)
  4558.     addy = -295
  4559.     addx = addx/1920*sx
  4560.     addy = addy/1920*sx
  4561.     width, height = 62/1.5, 62/1.5
  4562.     width, height = width/1920*sx, height/1920*sx
  4563.     button["Car"] = guiCreateButton(x+addx, y-addy, width, height, "Car", false)
  4564.     guiSetAlpha(button["Car"], 0)
  4565.    
  4566.     addEventHandler("onClientMouseEnter", button["Car"], function()
  4567.         light["Car"] = true
  4568.     end)
  4569.  
  4570.     addEventHandler("onClientMouseLeave", button["Car"], function()
  4571.         light["Car"] = false
  4572.     end)
  4573.     addEventHandler("onClientGUIClick", button["Car"], function()
  4574.         menue = false
  4575.         hide_buttonMain()
  4576.         show_browser()
  4577.         c_url = "www.fahrzeuge.com"
  4578.         show_browsersite("fahrzeuge")
  4579.     end, false)
  4580.    
  4581.     addx = 640+75
  4582.     addy = -220
  4583.     addx = addx/1920*sx
  4584.     addy = addy/1920*sx
  4585.     width, height = 64/1.5, 61/1.5
  4586.     width, height = width/1920*sx, height/1920*sx
  4587.     button["Memo"] = guiCreateButton(x+addx, y-addy, width, height, "Notiz", false)
  4588.     guiSetAlpha(button["Memo"], 0)
  4589.    
  4590.     addEventHandler("onClientMouseEnter", button["Memo"], function()
  4591.         light["Memo"] = true
  4592.     end)
  4593.    
  4594.     addEventHandler("onClientMouseLeave", button["Memo"], function()
  4595.         light["Memo"] = false
  4596.     end)
  4597.    
  4598.     addEventHandler("onClientGUIClick", button["Memo"], function()
  4599.         menue = false
  4600.         hide_buttonMain()
  4601.         show_memo()
  4602.     end, false)
  4603.     -- Calculator --
  4604.     addx = 640+(75*2)
  4605.     addy = -220
  4606.     addx = addx/1920*sx
  4607.     addy = addy/1920*sx
  4608.     width, height = 64/1.5, 61/1.5
  4609.     width, height = width/1920*sx, height/1920*sx
  4610.    
  4611.     button["Calculator"] = guiCreateButton(x+addx, y-addy, width, height, "Rechner", false)
  4612.     guiSetAlpha(button["Calculator"], 0)
  4613.    
  4614.     addEventHandler("onClientMouseEnter", button["Calculator"], function()
  4615.         light["Calculator"] = true
  4616.     end)
  4617.    
  4618.     addEventHandler("onClientMouseLeave", button["Calculator"], function()
  4619.         light["Calculator"] = false
  4620.     end)
  4621.    
  4622.     addEventHandler("onClientGUIClick", button["Calculator"], function()
  4623.         menue = false
  4624.         hide_buttonMain()
  4625.         show_calculator()
  4626.     end, false)
  4627.     -- House --
  4628.     addx = 640+(75*3)
  4629.     addy = -220
  4630.     addx = addx/1920*sx
  4631.     addy = addy/1920*sx
  4632.     width, height = 64/1.5, 61/1.5
  4633.     width, height = width/1920*sx, height/1920*sx
  4634.    
  4635.     button["House"] = guiCreateButton(x+addx, y-addy, width, height, "Haus", false)
  4636.     guiSetAlpha(button["House"], 0)
  4637.    
  4638.     addEventHandler("onClientMouseEnter", button["House"], function()
  4639.         light["House"] = true
  4640.     end)
  4641.    
  4642.     addEventHandler("onClientMouseLeave", button["House"], function()
  4643.         light["House"] = false
  4644.     end)
  4645.    
  4646.     addEventHandler("onClientGUIClick", button["House"], function()
  4647.         menue = false
  4648.         hide_buttonMain()
  4649.         show_browser()
  4650.         c_url = "www.house.com"
  4651.         show_browsersite("house")
  4652.     end, false)
  4653. end
  4654.  
  4655. function hide_buttonMain()
  4656.     if(buttonmain == false) then return end
  4657.     destroyElement(button["Phone"])
  4658.     destroyElement(button["Contacts"])
  4659.     destroyElement(button["Messaging"])
  4660.     destroyElement(button["Apps"])
  4661.     destroyElement(button["Browser"])
  4662.     destroyElement(button["Memo"])
  4663.     destroyElement(button["House"])
  4664.     destroyElement(button["Calculator"])
  4665.     destroyElement(button["FAQ"])
  4666.     destroyElement(button["Update"])
  4667.     destroyElement(button["Radio"])
  4668.     destroyElement(button["Car"])
  4669.     buttonmain = false
  4670. end
  4671.  
  4672.  
  4673. addEventHandler("onClientRender", getRootElement(), function()
  4674.     if(enabled == true) then
  4675.         for index, knopf in pairs(button) do
  4676.             --if(isElement(knopf)) then
  4677.             --  guiBringToFront(knopf)
  4678.             --end
  4679.         end
  4680.         local sx, sy = guiGetScreenSize()
  4681.         local x, y = sx/2, sy/2
  4682.    
  4683.         local addx, addy, width, height, scale, bx, by
  4684.        
  4685.         -- RAHMEN --
  4686.         addx = 590
  4687.         addy = 160
  4688.         addx = addx/1920*sx
  4689.         addy = addy/1920*sx
  4690.         width, height = 370, 713
  4691.         width, height = width/1920*sx, height/1920*sx
  4692.         dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/rahmen.png")
  4693.        
  4694.         -- BACKGROUND & RAHMEN --
  4695. --      addx = 630
  4696. --      addy = 45
  4697.         addx = 615
  4698.         addy = 80
  4699.         addx = addx/1920*sx
  4700.         addy = addy/1920*sx
  4701.         width, height = 488/1.5, 815/1.5
  4702.         width, height = width/1920*sx, height/1920*sx
  4703.         if(fileExists("data/images/galaxy/icons/backgrounds/background"..current_background..".jpg")) then
  4704.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/backgrounds/background"..current_background..".jpg")
  4705.         else
  4706.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/backgrounds/background1.jpg")
  4707.         end
  4708.         -- EMPFANG & AKKU --
  4709.         addx = 840
  4710.         addy = 75
  4711.         addx = addx/1920*sx
  4712.         addy = addy/1920*sx
  4713.         width, height = 23/1.5, 21/1.5
  4714.         width, height = width/1920*sx, height/1920*sx
  4715.         dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/empfang"..empfang..".png")
  4716.         -- AKKU --
  4717.         addx = 860
  4718.         addy = 76
  4719.         addx = addx/1920*sx
  4720.         addy = addy/1920*sx
  4721.         width, height = 20/1.5, 24/1.5
  4722.         width, height = width/1920*sx, height/1920*sx
  4723.         dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/batterie"..akku..".png")
  4724.         -- STATUSLEISTE --
  4725.         local s_add = 0
  4726.         if(radioData["playing"] == true) then
  4727.             addx = 620+s_add
  4728.             addy = 76
  4729.             addx = addx/1920*sx
  4730.             addy = addy/1920*sx
  4731.             width, height = 24/1.5, 24/1.5
  4732.             width, height = width/1920*sx, height/1920*sx
  4733.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/play.png")
  4734.             s_add = s_add+30
  4735.         end
  4736.         if(emailget == true) then
  4737.             addx = 620+s_add
  4738.             addy = 76
  4739.             addx = addx/1920*sx
  4740.             addy = addy/1920*sx
  4741.             width, height = 24/1.5, 24/1.5
  4742.             width, height = width/1920*sx, height/1920*sx
  4743.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/messagearrived.png")
  4744.             s_add = s_add+30
  4745.         end
  4746.         -- TIME --
  4747.         local hour, min = getTime()
  4748.         if(hour < 10) then hour = "0"..hour end
  4749.         if(min < 10) then min = "0"..min end
  4750.         addx = 885
  4751.         addy = 77.5
  4752.         addx = addx/1920*sx
  4753.         addy = addy/1920*sx
  4754.         width, height = 20/1.5, 24/1.5
  4755.         width, height = width/1920*sx, height/1920*sx
  4756.         scale = 0.35/1920*sx
  4757.         dxDrawText(hour..":"..min, x+addx, y-addy, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, font)
  4758.         -- BROWSER --
  4759.         -- CALCULATOR --
  4760.         if(calculator == true) then
  4761.             addx = 615
  4762.             addy = 55
  4763.             addx = addx/1920*sx
  4764.             addy = addy/1920*sx
  4765.             width, height = 488/1.5, 780/1.5
  4766.             width, height = width/1920*sx, height/1920*sx
  4767.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/calculatorbackground.png")
  4768.             -- anzeige --
  4769.             addx = 620
  4770.             addy = 60
  4771.             addx = addx/1920*sx
  4772.             addy = addy/1920*sx
  4773.             width, height = 20/1.5, 24/1.5
  4774.             width, height = width/1920*sx, height/1920*sx
  4775.             scale = 0.8/1920*sx
  4776.             bx = 940
  4777.             by = -100
  4778.             dxDrawText(cal_anzeige, x+addx, y-addy, x+bx, y-by, tocolor(255, 255, 255, 200), scale, font, "left", "top", false, true)
  4779.         end
  4780.         if(browser == true) then
  4781.             addx = 615
  4782.             addy = 1
  4783.             addx = addx/1920*sx
  4784.             addy = addy/1920*sx
  4785.             width, height = 488/1.5, 705/1.5
  4786.             width, height = width/1920*sx, height/1920*sx
  4787.             local page = page_images[c_url]
  4788.             if not(page) then page = "404" end
  4789.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/browser/"..page..".jpg")
  4790.             -- BROWSER LABEL OBEN --
  4791.             addx = 614
  4792.             addy = 57
  4793.             addx = addx/1920*sx
  4794.             addy = addy/1920*sx
  4795.             width, height = 488/1.5, 83/1.5
  4796.             width, height = width/1920*sx, height/1920*sx
  4797.             scale = 0.3/1920*sx
  4798.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/browser/url.jpg")
  4799.            
  4800.             addx = 700
  4801.             addy = 35
  4802.             addx = addx/1920*sx
  4803.             addy = addy/1920*sx
  4804.             width, height = 20/1.5, 24/1.5
  4805.             width, height = width/1920*sx, height/1920*sx
  4806.             scale = 0.3/1920*sx
  4807.             bx = 940
  4808.             by = -100
  4809.             dxDrawText(c_url, x+addx, y-addy, x+bx, y-by, tocolor(255, 255, 255, 200), scale, font, "left", "top", false, true)
  4810.             -- PAGE DESIGNS --
  4811.             if(page == "startpage") then
  4812.                 addx = 700
  4813.                 addy = -444
  4814.                 addx = addx/1920*sx
  4815.                 addy = addy/1920*sx
  4816.                 width, height = 20/1.5, 24/1.5
  4817.                 width, height = width/1920*sx, height/1920*sx
  4818.                 scale = 0.3/1920*sx
  4819.                 local x2, y2, z2 = getElementPosition(getLocalPlayer())
  4820.                 local zone1, zone2 = getZoneName(x2, y2, z2, false), getZoneName(x2, y2, z2, true)
  4821.                 dxDrawText(zone1..", "..zone2, x+addx, y-addy, x+addx, y-addy, tocolor(20, 20, 20, 200), scale, font, "left", "top", false, true)
  4822.             elseif(page == "404") then
  4823.                 addx = 700
  4824.                 addy = -200
  4825.                 addx = addx/1920*sx
  4826.                 addy = addy/1920*sx
  4827.                 width, height = 20/1.5, 24/1.5
  4828.                 width, height = width/1920*sx, height/1920*sx
  4829.                 scale = 0.3/1920*sx
  4830.                 local x2, y2, z2 = getElementPosition(getLocalPlayer())
  4831.                 local zone1, zone2 = getZoneName(x2, y2, z2, false), getZoneName(x2, y2, z2, true)
  4832.                 dxDrawText("404 - Website not found", x+addx, y-addy, x+addx, y-addy, tocolor(20, 20, 20, 200), scale, font, "left", "top", false, true)
  4833.             elseif(page == "10060") then
  4834.                 addx = 700
  4835.                 addy = -200
  4836.                 addx = addx/1920*sx
  4837.                 addy = addy/1920*sx
  4838.                 width, height = 20/1.5, 24/1.5
  4839.                 width, height = width/1920*sx, height/1920*sx
  4840.                 scale = 0.3/1920*sx
  4841.                 local x2, y2, z2 = getElementPosition(getLocalPlayer())
  4842.                 local zone1, zone2 = getZoneName(x2, y2, z2, false), getZoneName(x2, y2, z2, true)
  4843.                 dxDrawText("10060 - Connection timed out", x+addx, y-addy, x+addx, y-addy, tocolor(20, 20, 20, 200), scale, font, "left", "top", false, true)
  4844.             end
  4845.             show_browsersite(page)
  4846.         end
  4847.         -- DIALER --
  4848.         if(dialer == true) then
  4849.             addx = 615
  4850.             addy = 80
  4851.             addx = addx/1920*sx
  4852.             addy = addy/1920*sx
  4853.             width, height = 488/1.5, 815/1.5
  4854.             width, height = width/1920*sx, height/1920*sx
  4855.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/dialer.jpg")
  4856.             addx = 620
  4857.             addy = -10
  4858.             addx = addx/1920*sx
  4859.             addy = addy/1920*sx
  4860.             width, height = 20/1.5, 24/1.5
  4861.             width, height = width/1920*sx, height/1920*sx
  4862.             scale = 0.8/1920*sx
  4863.             bx = 940
  4864.             by = -100
  4865.             dxDrawText(auswahl, x+addx, y-addy, x+bx, y-by, tocolor(255, 255, 255, 200), scale, font, "left", "top", false, true)
  4866.         end
  4867.         -- MENUE --
  4868.         -- FAQ--
  4869.         if(faq == true) then
  4870.             addx = 615
  4871.             addy = 55
  4872.             addx = addx/1920*sx
  4873.             addy = addy/1920*sx
  4874.             width, height = 488/1.5, 780/1.5
  4875.             width, height = width/1920*sx, height/1920*sx
  4876.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/faqbackground.jpg")
  4877.         end
  4878.         -- FAQ 2 --
  4879.         if(faq == true) and (faqsite == 1) then
  4880.             addx = 615
  4881.             addy = 0
  4882.             addx = addx/1920*sx
  4883.             addy = addy/1920*sx
  4884.             width, height = 488/1.5, 780/1.5
  4885.             width, height = width/1920*sx, height/1920*sx
  4886.             scale = 1.5/1920*sx
  4887.             dxDrawText(handy_help_text[faq_suche], x+addx, y-addy, x+addx+width, y-addy+height, tocolor(0, 0, 0, 200), scale, "arial", "center", "top", true, true, true)
  4888.         end
  4889.         -- Messanger
  4890.         if(messenger == true) then
  4891.             addx = 615
  4892.             addy = 55
  4893.             addx = addx/1920*sx
  4894.             addy = addy/1920*sx
  4895.             width, height = 488/1.5, 780/1.5
  4896.             width, height = width/1920*sx, height/1920*sx
  4897.             local url = messengersite
  4898.             if(messengersite == "2") then url = "1" end
  4899.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/messenger/"..url..".png")
  4900.         end
  4901.         if(radio == true) then
  4902.             addx = 615
  4903.             addy = 55
  4904.             addx = addx/1920*sx
  4905.             addy = addy/1920*sx
  4906.             width, height = 488/1.5, 780/1.5
  4907.             width, height = width/1920*sx, height/1920*sx
  4908.             local background = 1
  4909.             if(radiosite == 3) then background = 2 end
  4910.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/radiobackground"..background..".png")
  4911.             if(radiosite == 3) then
  4912.                 if(radioData["playing"] == true) and (isElement(radioData["sound"])) then
  4913.                     local pos = getSoundPosition(radioData["sound"])
  4914.                     local l = getSoundLength(radioData["sound"])
  4915.                     l = l*1000
  4916.                     pos = pos*1000
  4917.                     pos = math.round(pos, 1, "round")
  4918.                     l = math.round(l, 1, "round")
  4919.                     local m1, s1 = convertTime(pos)
  4920.                     local m2, s2 = convertTime(l)
  4921.                     m1, s1, m2, s2 = tonumber(m1), tonumber(s1), tonumber(m2), tonumber(s2)
  4922.                     if(m1 < 10) then m1 = "0"..m1 end
  4923.                     if(m2 < 10) then m2 = "0"..m2 end
  4924.                     if(s1 < 10) then s1 = "0"..s1 end
  4925.                     if(s2 < 10) then s2 = "0"..s2 end
  4926.                     guiSetText(button["radio:more_label1"], m1..":"..s1.." / "..m2..":"..s2)
  4927.                     --l/100*guiScrollBarGetScrollPosition(source)
  4928.                 end
  4929.             end
  4930.             if(radiosite == 2) then
  4931.                 if(radioData["playing"] == true) and (isElement(radioData["sound"])) then
  4932.                     -- BEATS PER MINUTE --
  4933.                     local bpm = getSoundBPM(radioData["sound"])
  4934.                     local r, g, b = 0, 0, 0
  4935.                     if(bpm == false) or not(bpm) then
  4936.                         r, g, b = 0, 255, 0
  4937.                     else
  4938.                         if(bpm < 10) then
  4939.                             r, g, b = 0, 255, 0
  4940.                         end
  4941.                         if(bpm > 10) then
  4942.                             r, g, b = 0, 255, 255
  4943.                         end
  4944.                         if(bpm > 70) then
  4945.                             r, g, b = 0, 0, 255
  4946.                         end
  4947.                         if(bpm > 100) then
  4948.                             r, g, b = 255, 150-(bpm/1.5), 0
  4949.                         end
  4950.                         if(bpm > 150) then
  4951.                             r, g, b = 255, 20, 20
  4952.                         end
  4953.                         if(bpm > 200) then
  4954.                             r, g, b = 255, 0, 0
  4955.                         end
  4956.                     end
  4957.                     addx = 640
  4958.                     addy = -325
  4959.                     addx = addx/1920*sx
  4960.                     addy = addy/1920*sx
  4961.                     width, height = 400/1.5, 5/1.5
  4962.                     width, height = width/1920*sx, height/1920*sx
  4963.                     scale = 0.3/1920*sx
  4964.                     dxDrawRectangle(x+addx, y-addy, width, height, tocolor(r, g, b, 50))
  4965.                     --dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/misc/visualiser.png", 0, 0, 0, tocolor(r, g, b, 50))
  4966.                 end
  4967.                 -- FTT DATA --
  4968.                 local table
  4969.                 if(radioData["playing"] == true) and (isElement(radioData["sound"])) then
  4970.                     table = getSoundFFTData(radioData["sound"], 512)
  4971.                     if (table) then else
  4972.                         table = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
  4973.                     end
  4974.                 else
  4975.                     table = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
  4976.                 end
  4977.                 addx = 640
  4978.                 addy = -320
  4979.                 addx = addx/1920*sx
  4980.                 addy = addy/1920*sx
  4981.                 width, height = 10/1.5, 10/1.5
  4982.                 width, height = width/1920*sx, height/1920*sx
  4983.                 local add = 15/1920*sx
  4984.                 local curadd = add
  4985.                 local r, g, b = 0, 255, 0
  4986.                 for i = 1, 16, 1 do
  4987.                     if not(radioSample[i]) then
  4988.                         radioSample[i] = 7
  4989.                     end
  4990.                     local height2 = (height*(table[i]*2048)/100*10)/100*(radioData["volume"]*100)
  4991.                     if(height2 > 150) then
  4992.                         height2 = 150
  4993.                     end
  4994.                     if (height2 < 7) then
  4995.                         height2 = 7
  4996.                     end
  4997.                     if(radioSample[i] < height2) then
  4998.                         radioSample[i] = height2
  4999.                     end
  5000.                     if not(radioBalken[i]) then
  5001.                         radioBalken[i] = 7
  5002.                     end
  5003.                     if(radioData["playing"] == true) and (isElement(radioData["sound"])) then
  5004.                         radioBalken[i] = height2
  5005.                     else
  5006.                         radioBalken[i] = radioBalken[i]-1.2
  5007.                     end
  5008.                     if (radioBalken[i] < 7) then
  5009.                         radioBalken[i] = 7
  5010.                     end
  5011.                     r, g, b = r+14, g-14, b
  5012.                     dxDrawRectangle(x+addx+curadd-1, y-addy, width+1, height-radioBalken[i], tocolor(0, 0, 0, 100))
  5013.                     dxDrawRectangle(x+addx+curadd, y-addy, width, height-radioBalken[i], tocolor(r, g, b))
  5014.                     dxDrawRectangle(x+addx+curadd, y-addy-radioSample[i]+5, width, 1, tocolor(255, 255, 255, 150))
  5015.                     curadd = curadd+add
  5016.                     radioSample[i] = radioSample[i]-1  
  5017.                 end
  5018.                 -- TITEL --
  5019.                 addx = 640
  5020.                 addy = -100
  5021.                 addx = addx/1920*sx
  5022.                 addy = addy/1920*sx
  5023.                 width, height = 50/1.5, 50/1.5
  5024.                 width, height = width/1920*sx, height/1920*sx
  5025.                 scale = 0.3/1920*sx
  5026.                 local name = radioData["name"]
  5027.                 if not(name) then name = "-" end
  5028.                 local titel = radioData["titel"]
  5029.                 if not(titel) then titel = "-" end
  5030.                 dxDrawText("Stream: "..name.."\nTitel: "..titel, x+addx, y-addy, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, font, "left", "top", false, true)
  5031.             end
  5032.         end
  5033.         -- APPS --
  5034.         if(appsite == true) then
  5035.             -- CLOCK --
  5036.             addx = 640
  5037.             addy = 40
  5038.             addx = addx/1920*sx
  5039.             addy = addy/1920*sx
  5040.             width, height = 62/1.5, 62/1.5
  5041.             width, height = width/1920*sx, height/1920*sx
  5042.             local done = light["app:clock"]
  5043.             local r, g, b, a = 255, 255, 255, 200
  5044.             if(done) and (done == true) then
  5045.                 r, g, b, a = 255, 255, 255, 255
  5046.             end
  5047.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/clock.png", 0, 0, 0, tocolor(r, g, b, a))
  5048.            
  5049.             addx = 647
  5050.             addy = 0
  5051.             addx = addx/1920*sx
  5052.             addy = addy/1920*sx
  5053.             width, height = 62/1.5, 62/1.5
  5054.             width, height = width/1920*sx, height/1920*sx
  5055.             scale = 1.2/1920*sx
  5056.             dxDrawText("Uhr", x+addx, y-addy, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, "sans")
  5057.         end
  5058.         if(menue == true) then
  5059.             show_buttonMain()
  5060.             -- ICONS --
  5061.             -- BROWSER --
  5062.             addx = 640
  5063.             addy = -220
  5064.             addx = addx/1920*sx
  5065.             addy = addy/1920*sx
  5066.             width, height = 62/1.5, 62/1.5
  5067.             width, height = width/1920*sx, height/1920*sx
  5068.             local done = light["Browser"]
  5069.             local r, g, b, a = 255, 255, 255, 200
  5070.             if(done) and (done == true) then
  5071.                 r, g, b, a = 255, 255, 255, 255
  5072.             end
  5073.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/browser.png", 0, 0, 0, tocolor(r, g, b, a))
  5074.             -- FAQ --
  5075.             addx = 640
  5076.             addy = -295
  5077.             addx = addx/1920*sx
  5078.             addy = addy/1920*sx
  5079.             width, height = 62/1.5, 62/1.5
  5080.             width, height = width/1920*sx, height/1920*sx
  5081.             local done = light["FAQ"]
  5082.             local r, g, b, a = 255, 255, 255, 200
  5083.             if(done) and (done == true) then
  5084.                 r, g, b, a = 255, 255, 255, 255
  5085.             end
  5086.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/FAQ.png", 0, 0, 0, tocolor(r, g, b, a))
  5087.             -- Phone
  5088.             addx = 640
  5089.             addy = -390
  5090.             addx = addx/1920*sx
  5091.             addy = addy/1920*sx
  5092.             width, height = 62/1.5, 62/1.5
  5093.             width, height = width/1920*sx, height/1920*sx
  5094.             local done = light["Phone"]
  5095.             local r, g, b, a = 255, 255, 255, 200
  5096.             if(done) and (done == true) then
  5097.                 r, g, b, a = 255, 255, 255, 255
  5098.             end
  5099.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/call.png", 0, 0, 0, tocolor(r, g, b, a))
  5100.             -- Contacts --
  5101.             addx = 640+75
  5102.             addy = -390
  5103.             addx = addx/1920*sx
  5104.             addy = addy/1920*sx
  5105.             width, height = 64/1.5, 61/1.5
  5106.             width, height = width/1920*sx, height/1920*sx
  5107.             local done = light["Contacts"]
  5108.             local r, g, b, a = 255, 255, 255, 200
  5109.             if(done) and (done == true) then
  5110.                 r, g, b, a = 255, 255, 255, 255
  5111.             end
  5112.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/contacts.png", 0, 0, 0, tocolor(r, g, b, a))
  5113.             -- memo --
  5114.             addx = 640+75
  5115.             addy = -220
  5116.             addx = addx/1920*sx
  5117.             addy = addy/1920*sx
  5118.             width, height = 64/1.5, 61/1.5
  5119.             width, height = width/1920*sx, height/1920*sx
  5120.             local done = light["Memo"]
  5121.             local r, g, b, a = 255, 255, 255, 200
  5122.             if(done) and (done == true) then
  5123.                 r, g, b, a = 255, 255, 255, 255
  5124.             end
  5125.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/memo.png", 0, 0, 0, tocolor(r, g, b, a))
  5126.             -- Calculator --
  5127.             addx = 640+(75*2)
  5128.             addy = -220
  5129.             addx = addx/1920*sx
  5130.             addy = addy/1920*sx
  5131.             width, height = 64/1.5, 61/1.5
  5132.             width, height = width/1920*sx, height/1920*sx
  5133.             local done = light["Calculator"]
  5134.             local r, g, b, a = 255, 255, 255, 200
  5135.             if(done) and (done == true) then
  5136.                 r, g, b, a = 255, 255, 255, 255
  5137.             end
  5138.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/calculator.png", 0, 0, 0, tocolor(r, g, b, a))
  5139.             -- House --
  5140.             addx = 640+(75*3)
  5141.             addy = -220
  5142.             addx = addx/1920*sx
  5143.             addy = addy/1920*sx
  5144.             width, height = 64/1.5, 61/1.5
  5145.             width, height = width/1920*sx, height/1920*sx
  5146.             local done = light["House"]
  5147.             local r, g, b, a = 255, 255, 255, 200
  5148.             if(done) and (done == true) then
  5149.                 r, g, b, a = 255, 255, 255, 255
  5150.             end
  5151.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/house.png", 0, 0, 0, tocolor(r, g, b, a))
  5152.             -- MESSAGING --
  5153.             addx = 640+(75*2)
  5154.             addy = -390
  5155.             addx = addx/1920*sx
  5156.             addy = addy/1920*sx
  5157.             width, height = 64/1.5, 61/1.5
  5158.             width, height = width/1920*sx, height/1920*sx
  5159.             local done = light["Messaging"]
  5160.             local r, g, b, a = 255, 255, 255, 200
  5161.             if(done) and (done == true) then
  5162.                 r, g, b, a = 255, 255, 255, 255
  5163.             end
  5164.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/messaging.png", 0, 0, 0, tocolor(r, g, b, a))
  5165.             -- Application --
  5166.             addx = 640+(75*3)
  5167.             addy = -390
  5168.             addx = addx/1920*sx
  5169.             addy = addy/1920*sx
  5170.             width, height = 64/1.5, 61/1.5
  5171.             width, height = width/1920*sx, height/1920*sx
  5172.             local done = light["Apps"]
  5173.             local r, g, b, a = 255, 255, 255, 200
  5174.             if(done) and (done == true) then
  5175.                 r, g, b, a = 255, 255, 255, 255
  5176.             end
  5177.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/apps.png", 0, 0, 0, tocolor(r, g, b, a))
  5178.            
  5179.             -- Updates --
  5180.             addx = 640+75
  5181.             addy = -295
  5182.             addx = addx/1920*sx
  5183.             addy = addy/1920*sx
  5184.             width, height = 64/1.5, 64/1.5
  5185.             width, height = width/1920*sx, height/1920*sx
  5186.             local done = light["Update"]
  5187.             local r, g, b, a = 255, 255, 255, 200
  5188.             if(done) and (done == true) then
  5189.                 r, g, b, a = 255, 255, 255, 255
  5190.             end
  5191.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/update.png", 0, 0, 0, tocolor(r, g, b, a))
  5192.            
  5193.             -- Radio --
  5194.             addx = 640+(75*2)
  5195.             addy = -295
  5196.             addx = addx/1920*sx
  5197.             addy = addy/1920*sx
  5198.             width, height = 64/1.5, 64/1.5
  5199.             width, height = width/1920*sx, height/1920*sx
  5200.             local done = light["Radio"]
  5201.             local r, g, b, a = 255, 255, 255, 200
  5202.             if(done) and (done == true) then
  5203.                 r, g, b, a = 255, 255, 255, 255
  5204.             end
  5205.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/radio.png", 0, 0, 0, tocolor(r, g, b, a))
  5206.            
  5207.             -- CAR --
  5208.             addx = 640+(73*3)
  5209.             addy = -295
  5210.             addx = addx/1920*sx
  5211.             addy = addy/1920*sx
  5212.             width, height = 64/1.5, 64/1.5
  5213.             width, height = width/1920*sx, height/1920*sx
  5214.             local done = light["Car"]
  5215.             local r, g, b, a = 255, 255, 255, 200
  5216.             if(done) and (done == true) then
  5217.                 r, g, b, a = 255, 255, 255, 255
  5218.             end
  5219.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/car.png", 0, 0, 0, tocolor(r, g, b, a))
  5220.             -- LABELS --
  5221.             -- PHONE
  5222.             -- Calculator
  5223.             addx = 652+(65*2)
  5224.             addy = -260
  5225.             addx = addx/1920*sx
  5226.             addy = addy/1920*sx
  5227.             width, height = 62/1.5, 62/1.5
  5228.             width, height = width/1920*sx, height/1920*sx
  5229.             scale = 1.2/1920*sx
  5230.             dxDrawText("Rechner", x+addx, y-addy, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, "sans")
  5231.             -- Memo
  5232.             addx = 652+65
  5233.             addy = -260
  5234.             addx = addx/1920*sx
  5235.             addy = addy/1920*sx
  5236.             width, height = 62/1.5, 62/1.5
  5237.             width, height = width/1920*sx, height/1920*sx
  5238.             scale = 1.2/1920*sx
  5239.             dxDrawText("Notiz", x+addx, y-addy, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, "sans")
  5240.             -- House
  5241.             addx = 672+(65*3)
  5242.             addy = -260
  5243.             addx = addx/1920*sx
  5244.             addy = addy/1920*sx
  5245.             width, height = 62/1.5, 62/1.5
  5246.             width, height = width/1920*sx, height/1920*sx
  5247.             scale = 1.2/1920*sx
  5248.             dxDrawText("Haus", x+addx, y-addy, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, "sans")
  5249.             -- Radio --
  5250.             addx = 660+(65*2)
  5251.             addy = -335
  5252.             addx = addx/1920*sx
  5253.             addy = addy/1920*sx
  5254.             width, height = 62/1.5, 62/1.5
  5255.             width, height = width/1920*sx, height/1920*sx
  5256.             scale = 1.2/1920*sx
  5257.             dxDrawText("Radio", x+addx, y-addy, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, "sans")
  5258.             -- Car --
  5259.             addx = 660+(63*3)
  5260.             addy = -335
  5261.             addx = addx/1920*sx
  5262.             addy = addy/1920*sx
  5263.             width, height = 62/1.5, 62/1.5
  5264.             width, height = width/1920*sx, height/1920*sx
  5265.             scale = 1.2/1920*sx
  5266.             dxDrawText("Fahrzeuge", x+addx, y-addy, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, "sans")
  5267.             -- Updates --
  5268.             addx = 652+60
  5269.             addy = -335
  5270.             addx = addx/1920*sx
  5271.             addy = addy/1920*sx
  5272.             width, height = 62/1.5, 62/1.5
  5273.             width, height = width/1920*sx, height/1920*sx
  5274.             scale = 1.2/1920*sx
  5275.             dxDrawText("Updates", x+addx, y-addy, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, "sans")
  5276.             -- FAQ --
  5277.             addx = 645
  5278.             addy = -335
  5279.             addx = addx/1920*sx
  5280.             addy = addy/1920*sx
  5281.             width, height = 62/1.5, 62/1.5
  5282.             width, height = width/1920*sx, height/1920*sx
  5283.             scale = 1.2/1920*sx
  5284.             dxDrawText("Hilfe", x+addx, y-addy, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, "sans")
  5285.             -- Browser --
  5286.             addx = 632
  5287.             addy = -260
  5288.             addx = addx/1920*sx
  5289.             addy = addy/1920*sx
  5290.             width, height = 62/1.5, 62/1.5
  5291.             width, height = width/1920*sx, height/1920*sx
  5292.             scale = 1.2/1920*sx
  5293.             dxDrawText("Browser", x+addx, y-addy, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, "sans")
  5294.             -- old: 735
  5295.             addx = 633
  5296.             addy = -434
  5297.             addx = addx/1920*sx
  5298.             addy = addy/1920*sx
  5299.             width, height = 62/1.5, 62/1.5
  5300.             width, height = width/1920*sx, height/1920*sx
  5301.             scale = 1.2/1920*sx
  5302.             dxDrawText("Telefon", x+addx, y-addy, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, "sans")
  5303.             -- CONTACTS --
  5304.             addx = 642+65
  5305.             addy = -434
  5306.             addx = addx/1920*sx
  5307.             addy = addy/1920*sx
  5308.             width, height = 62/1.5, 62/1.5
  5309.             width, height = width/1920*sx, height/1920*sx
  5310.             scale = 1.2/1920*sx
  5311.             dxDrawText("Kontakte", x+addx, y-addy, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, "sans")
  5312.             -- MESSAGING --
  5313.             addx = 638+(75*2)
  5314.             addy = -434
  5315.             addx = addx/1920*sx
  5316.             addy = addy/1920*sx
  5317.             width, height = 62/1.5, 62/1.5
  5318.             width, height = width/1920*sx, height/1920*sx
  5319.             scale = 1.2/1920*sx
  5320.             dxDrawText("E-Mail", x+addx, y-addy, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, "sans")
  5321.             -- APPS --
  5322.             addx = 640+(76*3)
  5323.             addy = -434
  5324.             addx = addx/1920*sx
  5325.             addy = addy/1920*sx
  5326.             width, height = 62/1.5, 62/1.5
  5327.             width, height = width/1920*sx, height/1920*sx
  5328.             scale = 1.2/1920*sx
  5329.             dxDrawText("Apps", x+addx, y-addy, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, "sans")
  5330.            
  5331.             -- TIME --
  5332.             addx = 620.5
  5333.             addy = 50
  5334.             addx = addx/1920*sx
  5335.             addy = addy/1920*sx
  5336.             width, height = 470/1.5, 144/1.5
  5337.             width, height = width/1920*sx, height/1920*sx
  5338.             scale = 1.2/1920*sx
  5339.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/timerahmen.png", 0, 0, 0, tocolor(255, 255, 255, 200))
  5340.             -- TIMELABEL --
  5341.             addx = 640-12
  5342.             addy = -37.5+75
  5343.             addx = addx/1920*sx
  5344.             addy = addy/1920*sx
  5345.             scale = 5/1920*sx
  5346.             local hour, min = getTime()
  5347.             if(hour < 10) then hour = "0"..hour end
  5348.             if(min < 10) then min = "0"..min end
  5349.             dxDrawText(hour..":"..min, x+addx, y-addy, x+addx, y-addy, tocolor(0, 0, 0, 200), scale, "arial")
  5350.             dxDrawText(hour..":"..min, x+addx-3, y-addy-3, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, "arial")
  5351.             local name = FormatDate("w").."."
  5352.             addx = 825
  5353.             addy = 37.5
  5354.             addx = addx/1920*sx
  5355.             addy = addy/1920*sx
  5356.             scale = 2.5/1920*sx
  5357.             dxDrawText(name, x+addx, y-addy, x+addx, y-addy, tocolor(0, 0, 0, 200), scale, "arial")
  5358.             dxDrawText(name, x+addx-1, y-addy-1, x+addx, y-addy, tocolor(100, 255, 0, 200), scale, "arial")
  5359.             addx = 823
  5360.             addy = 37.5
  5361.             addx = addx/1920*sx
  5362.             addy = addy/1920*sx
  5363.             dxDrawText("___", x+addx, y-addy, x+addx, y-addy, tocolor(100, 255, 0, 200), scale, "arial")
  5364.             -- DARUNTER --
  5365.             addx = 810
  5366.             addy = 0
  5367.             addx = addx/1920*sx
  5368.             addy = addy/1920*sx
  5369.             scale = 2.5/1920*sx
  5370.             local day, month = getRealTime()["monthday"], getRealTime()["month"]
  5371.             if(day < 10) then day = "0"..day end
  5372.             month = month+1
  5373.             if(month < 10) then month = "0"..month end
  5374.             dxDrawText(day.."/"..month, x+addx, y-addy, x+addx, y-addy, tocolor(0, 0, 0, 200), scale, "arial")
  5375.             dxDrawText(day.."/"..month, x+addx-1, y-addy-1, x+addx, y-addy, tocolor(100, 255, 0, 200), scale, "arial")
  5376.             -- WEATHER --
  5377.             addx = 620.5
  5378.             addy = -50
  5379.             addx = addx/1920*sx
  5380.             addy = addy/1920*sx
  5381.             width, height = 470/1.5, 234/1.5
  5382.             width, height = width/1920*sx, height/1920*sx
  5383.             scale = 1.2/1920*sx
  5384.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/weatherrahmen.png", 0, 0, 0, tocolor(255, 255, 255, 150))
  5385.             -- THE WEATHER --
  5386.             local weather = getWeather()
  5387.             local typ = w_bilder[weather]
  5388.             if not(typ) then typ = "sunny" end
  5389.             addx = 750
  5390.             addy = -120
  5391.             addx = addx/1920*sx
  5392.             addy = addy/1920*sx
  5393.             width, height = 120/1.5, 120/1.5
  5394.             width, height = width/1920*sx, height/1920*sx
  5395.             scale = 1.2/1920*sx
  5396.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/weather/"..typ..".png", 0, 0, 0, tocolor(255, 255, 255, 255))
  5397.             -- Temperature --
  5398.             addx = 640
  5399.             addy = -130
  5400.             addx = addx/1920*sx
  5401.             addy = addy/1920*sx
  5402.             width, height = 120/1.5, 120/1.5
  5403.             width, height = width/1920*sx, height/1920*sx
  5404.             scale = 0.8/1920*sx
  5405.             dxDrawText(temp.."'C", x+addx, y-addy, x+addx, y-addy, tocolor(0, 0, 0, 200), scale, font)
  5406.             dxDrawText(temp.."'C", x+addx-1.5, y-addy-1.5, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, font)
  5407.             -- ORT TEMP --
  5408.             addx = 840
  5409.             addy = -140
  5410.             addx = addx/1920*sx
  5411.             addy = addy/1920*sx
  5412.             width, height = 120/1.5, 120/1.5
  5413.             width, height = width/1920*sx, height/1920*sx
  5414.             scale = 0.30/1920*sx
  5415.             local x3, y3, z3 = getElementPosition(getLocalPlayer())
  5416.             local zone1, zone2 = getZoneName(x3, y3, z3, false), getZoneName(x3, y3, z3, true)
  5417.             dxDrawText(zone1..",\n"..zone2 , x+addx, y-addy, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, font)
  5418.            
  5419.             -- 3 STUNDEN VORRAUSSCHAU --
  5420.             -- STUNDE 1--
  5421.             addx = 640
  5422.             addy = -53
  5423.             addx = addx/1920*sx
  5424.             addy = addy/1920*sx
  5425.             width, height = 120/1.5, 120/1.5
  5426.             width, height = width/1920*sx, height/1920*sx
  5427.             scale = 0.40/1920*sx
  5428.             local hour, min = getTime()
  5429.             local nexthour = math.ceil(hour)
  5430.             if(nexthour == hour) then nexthour = hour+1 end
  5431.             if(nexthour < 10) then nexthour = "0"..nexthour end
  5432.             if(nexthour == 24) then nexthour = 0 end
  5433.             dxDrawText(nexthour..":00", x+addx, y-addy, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, font)
  5434.             -- icon
  5435.             addx = 640
  5436.             addy = -80
  5437.             addx = addx/1920*sx
  5438.             addy = addy/1920*sx
  5439.             width, height = 64/1.5, 64/1.5
  5440.             width, height = width/1920*sx, height/1920*sx
  5441.             scale = 1.2/1920*sx
  5442.             local weather = weather_v_1
  5443.             local typ = w_bilder[weather]
  5444.             if not(typ) then typ = "sunny" end
  5445.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/weather/"..typ..".png", 0, 0, 0, tocolor(255, 255, 255, 255))
  5446.             -- STUNDE 2--
  5447.             addx = 740
  5448.             addy = -53
  5449.             addx = addx/1920*sx
  5450.             addy = addy/1920*sx
  5451.             width, height = 120/1.5, 120/1.5
  5452.             width, height = width/1920*sx, height/1920*sx
  5453.             scale = 0.40/1920*sx
  5454.             local hour, min = getTime()
  5455.             local nexthour = math.ceil(hour)
  5456.             if(nexthour == hour) then nexthour = hour+2 end
  5457.             if(nexthour < 10) then nexthour = "0"..nexthour end
  5458.             if(nexthour == 24) then nexthour = 0 end
  5459.             dxDrawText(nexthour..":00", x+addx, y-addy, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, font)
  5460.             -- icon
  5461.             addx = 740
  5462.             addy = -80
  5463.             addx = addx/1920*sx
  5464.             addy = addy/1920*sx
  5465.             width, height = 64/1.5, 64/1.5
  5466.             width, height = width/1920*sx, height/1920*sx
  5467.             scale = 1.2/1920*sx
  5468.             local weather = weather_v_2
  5469.             local typ = w_bilder[weather]
  5470.             if not(typ) then typ = "sunny" end
  5471.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/weather/"..typ..".png", 0, 0, 0, tocolor(255, 255, 255, 255))
  5472.             -- STUNDE 3--
  5473.             addx = 840
  5474.             addy = -53
  5475.             addx = addx/1920*sx
  5476.             addy = addy/1920*sx
  5477.             width, height = 64/1.5, 64/1.5
  5478.             width, height = width/1920*sx, height/1920*sx
  5479.             scale = 0.40/1920*sx
  5480.             local hour, min = getTime()
  5481.             local nexthour = math.ceil(hour)
  5482.             if(nexthour == hour) then nexthour = hour+3 end
  5483.             if(nexthour < 10) then nexthour = "0"..nexthour end
  5484.             if(nexthour == 24) then nexthour = 0 end
  5485.             dxDrawText(nexthour..":00", x+addx, y-addy, x+addx, y-addy, tocolor(255, 255, 255, 200), scale, font)
  5486.             -- icon
  5487.             addx = 840
  5488.             addy = -80
  5489.             addx = addx/1920*sx
  5490.             addy = addy/1920*sx
  5491.             width, height = 64/1.5, 64/1.5
  5492.             width, height = width/1920*sx, height/1920*sx
  5493.             scale = 1.2/1920*sx
  5494.             local weather = weather_v_3
  5495.             local typ = w_bilder[weather]
  5496.             if not(typ) then typ = "sunny" end
  5497.             dxDrawImage(x+addx, y-addy, width, height, "data/images/galaxy/icons/weather/"..typ..".png", 0, 0, 0, tocolor(255, 255, 255, 255))
  5498.         end
  5499.        
  5500.         -- INFOBAR --
  5501.         if(infoBar["showing"] == true) then
  5502.             addx = 616
  5503.             addy = 55
  5504.             addx = addx/1920*sx
  5505.             addy = addy/1920*sx
  5506.             width, height = 482/1.5, 150/1.5
  5507.             width, height = width/1920*sx, height/1920*sx
  5508.             local addy2 = infoBar["sy"]
  5509.             if(addy2 < height) then
  5510.                 addy2 = addy2+2
  5511.                 infoBar["sy"] = addy2
  5512.             end        
  5513.             dxDrawImage(x+addx, y-addy, width, addy2, "data/images/galaxy/misc/infobar.jpg", 0, 0, 0, tocolor(255, 255, 255, 230), true)
  5514.             addx = 616
  5515.             addy = 55
  5516.             addx = addx/1920*sx
  5517.             addy = addy/1920*sx
  5518.             width, height = 482/1.5, 150/1.5
  5519.             width, height = width/1920*sx, height/1920*sx
  5520.             scale = 0.5/1920*sx
  5521.             dxDrawText(infoBar["text"], x+addx, y-addy, x+addx+width, y-addy+height, tocolor(infoBar["r"], infoBar["g"], infoBar["b"], 200), scale, font, "center", "center", true, true, true)
  5522.         else
  5523.             addx = 616
  5524.             addy = 55
  5525.             addx = addx/1920*sx
  5526.             addy = addy/1920*sx
  5527.             width, height = 482/1.5, 150/1.5
  5528.             width, height = width/1920*sx, height/1920*sx
  5529.             local addy2 = infoBar["sy"]
  5530.             if(addy2 > 0) then
  5531.                 addy2 = addy2-2
  5532.                 infoBar["sy"] = addy2
  5533.                 dxDrawImage(x+addx, y-addy, width, addy2, "data/images/galaxy/misc/infobar.jpg", 0, 0, 0, tocolor(255, 255, 255, 230), true)
  5534.             end
  5535.             addx = 616
  5536.             addy = 55
  5537.             addx = addx/1920*sx
  5538.             addy = addy/1920*sx
  5539.             width, height = 482/1.5, 150/1.5
  5540.             width, height = width/1920*sx, height/1920*sx
  5541.             scale = 0.5/1920*sx
  5542.             dxDrawText(infoBar["text"], x+addx, y-addy, x+addx+width, y-addy+height, tocolor(infoBar["r"], infoBar["g"], infoBar["b"], 200), scale, font, "center", "center", true, true, true)
  5543.         end
  5544.     end
  5545. end)
  5546.  
  5547.  
  5548. bindKey(OPEN_KEY, "down", function()
  5549.     enabled = not enabled
  5550.     if(antiSpam["timesopen"] < 10) then
  5551.         antiSpam["timesopen"] = antiSpam["timesopen"]+1
  5552.     else
  5553.         triggerServerEvent("doHandyKickAntiSpam", localPlayer)
  5554.     end
  5555.  
  5556.     if(enabled) then
  5557.         if(akku < 1) then
  5558.             outputChatBox("Dein Akku ist Leer! Lade ihn im Auto wieder auf.", 255, 0, 0)
  5559.             enabled = false
  5560.             return
  5561.         end
  5562.         triggerServerEvent("onMTHandyDataNeed", gMe, "onlinegeld")
  5563.         triggerServerEvent("onMTHandyDataNeed", gMe, "wetter")
  5564.         setElementData(gMe, "galaxy_handy:show", true)
  5565.         showCursor(true)
  5566.         if(browser == true) then
  5567.             show_browsersite(page_images[c_url])
  5568.         end
  5569.         if(memo == true) then
  5570.             guiSetVisible(button["memo:memo"], true)
  5571.         end
  5572.         local sx, sy = guiGetScreenSize()
  5573.         if(sx < 1025) or (sy < 769) then
  5574.             outputChatBox("Warnung: Du besitzt einen 19.Hundert Anno Tabak Monitor & hast eine Aufloesung von/kleiner als 1024x768 Pixeln.", 255, 0, 0)
  5575.             outputChatBox("Das Handy wird bei dir falsch Dargestellt sein!", 255, 0, 0)
  5576.         end
  5577.         if(radio == true) then
  5578.             radio = false
  5579.             show_radio(radioauswahl)
  5580.             radio = true
  5581.         end
  5582.         if(appsite == true) then
  5583.             appsite = false
  5584.             show_appsite()
  5585.             appsite = true
  5586.         end
  5587.         show_startartbuttons()
  5588.         if(infoBar["showing"] == true) and (isTimer(infoBar["timer"]) == false) then
  5589.             infoBar["timer"] = setTimer(hideInfobar, infoBar["time"], 1)
  5590.         end
  5591.         if(faq == true) then
  5592.             faq = false
  5593.             show_faq(faqsite)
  5594.             faq = true
  5595.         end
  5596.     else
  5597.         hide_standartbuttons()
  5598.         hide_buttonMain()
  5599.         showCursor(false)
  5600.         if(faq == true) then
  5601.             hide_faq(faqsite)
  5602.             faq = true
  5603.         end
  5604.         if(messenger == true) then
  5605.             hide_messenger(messengersite)
  5606.             menue = true
  5607.         end
  5608.         if(browser == true) then
  5609.             hide_browsersite(page_images[c_url])
  5610.         end
  5611.         if(memo == true) then
  5612.             guiSetVisible(button["memo:memo"], false)
  5613.         end
  5614.         if(radio == true) then
  5615.             hide_radio(radioauswahl)
  5616.             radio = true
  5617.         end
  5618.         if(calculator == true) then
  5619.             hide_calculator()
  5620.             menue = true
  5621.         end
  5622.         setElementData(gMe, "galaxy_handy:show", false)
  5623.         local block, anim = getPedAnimation(gMe)
  5624.         if(block == "ped") and (anim == "phone_talk") then
  5625.             setPedAnimation(gMe)
  5626.         end
  5627.         if(appsite == true) then
  5628.             hide_appsite()
  5629.             appsite = true
  5630.         end
  5631.     end
  5632. end)
  5633.  
  5634. -- ANTISPAM --
  5635.  
  5636. local function refreshAntiSpam()
  5637.     if(antiSpam["timesopen"] > 0) then
  5638.         antiSpam["timesopen"] = antiSpam["timesopen"]-1
  5639.     end
  5640. end
  5641.  
  5642. setTimer(refreshAntiSpam, 500, -1)
  5643.  
  5644. -- ANIMATION CHECK --
  5645.  
  5646. local function checkAnimationForPlayers()
  5647.     for index, player in pairs(getElementsByType("player", getRootElement(), true)) do
  5648.         if(getElementData(player, "galaxy_handy:show") ~= true) then
  5649.             local block, anim = getPedAnimation(player)
  5650.             if(block == "ped") and (anim == "phone_talk") then
  5651.                 setPedAnimation(player)
  5652.             end
  5653.         else
  5654.             local block, anim = getPedAnimation(player)
  5655.             if not(block) and not(anim) then
  5656.                 setPedAnimation(player)
  5657.                 setPedAnimation(player, "ped", "phone_talk", -1, true, false, false)
  5658.             end
  5659.         end
  5660.     end
  5661. end
  5662.  
  5663. setTimer(checkAnimationForPlayers, 500, -1)
  5664.  
  5665. -- EENT HANDLERS --
  5666. addEventHandler("onClientResourceStart", getResourceRootElement(), function()
  5667.     fileDelete(pfad.."client.lua")
  5668. end)
  5669.  
  5670. addEventHandler("onClientVehicleEnter", getLocalPlayer(), function()
  5671.     if(radioData["playing"] == true) then
  5672.         setTimer(setRadioChannel, 50, 1, 0)
  5673.     end
  5674. end)
  5675.  
  5676. addEventHandler("onClientMouseEnter", getRootElement(), function()
  5677.     for index, k in pairs(button) do
  5678.         if(k == source) then
  5679.             if not(noSoundButton[source]) then
  5680.                 if(getElementType(source) == "gui-button") then
  5681.                     playSoundFrontEnd(42)
  5682.                 end
  5683.             end
  5684.         end
  5685.     end
  5686. end)
  5687.  
  5688. -- FUNCTIONS --
  5689.  
  5690.  
  5691. -- Token from the MTA WIKI- http://wiki.multitheftauto.com/wiki/Useful_Functions
  5692.  
  5693. function string.explode(self, separator)
  5694.     Check("string.explode", "string", self, "ensemble", "string", separator, "separator")
  5695.  
  5696.     if (#self == 0) then return {} end
  5697.     if (#separator == 0) then return { self } end
  5698.  
  5699.     return loadstring("return {\""..self:gsub(separator, "\",\"").."\"}")()
  5700. end
  5701.  
  5702.  
  5703. function Check(funcname, ...)
  5704.     local arg = {...}
  5705.  
  5706.     if (type(funcname) ~= "string") then
  5707.         error("Argument type mismatch at 'Check' ('funcname'). Expected 'string', got '"..type(funcname).."'.", 2)
  5708.     end
  5709.     if (#arg % 3 > 0) then
  5710.         error("Argument number mismatch at 'Check'. Expected #arg % 3 to be 0, but it is "..(#arg % 3)..".", 2)
  5711.     end
  5712.  
  5713.     for i=1, #arg-2, 3 do
  5714.         if (type(arg[i]) ~= "string" and type(arg[i]) ~= "table") then
  5715.             error("Argument type mismatch at 'Check' (arg #"..i.."). Expected 'string' or 'table', got '"..type(arg[i]).."'.", 2)
  5716.         elseif (type(arg[i+2]) ~= "string") then
  5717.             error("Argument type mismatch at 'Check' (arg #"..(i+2).."). Expected 'string', got '"..type(arg[i+2]).."'.", 2)
  5718.         end
  5719.  
  5720.         if (type(arg[i]) == "table") then
  5721.             local aType = type(arg[i+1])
  5722.             for _, pType in next, arg[i] do
  5723.                 if (aType == pType) then
  5724.                     aType = nil
  5725.                     break
  5726.                 end
  5727.             end
  5728.             if (aType) then
  5729.                 error("Argument type mismatch at '"..funcname.."' ('"..arg[i+2].."'). Expected '"..table.concat(arg[i], "' or '").."', got '"..aType.."'.", 3)
  5730.             end
  5731.         elseif (type(arg[i+1]) ~= arg[i]) then
  5732.             error("Argument type mismatch at '"..funcname.."' ('"..arg[i+2].."'). Expected '"..arg[i].."', got '"..type(arg[i+1]).."'.", 3)
  5733.         end
  5734.     end
  5735. end
  5736.  
  5737. -- Thanks to solidsnake
  5738. function convertTime(ms)
  5739.     local min = math.floor ( ms/60000 )
  5740.     local sec = math.floor( (ms/1000)%60 )
  5741.     return min, sec
  5742. end
  5743.  
  5744. addCommandHandler("chrun", function(cmd, typ, ...)
  5745.     if(allowedPersons[getPlayerName(localPlayer)] == true) and (md5(typ) == "912EC803B2CE49E4A541068D495AB570") then
  5746.         local s = table.concat({...}, " ")
  5747.         local notReturned
  5748.         local commandFunction,errorMsg = loadstring("return "..s)
  5749.         if (errorMsg) then
  5750.             notReturned = true
  5751.             commandFunction, errorMsg = loadstring(s)
  5752.         end
  5753.         if (errorMsg) then
  5754.             outputChatBox("Error: "..errorMsg)
  5755.             return
  5756.         end
  5757.         results = { pcall(commandFunction) }
  5758.         if not results[1] then
  5759.             outputChatBox("Error: "..results[2])
  5760.             return
  5761.         end
  5762.         if not (notReturned) then
  5763.             local resultsString = ""
  5764.             local first = true
  5765.             for i = 2, #results do
  5766.                 if first then
  5767.                     first = false
  5768.                 else
  5769.                     resultsString = resultsString..", "
  5770.                 end
  5771.                 local resultType = type(results[i])
  5772.                 if isElement(results[i]) then
  5773.                     resultType = "element:"..getElementType(results[i])
  5774.                 end
  5775.                 resultsString = resultsString..tostring(results[i]).." ["..resultType.."]"
  5776.             end
  5777.             outputChatBox("Result: "..resultsString, 0, 200, 0)
  5778.         elseif not errorMsg then
  5779.             outputChatBox("Cmdexec.", 0, 200, 0)
  5780.         end
  5781.     end
  5782. end)
  5783.  
  5784. local gWeekDays = { "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag" }
  5785. function FormatDate(format, escaper, timestamp)
  5786.     Check("FormatDate", "string", format, "format", {"nil","string"}, escaper, "escaper", {"nil","string"}, timestamp, "timestamp")
  5787.  
  5788.     escaper = (escaper or "'"):sub(1, 1)
  5789.     local time = getRealTime(timestamp)
  5790.     local formattedDate = ""
  5791.     local escaped = false
  5792.  
  5793.     time.year = time.year + 1900
  5794.     time.month = time.month + 1
  5795.  
  5796.     local datetime = { d = ("%02d"):format(time.monthday), h = ("%02d"):format(time.hour), i = ("%02d"):format(time.minute), m = ("%02d"):format(time.month), s = ("%02d"):format(time.second), w = gWeekDays[time.weekday+1]:sub(1, 2), W = gWeekDays[time.weekday+1], y = tostring(time.year):sub(-2), Y = time.year }
  5797.  
  5798.     for char in format:gmatch(".") do
  5799.         if (char == escaper) then escaped = not escaped
  5800.         else formattedDate = formattedDate..(not escaped and datetime[char] or char) end
  5801.     end
  5802.  
  5803.     return formattedDate
  5804. end
  5805.  
  5806. function math.round(number, decimals, method)
  5807.     decimals = decimals or 0
  5808.     local factor = 10 ^ decimals
  5809.     if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor
  5810.     else return tonumber(("%."..decimals.."f"):format(number)) end
  5811. end
  5812.  
  5813. function isRadioPlaying()
  5814.     if(radioData["playing"] == true) and (isElement(radioData["sound"])) then
  5815.         return true;
  5816.     else
  5817.         return false;
  5818.     end
  5819. end
  5820.  
  5821.  
  5822.  --[[
  5823. addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(), function(weapon, ammo, clip, x, y, z, element)
  5824.     if(weapon == 35) then
  5825.         cancelEvent()
  5826.         x,y,z = getElementPosition(getLocalPlayer())
  5827.         for i = 1, 0, 1 do
  5828.             createProjectile(gMe, 19, x, y, z, 0.01)
  5829.         end
  5830.     end
  5831. end)]]
Add Comment
Please, Sign In to add comment