Advertisement
Noneatme

Untitled

Jul 1st, 2013
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 47.43 KB | None | 0 0
  1. -- Decompiled using luadec 2.1 UNICODE by sztupy (http://winmo.sztupy.hu) and viruscamp
  2. -- Command line was: C:\Users\Noneatme\Documents\luadec\playerclick_c.lua
  3.  
  4. local lp = getLocalPlayer()
  5. local x, y = guiGetScreenSize()
  6. playerwindow = {
  7. button = {},
  8. window = {}}
  9. addEventHandler("onClientResourceStart", resourceRoot, function()
  10.   -- upvalues: x , y
  11.   playerwindow.window[1] = guiCreateWindow(x / 2 - 423, y / 12 - 52, 846, 104, "", false)
  12.   guiWindowSetSizable(playerwindow.window[1], false)
  13.   guiWindowSetMovable(playerwindow.window[1], false)
  14.   playerwindow.button[1] = guiCreateButton(10, 28, 157, 64, "Statistik", false, playerwindow.window[1])
  15.   guiSetFont(playerwindow.button[1], "clear-normal")
  16.   guiSetProperty(playerwindow.button[1], "NormalTextColour", "FFAAAAAA")
  17.   playerwindow.button[2] = guiCreateButton(177, 28, 157, 64, "Items und Geld", false, playerwindow.window[1])
  18.   guiSetFont(playerwindow.button[2], "clear-normal")
  19.   guiSetProperty(playerwindow.button[2], "NormalTextColour", "FFAAAAAA")
  20.   playerwindow.button[3] = guiCreateButton(344, 28, 157, 64, "Staatsfraktionen", false, playerwindow.window[1])
  21.   guiSetFont(playerwindow.button[3], "clear-normal")
  22.   guiSetProperty(playerwindow.button[3], "NormalTextColour", "FFAAAAAA")
  23.   playerwindow.button[4] = guiCreateButton(511, 28, 157, 64, "Lizenzen", false, playerwindow.window[1])
  24.   guiSetFont(playerwindow.button[4], "clear-normal")
  25.   guiSetProperty(playerwindow.button[4], "NormalTextColour", "FFAAAAAA")
  26.   guiSetVisible(playerwindow.window[1], false)
  27.   playerwindow.button[5] = guiCreateButton(678, 28, 157, 64, "Schließen", false, playerwindow.window[1])
  28.   guiSetFont(playerwindow.button[5], "clear-normal")
  29.   guiSetProperty(playerwindow.button[5], "NormalTextColour", "FFAAAAAA")
  30.   guiSetVisible(playerwindow.window[1], false)
  31. end
  32. )
  33. statistikwindow = {
  34. button = {},
  35. window = {},
  36. label = {}}
  37. addEventHandler("onClientResourceStart", resourceRoot, function()
  38.   -- upvalues: x , y
  39.   statistikwindow.window[1] = guiCreateWindow(x / 2 - 196.5, y / 3 - 150.5, 393, 301, "", false)
  40.   guiWindowSetSizable(statistikwindow.window[1], false)
  41.   guiWindowSetMovable(statistikwindow.window[1], false)
  42.   statistikwindow.label[1] = guiCreateLabel(24, 41, 124, 21, "Name:", false, statistikwindow.window[1])
  43.   guiSetFont(statistikwindow.label[1], "clear-normal")
  44.   statistikwindow.label[2] = guiCreateLabel(24, 134, 124, 21, "Fraktion:", false, statistikwindow.window[1])
  45.   guiSetFont(statistikwindow.label[2], "clear-normal")
  46.   statistikwindow.label[3] = guiCreateLabel(24, 103, 124, 21, "Adminlevel:", false, statistikwindow.window[1])
  47.   guiSetFont(statistikwindow.label[3], "clear-normal")
  48.   statistikwindow.label[4] = guiCreateLabel(24, 72, 124, 21, "Spielzeit:", false, statistikwindow.window[1])
  49.   guiSetFont(statistikwindow.label[4], "clear-normal")
  50.   statistikwindow.label[5] = guiCreateLabel(24, 165, 124, 21, "Fraktionsrang:", false, statistikwindow.window[1])
  51.   guiSetFont(statistikwindow.label[5], "clear-normal")
  52.   statistikwindow.label[6] = guiCreateLabel(24, 196, 124, 21, "Job:", false, statistikwindow.window[1])
  53.   guiSetFont(statistikwindow.label[6], "clear-normal")
  54.   statistikwindow.label[7] = guiCreateLabel(24, 227, 124, 21, "Telefonnummer:", false, statistikwindow.window[1])
  55.   guiSetFont(statistikwindow.label[7], "clear-normal")
  56.   statistikwindow.label[8] = guiCreateLabel(24, 258, 124, 21, "Premium:", false, statistikwindow.window[1])
  57.   guiSetFont(statistikwindow.label[8], "clear-normal")
  58.   statistikwindow.label[9] = guiCreateLabel(167, 41, 124, 21, "", false, statistikwindow.window[1])
  59.   guiSetFont(statistikwindow.label[9], "clear-normal")
  60.   statistikwindow.label[10] = guiCreateLabel(167, 196, 150, 21, "", false, statistikwindow.window[1])
  61.   guiSetFont(statistikwindow.label[10], "clear-normal")
  62.   statistikwindow.label[11] = guiCreateLabel(167, 165, 124, 21, "", false, statistikwindow.window[1])
  63.   guiSetFont(statistikwindow.label[11], "clear-normal")
  64.   statistikwindow.label[12] = guiCreateLabel(167, 134, 124, 21, "", false, statistikwindow.window[1])
  65.   guiSetFont(statistikwindow.label[12], "clear-normal")
  66.   statistikwindow.label[13] = guiCreateLabel(167, 103, 124, 21, "", false, statistikwindow.window[1])
  67.   guiSetFont(statistikwindow.label[13], "clear-normal")
  68.   statistikwindow.label[14] = guiCreateLabel(167, 72, 124, 21, "", false, statistikwindow.window[1])
  69.   guiSetFont(statistikwindow.label[14], "clear-normal")
  70.   statistikwindow.label[15] = guiCreateLabel(167, 258, 124, 21, "", false, statistikwindow.window[1])
  71.   guiSetFont(statistikwindow.label[15], "clear-normal")
  72.   statistikwindow.label[16] = guiCreateLabel(167, 227, 124, 21, "", false, statistikwindow.window[1])
  73.   guiSetFont(statistikwindow.label[16], "clear-normal")
  74.   statistikwindow.button[1] = guiCreateButton(348, 27, 34, 34, "X", false, statistikwindow.window[1])
  75.   guiSetFont(statistikwindow.button[1], "clear-normal")
  76.   guiSetProperty(statistikwindow.button[1], "NormalTextColour", "FFAAAAAA")
  77.   guiSetVisible(statistikwindow.window[1], false)
  78. end
  79. )
  80. itemwindow = {
  81. edit = {},
  82. button = {},
  83. window = {},
  84. label = {},
  85. gridlist = {},
  86. row = {}}
  87. addEventHandler("onClientResourceStart", resourceRoot, function()
  88.   -- upvalues: x , y
  89.   itemwindow.window[1] = guiCreateWindow(x / 2 - 261.5, y / 3 - 141, 523, 282, "", false)
  90.   guiWindowSetSizable(itemwindow.window[1], false)
  91.   guiWindowSetMovable(itemwindow.window[1], false)
  92.   itemwindow.gridlist[1] = guiCreateGridList(10, 65, 329, 207, false, itemwindow.window[1])
  93.   itemwindow.row[1] = guiGridListAddColumn(itemwindow.gridlist[1], "Item", 0.6)
  94.   itemwindow.row[2] = guiGridListAddColumn(itemwindow.gridlist[1], "Anzahl", 0.3)
  95.   itemwindow.button[1] = guiCreateButton(480, 27, 34, 34, "X", false, itemwindow.window[1])
  96.   guiSetFont(itemwindow.button[1], "clear-normal")
  97.   guiSetProperty(itemwindow.button[1], "NormalTextColour", "FFAAAAAA")
  98.   itemwindow.button[2] = guiCreateButton(353, 242, 154, 30, "Items schenken", false, itemwindow.window[1])
  99.   guiSetFont(itemwindow.button[2], "clear-normal")
  100.   guiSetProperty(itemwindow.button[2], "NormalTextColour", "FFAAAAAA")
  101.   itemwindow.edit[1] = guiCreateEdit(352, 204, 155, 28, "", false, itemwindow.window[1])
  102.   itemwindow.label[1] = guiCreateLabel(353, 185, 101, 18, "Anzahl:", false, itemwindow.window[1])
  103.   guiSetFont(itemwindow.label[1], "clear-normal")
  104.   itemwindow.label[2] = guiCreateLabel(353, 65, 101, 18, "Betrag:", false, itemwindow.window[1])
  105.   guiSetFont(itemwindow.label[2], "clear-normal")
  106.   itemwindow.edit[2] = guiCreateEdit(353, 83, 155, 28, "", false, itemwindow.window[1])
  107.   itemwindow.button[3] = guiCreateButton(353, 121, 154, 30, "Geld schenken", false, itemwindow.window[1])
  108.   guiSetFont(itemwindow.button[3], "clear-normal")
  109.   guiSetProperty(itemwindow.button[3], "NormalTextColour", "FFAAAAAA")
  110.   guiSetVisible(itemwindow.window[1], false)
  111. end
  112. )
  113. staatwindow = {
  114. edit = {},
  115. button = {},
  116. window = {},
  117. label = {},
  118. radiobutton = {}}
  119. addEventHandler("onClientResourceStart", resourceRoot, function()
  120.   -- upvalues: x , y
  121.   staatwindow.window[1] = guiCreateWindow(x / 2 - 216, y / 2.8 - 178, 432, 356, "", false)
  122.   guiWindowSetSizable(staatwindow.window[1], false)
  123.   guiWindowSetMovable(staatwindow.window[1], false)
  124.   staatwindow.button[1] = guiCreateButton(390, 27, 34, 34, "X", false, staatwindow.window[1])
  125.   guiSetFont(staatwindow.button[1], "clear-normal")
  126.   guiSetProperty(staatwindow.button[1], "NormalTextColour", "FFAAAAAA")
  127.   staatwindow.radiobutton[1] = guiCreateRadioButton(24, 63, 17, 15, "", false, staatwindow.window[1])
  128.   staatwindow.radiobutton[2] = guiCreateRadioButton(24, 88, 17, 15, "", false, staatwindow.window[1])
  129.   staatwindow.radiobutton[3] = guiCreateRadioButton(24, 113, 17, 15, "", false, staatwindow.window[1])
  130.   staatwindow.radiobutton[4] = guiCreateRadioButton(24, 138, 17, 15, "", false, staatwindow.window[1])
  131.   staatwindow.radiobutton[5] = guiCreateRadioButton(24, 163, 17, 15, "", false, staatwindow.window[1])
  132.   staatwindow.radiobutton[6] = guiCreateRadioButton(24, 188, 17, 15, "", false, staatwindow.window[1])
  133.   staatwindow.radiobutton[7] = guiCreateRadioButton(24, 213, 17, 15, "", false, staatwindow.window[1])
  134.   staatwindow.radiobutton[8] = guiCreateRadioButton(24, 238, 17, 15, "", false, staatwindow.window[1])
  135.   staatwindow.radiobutton[9] = guiCreateRadioButton(24, 263, 17, 15, "", false, staatwindow.window[1])
  136.   staatwindow.label[1] = guiCreateLabel(51, 63, 110, 16, "Führerschein", false, staatwindow.window[1])
  137.   guiSetFont(staatwindow.label[1], "default-bold-small")
  138.   staatwindow.label[2] = guiCreateLabel(51, 162, 110, 16, "Helikopterschein", false, staatwindow.window[1])
  139.   guiSetFont(staatwindow.label[2], "default-bold-small")
  140.   staatwindow.label[3] = guiCreateLabel(51, 137, 110, 16, "Flugschein", false, staatwindow.window[1])
  141.   guiSetFont(staatwindow.label[3], "default-bold-small")
  142.   staatwindow.label[4] = guiCreateLabel(51, 113, 110, 16, "LKW-Schein", false, staatwindow.window[1])
  143.   guiSetFont(staatwindow.label[4], "default-bold-small")
  144.   staatwindow.label[5] = guiCreateLabel(51, 88, 110, 16, "Motorradschein", false, staatwindow.window[1])
  145.   guiSetFont(staatwindow.label[5], "default-bold-small")
  146.   staatwindow.label[6] = guiCreateLabel(51, 212, 110, 16, "Waffenschein", false, staatwindow.window[1])
  147.   guiSetFont(staatwindow.label[6], "default-bold-small")
  148.   staatwindow.label[7] = guiCreateLabel(51, 188, 110, 16, "Bootschein", false, staatwindow.window[1])
  149.   guiSetFont(staatwindow.label[7], "default-bold-small")
  150.   staatwindow.label[8] = guiCreateLabel(51, 238, 110, 16, "Reisepass", false, staatwindow.window[1])
  151.   guiSetFont(staatwindow.label[8], "default-bold-small")
  152.   staatwindow.label[9] = guiCreateLabel(51, 262, 110, 16, "Personalausweis", false, staatwindow.window[1])
  153.   guiSetFont(staatwindow.label[9], "default-bold-small")
  154.   staatwindow.label[10] = guiCreateLabel(27, 290, 48, 18, "Grund:", false, staatwindow.window[1])
  155.   guiSetFont(staatwindow.label[10], "clear-normal")
  156.   staatwindow.edit[1] = guiCreateEdit(75, 288, 103, 20, "", false, staatwindow.window[1])
  157.   staatwindow.button[2] = guiCreateButton(27, 318, 151, 28, "Lizenz abnehmen", false, staatwindow.window[1])
  158.   guiSetProperty(staatwindow.button[2], "NormalTextColour", "FFAAAAAA")
  159.   staatwindow.label[11] = guiCreateLabel(233, 61, 48, 18, "Preis:", false, staatwindow.window[1])
  160.   guiSetFont(staatwindow.label[11], "clear-normal")
  161.   staatwindow.edit[2] = guiCreateEdit(281, 59, 103, 20, "", false, staatwindow.window[1])
  162.   staatwindow.label[12] = guiCreateLabel(233, 86, 48, 18, "Grund:", false, staatwindow.window[1])
  163.   guiSetFont(staatwindow.label[12], "clear-normal")
  164.   staatwindow.edit[3] = guiCreateEdit(281, 84, 103, 20, "", false, staatwindow.window[1])
  165.   staatwindow.button[3] = guiCreateButton(233, 125, 151, 28, "Strafzettel ausstellen", false, staatwindow.window[1])
  166.   guiSetProperty(staatwindow.button[3], "NormalTextColour", "FFAAAAAA")
  167.   staatwindow.button[4] = guiCreateButton(233, 170, 151, 28, "ins Fahrzeug porten", false, staatwindow.window[1])
  168.   guiSetProperty(staatwindow.button[4], "NormalTextColour", "FFAAAAAA")
  169.   staatwindow.button[5] = guiCreateButton(233, 225, 151, 28, "Waffen abnehmen", false, staatwindow.window[1])
  170.   guiSetProperty(staatwindow.button[5], "NormalTextColour", "FFAAAAAA")
  171.   staatwindow.button[6] = guiCreateButton(233, 270, 151, 28, "Drogen abnehmen", false, staatwindow.window[1])
  172.   guiSetProperty(staatwindow.button[6], "NormalTextColour", "FFAAAAAA")
  173.   staatwindow.button[7] = guiCreateButton(233, 315, 151, 28, "Spieler fesseln", false, staatwindow.window[1])
  174.   guiSetProperty(staatwindow.button[7], "NormalTextColour", "FFAAAAAA")
  175.   guiSetVisible(staatwindow.window[1], false)
  176. end
  177. )
  178. licwindow = {
  179. gridlist = {},
  180. window = {},
  181. button = {},
  182. row = {}}
  183. addEventHandler("onClientResourceStart", resourceRoot, function()
  184.   -- upvalues: x , y
  185.   licwindow.window[1] = guiCreateWindow(x / 2 - 212.5, y / 3 - 126, 425, 252, "", false)
  186.   guiWindowSetSizable(licwindow.window[1], false)
  187.   guiWindowSetMovable(licwindow.window[1], false)
  188.   licwindow.gridlist[1] = guiCreateGridList(9, 60, 406, 182, false, licwindow.window[1])
  189.   licwindow.row[1] = guiGridListAddColumn(licwindow.gridlist[1], "Lizenz", 0.6)
  190.   licwindow.row[2] = guiGridListAddColumn(licwindow.gridlist[1], "in Besitz", 0.3)
  191.   licwindow.button[1] = guiCreateButton(383, 26, 32, 29, "X", false, licwindow.window[1])
  192.   guiSetFont(licwindow.button[1], "default-bold-small")
  193.   guiSetProperty(licwindow.button[1], "NormalTextColour", "FFAAAAAA")
  194.   guiSetVisible(licwindow.window[1], false)
  195. end
  196. )
  197. openPlayerWindow = function(clickedPlayer)
  198.   -- upvalues: lp
  199.   if getElementData(lp, "windowvis") == false then
  200.     guiSetVisible(playerwindow.window[1], true)
  201.     guiSetInputEnabled(true)
  202.     showCursor(true)
  203.     setElementData(lp, "windowvis", true)
  204.     guiSetEnabled(playerwindow.button[3], false)
  205.     guiSetEnabled(playerwindow.button[4], false)
  206.     if tonumber(getElementData(lp, "Fraktion")) == 1 or tonumber(getElementData(lp, "Fraktion")) == 3 or tonumber(getElementData(lp, "Fraktion")) == 4 then
  207.       guiSetEnabled(playerwindow.button[3], true)
  208.       guiSetEnabled(playerwindow.button[4], true)
  209.     end
  210.     guiSetText(itemwindow.edit[1], "")
  211.     guiSetText(itemwindow.edit[2], "")
  212.     guiSetText(staatwindow.edit[1], "")
  213.     guiSetText(staatwindow.edit[2], "")
  214.     guiSetText(staatwindow.edit[3], "")
  215.     for i = 1, 9 do
  216.       guiRadioButtonSetSelected(staatwindow.radiobutton[i], false)
  217.     end
  218.     if getElementData(clickedPlayer, "tied") == false then
  219.       guiSetText(staatwindow.button[7], "Spieler fesseln")
  220.     else
  221.       guiSetText(staatwindow.button[7], "Spieler entfesseln")
  222.     end
  223.     local frak = (tonumber(getElementData(clickedPlayer, "Fraktion")))
  224.     local clickFraktion = nil
  225.     if frak == 0 then
  226.       clickFraktion = "Zivilist"
  227.     elseif frak == 1 then
  228.       clickFraktion = "Polizei"
  229.     elseif frak == 2 then
  230.       clickFraktion = "Froggys"
  231.     elseif frak == 3 then
  232.       clickFraktion = "Army"
  233.     elseif frak == 4 then
  234.       clickFraktion = "FBI"
  235.     elseif frak == 5 then
  236.       clickFraktion = "Taxi"
  237.     elseif frak == 6 then
  238.       clickFraktion = "Newsreporter"
  239.     elseif frak == 7 then
  240.       clickFraktion = "Medic"
  241.     elseif frak == 8 then
  242.       clickFraktion = "Grove Street"
  243.     elseif frak == 9 then
  244.       clickFraktion = "Ballas"
  245.     elseif frak == 10 then
  246.       clickFraktion = "Mafia"
  247.     end
  248.     local rang = (tonumber(getElementData(clickedPlayer, "Rang")))
  249.     local clickRang = nil
  250.     if frak == 0 then
  251.       clickRang = "-"
  252.     elseif frak == 1 then
  253.       if rang == 1 then
  254.         clickRang = "Officer"
  255.       elseif rang == 2 then
  256.         clickRang = "Serrgeant"
  257.       elseif rang == 3 then
  258.         clickRang = "Inspector"
  259.       elseif rang == 4 then
  260.         clickRang = "Co-Chief"
  261.       elseif rang == 5 then
  262.         clickRang = "Chief"
  263.       end
  264.     elseif frak == 2 then
  265.       if rang == 1 then
  266.         clickRang = "Kaulquappe"
  267.       elseif rang == 2 then
  268.         clickRang = "Babyfrosch"
  269.       elseif rang == 3 then
  270.         clickRang = "Frosch"
  271.       elseif rang == 4 then
  272.         clickRang = "Co-Froschkönig"
  273.       elseif rang == 5 then
  274.         clickRang = "Froschkönig"
  275.       end
  276.     elseif frak == 3 then
  277.       if rang == 1 then
  278.         clickRang = "Soldat"
  279.       elseif rang == 2 then
  280.         clickRang = "Lieutenant"
  281.       elseif rang == 3 then
  282.         clickRang = "Hauptmann"
  283.       elseif rang == 4 then
  284.         clickRang = "Colonel"
  285.       elseif rang == 5 then
  286.         clickRang = "General"
  287.       end
  288.     elseif frak == 4 then
  289.       if rang == 1 then
  290.         clickRang = "Agent"
  291.       elseif rang == 2 then
  292.         clickRang = "Special Agent"
  293.       elseif rang == 3 then
  294.         clickRang = "Senior Agent"
  295.       elseif rang == 4 then
  296.         clickRang = "Assistant Director"
  297.       elseif rang == 5 then
  298.         clickRang = "Director"
  299.       end
  300.     elseif frak == 5 then
  301.       if rang == 1 then
  302.         clickRang = "Freiarbeiter"
  303.       elseif rang == 2 then
  304.         clickRang = "Angestellter"
  305.       elseif rang == 3 then
  306.         clickRang = "Abteilungsleiter"
  307.       elseif rang == 4 then
  308.         clickRang = "Co-Direktor"
  309.       elseif rang == 5 then
  310.         clickRang = "Direktor"
  311.       end
  312.     elseif frak == 6 then
  313.       if rang == 1 then
  314.         clickRang = "Anzeiger"
  315.       elseif rang == 2 then
  316.         clickRang = "Reporter"
  317.       elseif rang == 3 then
  318.         clickRang = "Chefreporter"
  319.       elseif rang == 4 then
  320.         clickRang = "Redakteur"
  321.       elseif rang == 5 then
  322.         clickRang = "Chefredakteur"
  323.       end
  324.     elseif frak == 7 then
  325.       if rang == 1 then
  326.         clickRang = "Krankenhelfer"
  327.       elseif rang == 2 then
  328.         clickRang = "Sanitäter"
  329.       elseif rang == 3 then
  330.         clickRang = "Arzthelfer"
  331.       elseif rang == 4 then
  332.         clickRang = "Notarzt"
  333.       elseif rang == 5 then
  334.         clickRang = "Chefarzt"
  335.       end
  336.     elseif frak == 8 then
  337.       if rang == 1 then
  338.         clickRang = "Wannabe"
  339.       elseif rang == 2 then
  340.         clickRang = "Ghettofreak"
  341.       elseif rang == 3 then
  342.         clickRang = "Dealer"
  343.       elseif rang == 4 then
  344.         clickRang = "Big Smoke"
  345.       elseif rang == 5 then
  346.         clickRang = "CJ"
  347.       end
  348.     elseif frak == 9 then
  349.       if rang == 1 then
  350.         clickRang = "Anwärter"
  351.       elseif rang == 2 then
  352.         clickRang = "Wachhund"
  353.       elseif rang == 3 then
  354.         clickRang = "Dealer"
  355.       elseif rang == 4 then
  356.         clickRang = "Geldeintreiber"
  357.       elseif rang == 5 then
  358.         clickRang = "Kane"
  359.       end
  360.     elseif frak == 10 then
  361.       if rang == 1 then
  362.         clickRang = "Wachhund"
  363.       end
  364.     elseif rang == 2 then
  365.       clickRang = "Repräsentant"
  366.     elseif rang == 3 then
  367.       clickRang = "Erpresser"
  368.     elseif rang == 4 then
  369.       clickRang = "Underboss"
  370.     elseif rang == 5 then
  371.       clickRang = "Pate"
  372.     end
  373.     local playingtime = tonumber(getElementData(clickedPlayer, "Spielzeit"))
  374.     local playingtime1 = math.floor(playingtime / 60) .. ":" .. playingtime - math.floor(playingtime / 60) * 60
  375.     local playingtime2 = playingtime - math.floor(playingtime / 60) * 60
  376.     local clickPlayingtime = nil
  377.     if playingtime2 > 9 then
  378.       clickPlayingtime = math.floor(playingtime / 60) .. ":" .. playingtime - math.floor(playingtime / 60) * 60
  379.     else
  380.       clickPlayingtime = math.floor(playingtime / 60) .. ":0" .. playingtime - math.floor(playingtime / 60) * 60
  381.     end
  382.     local lvl = (tonumber(getElementData(clickedPlayer, "Adminlevel")))
  383.     local adminrang = nil
  384.     if lvl == 0 then
  385.       adminrang = "Spieler"
  386.     elseif lvl == 1 then
  387.       adminrang = "Ticketbeauftragter"
  388.     elseif lvl == 2 then
  389.       adminrang = "Supporter"
  390.     elseif lvl == 3 then
  391.       adminrang = "Moderator"
  392.     elseif lvl == 4 then
  393.       adminrang = "Administrator"
  394.     end
  395.     local pre = (tonumber(getElementData(clickedPlayer, "Premium")))
  396.     local isPre = nil
  397.     if pre == 0 then
  398.       isPre = "Nein"
  399.     elseif pre >= 1 then
  400.       isPre = "Ja"
  401.     end
  402.     local job = (tonumber(getElementData(clickedPlayer, "Job")))
  403.     local jobname = nil
  404.     if job == 0 then
  405.       jobname = "Arbeitslos"
  406.     elseif job == 1 then
  407.       jobname = "Busfahrer"
  408.     elseif job == 2 then
  409.       jobname = "Pilot"
  410.     elseif job == 3 then
  411.       jobname = "Gepäcktransporter"
  412.     elseif job == 4 then
  413.       jobname = "Müllmann"
  414.     elseif job == 5 then
  415.       jobname = "LKW-Fahrer"
  416.     elseif job == 6 then
  417.       jobname = "Mechaniker"
  418.     elseif job == 7 then
  419.       jobname = "Waffendealer"
  420.     elseif job == 8 then
  421.       jobname = "Anwalt"
  422.     elseif job == 9 then
  423.       jobname = "Hotdogverkäufer"
  424.     end
  425.     guiSetText(statistikwindow.label[9], getPlayerName(clickedPlayer))
  426.     guiSetText(statistikwindow.label[10], jobname)
  427.     guiSetText(statistikwindow.label[11], clickRang)
  428.     guiSetText(statistikwindow.label[12], clickFraktion)
  429.     guiSetText(statistikwindow.label[13], adminrang)
  430.     guiSetText(statistikwindow.label[14], clickPlayingtime)
  431.     guiSetText(statistikwindow.label[15], isPre)
  432.     guiSetText(statistikwindow.label[16], tonumber(getElementData(clickedPlayer, "Telefonnr")))
  433.   end
  434. end
  435.  
  436. addEvent("openPlayerWindow", true)
  437. addEventHandler("openPlayerWindow", getRootElement(), openPlayerWindow)
  438. closePlayerWindow = function(state)
  439.   -- upvalues: lp
  440.   if state == "left" and source == playerwindow.button[5] then
  441.     guiSetVisible(playerwindow.window[1], false)
  442.     if guiGetVisible(statistikwindow.window[1]) == true then
  443.       guiSetVisible(statistikwindow.window[1], false)
  444.     end
  445.     if guiGetVisible(itemwindow.window[1]) == true then
  446.       guiSetVisible(itemwindow.window[1], false)
  447.     end
  448.     if guiGetVisible(staatwindow.window[1]) == true then
  449.       guiSetVisible(staatwindow.window[1], false)
  450.     end
  451.     if guiGetVisible(licwindow.window[1]) == true then
  452.       guiSetVisible(licwindow.window[1], false)
  453.     end
  454.     guiSetInputEnabled(false)
  455.     showCursor(false)
  456.     setElementData(lp, "windowvis", false)
  457.   end
  458. end
  459.  
  460. addEventHandler("onClientGUIClick", getRootElement(), closePlayerWindow)
  461. statistikPlayerWindow = function(state)
  462.   if state == "left" and source == playerwindow.button[1] then
  463.     if guiGetVisible(statistikwindow.window[1]) == true then
  464.       guiSetVisible(statistikwindow.window[1], false)
  465.     end
  466.   else
  467.     if guiGetVisible(itemwindow.window[1]) == true then
  468.       guiSetVisible(itemwindow.window[1], false)
  469.     end
  470.     if guiGetVisible(staatwindow.window[1]) == true then
  471.       guiSetVisible(staatwindow.window[1], false)
  472.     end
  473.     if guiGetVisible(licwindow.window[1]) == true then
  474.       guiSetVisible(licwindow.window[1], false)
  475.     end
  476.     guiSetVisible(statistikwindow.window[1], true)
  477.   end
  478. end
  479.  
  480. addEventHandler("onClientGUIClick", getRootElement(), statistikPlayerWindow)
  481. closeStatistikPlayerWindow = function(state)
  482.   if state == "left" and source == statistikwindow.button[1] then
  483.     guiSetVisible(statistikwindow.window[1], false)
  484.   end
  485. end
  486.  
  487. addEventHandler("onClientGUIClick", getRootElement(), closeStatistikPlayerWindow)
  488. itemPlayerWindow = function(state)
  489.   if state == "left" and source == playerwindow.button[2] then
  490.     if guiGetVisible(itemwindow.window[1]) == true then
  491.       guiSetVisible(itemwindow.window[1], false)
  492.     end
  493.   else
  494.     if guiGetVisible(statistikwindow.window[1]) == true then
  495.       guiSetVisible(statistikwindow.window[1], false)
  496.     end
  497.     if guiGetVisible(staatwindow.window[1]) == true then
  498.       guiSetVisible(staatwindow.window[1], false)
  499.     end
  500.     if guiGetVisible(licwindow.window[1]) == true then
  501.       guiSetVisible(licwindow.window[1], false)
  502.     end
  503.     guiSetVisible(itemwindow.window[1], true)
  504.     itemWindowInventar()
  505.   end
  506. end
  507.  
  508. addEventHandler("onClientGUIClick", getRootElement(), itemPlayerWindow)
  509. closeItemPlayerWindow = function(state)
  510.   if state == "left" and source == itemwindow.button[1] then
  511.     guiSetVisible(itemwindow.window[1], false)
  512.   end
  513. end
  514.  
  515. addEventHandler("onClientGUIClick", getRootElement(), closeItemPlayerWindow)
  516. itemWindowInventar = function()
  517.   -- upvalues: lp
  518.   guiGridListClear(itemwindow.gridlist[1])
  519.   local pro = getElementData(lp, "Inventar")
  520.   local pro1 = tonumber(gettok(pro, 1, string.byte("|")))
  521.   local pro2 = tonumber(gettok(pro, 2, string.byte("|")))
  522.   local pro3 = tonumber(gettok(pro, 3, string.byte("|")))
  523.   local pro4 = tonumber(gettok(pro, 4, string.byte("|")))
  524.   local pro5 = tonumber(gettok(pro, 5, string.byte("|")))
  525.   local pro6 = tonumber(gettok(pro, 6, string.byte("|")))
  526.   local pro7 = tonumber(gettok(pro, 7, string.byte("|")))
  527.   local pro8 = tonumber(gettok(pro, 8, string.byte("|")))
  528.   local pro9 = tonumber(gettok(pro, 9, string.byte("|")))
  529.   local pro10 = tonumber(gettok(pro, 10, string.byte("|")))
  530.   local pro11 = tonumber(gettok(pro, 11, string.byte("|")))
  531.   local pro12 = tonumber(gettok(pro, 12, string.byte("|")))
  532.   if pro1 >= 1 then
  533.     local row = guiGridListAddRow(itemwindow.gridlist[1])
  534.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[1], "Blumen", false, false)
  535.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[2], pro1, false, false)
  536.   end
  537.   if pro2 >= 1 then
  538.     local row = guiGridListAddRow(itemwindow.gridlist[1])
  539.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[1], "Fotoapparat", false, false)
  540.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[2], pro2, false, false)
  541.   end
  542.   if pro3 >= 1 then
  543.     local row = guiGridListAddRow(itemwindow.gridlist[1])
  544.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[1], "Benzinkanister", false, false)
  545.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[2], pro3, false, false)
  546.   end
  547.   if pro4 >= 1 then
  548.     local row = guiGridListAddRow(itemwindow.gridlist[1])
  549.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[1], "Rubbellos", false, false)
  550.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[2], pro4, false, false)
  551.   end
  552.   if pro5 >= 1 then
  553.     local row = guiGridListAddRow(itemwindow.gridlist[1])
  554.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[1], "Snack", false, false)
  555.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[2], pro5, false, false)
  556.   end
  557.   if pro6 >= 1 then
  558.     local row = guiGridListAddRow(itemwindow.gridlist[1])
  559.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[1], "Fertigessen", false, false)
  560.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[2], pro6, false, false)
  561.   end
  562.   if pro7 >= 1 then
  563.     local row = guiGridListAddRow(itemwindow.gridlist[1])
  564.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[1], "Bier", false, false)
  565.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[2], pro7, false, false)
  566.   end
  567.   if pro8 >= 1 then
  568.     local row = guiGridListAddRow(itemwindow.gridlist[1])
  569.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[1], "Zigaretten", false, false)
  570.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[2], pro8, false, false)
  571.   end
  572.   if pro9 >= 1 then
  573.     local row = guiGridListAddRow(itemwindow.gridlist[1])
  574.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[1], "Nachtsichtgerät", false, false)
  575.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[2], pro9, false, false)
  576.   end
  577.   if pro10 >= 1 then
  578.     local row = guiGridListAddRow(itemwindow.gridlist[1])
  579.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[1], "Newspaper", false, false)
  580.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[2], pro10, false, false)
  581.   end
  582.   if pro11 >= 1 then
  583.     local row = guiGridListAddRow(itemwindow.gridlist[1])
  584.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[1], "Hanfsamen", false, false)
  585.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[2], pro11, false, false)
  586.   end
  587.   if pro12 >= 1 then
  588.     local row = guiGridListAddRow(itemwindow.gridlist[1])
  589.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[1], "Drogen", false, false)
  590.     guiGridListSetItemText(itemwindow.gridlist[1], row, itemwindow.row[2], pro12, false, false)
  591.   end
  592. end
  593.  
  594. itemWindowClick = function()
  595.   if itemwindow.window[1] then
  596.     local rowindex, columnindex = guiGridListGetSelectedItem(itemwindow.gridlist[1])
  597.     local selectedItemPlayer = guiGridListGetItemText(itemwindow.gridlist[1], rowindex, itemwindow.row[1])
  598.     if selectedItemPlayer == "Blumen" then
  599.       sItemPlayer = "blumen"
  600.     end
  601.   elseif selectedItemPlayer == "Fotoapparat" then
  602.     sItemPlayer = "foto"
  603.   elseif selectedItemPlayer == "Benzinkanister" then
  604.     sItemPlayer = "bcanister"
  605.   elseif selectedItemPlayer == "Rubbellos" then
  606.     sItemPlayer = "rubbel"
  607.   elseif selectedItemPlayer == "Snack" then
  608.     sItemPlayer = "snack"
  609.   elseif selectedItemPlayer == "Fertigessen" then
  610.     sItemPlayer = "fessen"
  611.   elseif selectedItemPlayer == "Bier" then
  612.     sItemPlayer = "bier"
  613.   elseif selectedItemPlayer == "Zigaretten" then
  614.     sItemPlayer = "zigs"
  615.   elseif selectedItemPlayer == "Nachtsichtgerät" then
  616.     sItemPlayer = "night"
  617.   elseif selectedItemPlayer == "Newspaper" then
  618.     sItemPlayer = "newspaper"
  619.   elseif selectedItemPlayer == "Hanfsamen" then
  620.     sItemPlayer = "samen"
  621.   elseif selectedItemPlayer == "Drogen" then
  622.     sItemPlayer = "drogen"
  623.   else
  624.     sItemPlayer = "none"
  625.   end
  626. end
  627.  
  628. addEventHandler("onClientGUIClick", getRootElement(), itemWindowClick)
  629. itemWindowGiveItem = function(state)
  630.   -- upvalues: lp
  631.   if state == "left" and source == itemwindow.button[2] then
  632.     local pro = getElementData(lp, "Inventar")
  633.     local pro1 = tonumber(gettok(pro, 1, string.byte("|")))
  634.     local pro2 = tonumber(gettok(pro, 2, string.byte("|")))
  635.     local pro3 = tonumber(gettok(pro, 3, string.byte("|")))
  636.     local pro4 = tonumber(gettok(pro, 4, string.byte("|")))
  637.     local pro5 = tonumber(gettok(pro, 5, string.byte("|")))
  638.     local pro6 = tonumber(gettok(pro, 6, string.byte("|")))
  639.     local pro7 = tonumber(gettok(pro, 7, string.byte("|")))
  640.     local pro8 = tonumber(gettok(pro, 8, string.byte("|")))
  641.     local pro9 = tonumber(gettok(pro, 9, string.byte("|")))
  642.     local pro10 = tonumber(gettok(pro, 10, string.byte("|")))
  643.     local pro11 = tonumber(gettok(pro, 11, string.byte("|")))
  644.     local pro12 = tonumber(gettok(pro, 12, string.byte("|")))
  645.     local value = tonumber(guiGetText(itemwindow.edit[1]))
  646.     if value ~= nil then
  647.       if value > 0 then
  648.         if isElement(getPlayerFromName(guiGetText(statistikwindow.label[9]))) then
  649.           local clickedPlayer = getPlayerFromName(guiGetText(statistikwindow.label[9]))
  650.           if sItemPlayer == "blumen" then
  651.             if value <= pro1 then
  652.               local item = 1
  653.               triggerServerEvent("itemWindowGiveItem", lp, clickedPlayer, item, value)
  654.               local pro1 = pro1 - value
  655.               setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
  656.             else
  657.               outputChatBox("Du hast nicht genug Items!", 255, 48, 48)
  658.             end
  659.           elseif sItemPlayer == "foto" then
  660.             if value <= pro2 then
  661.               local item = 2
  662.               triggerServerEvent("itemWindowGiveItem", lp, clickedPlayer, item, value)
  663.               local pro2 = pro2 - value
  664.               setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
  665.             else
  666.               outputChatBox("Du hast nicht genug Items!", 255, 48, 48)
  667.             end
  668.           elseif sItemPlayer == "bcanister" then
  669.             if value <= pro3 then
  670.               local item = 3
  671.               triggerServerEvent("itemWindowGiveItem", lp, clickedPlayer, item, value)
  672.               local pro3 = pro3 - value
  673.               setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
  674.             else
  675.               outputChatBox("Du hast nicht genug Items!", 255, 48, 48)
  676.             end
  677.           elseif sItemPlayer == "rubbel" then
  678.             if value <= pro4 then
  679.               local item = 4
  680.               triggerServerEvent("itemWindowGiveItem", lp, clickedPlayer, item, value)
  681.               local pro4 = pro4 - value
  682.               setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
  683.             else
  684.               outputChatBox("Du hast nicht genug Items!", 255, 48, 48)
  685.             end
  686.           elseif sItemPlayer == "snack" then
  687.             if value <= pro5 then
  688.               local item = 5
  689.               triggerServerEvent("itemWindowGiveItem", lp, clickedPlayer, item, value)
  690.               local pro5 = pro5 - value
  691.               setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
  692.             else
  693.               outputChatBox("Du hast nicht genug Items!", 255, 48, 48)
  694.             end
  695.           elseif sItemPlayer == "fessen" then
  696.             if value <= pro6 then
  697.               local item = 6
  698.               triggerServerEvent("itemWindowGiveItem", lp, clickedPlayer, item, value)
  699.               local pro6 = pro6 - value
  700.               setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
  701.             else
  702.               outputChatBox("Du hast nicht genug Items!", 255, 48, 48)
  703.             end
  704.           elseif sItemPlayer == "bier" then
  705.             if value <= pro7 then
  706.               local item = 7
  707.               triggerServerEvent("itemWindowGiveItem", lp, clickedPlayer, item, value)
  708.               local pro7 = pro7 - value
  709.               setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
  710.             else
  711.               outputChatBox("Du hast nicht genug Items!", 255, 48, 48)
  712.             end
  713.           elseif sItemPlayer == "zigs" then
  714.             if value <= pro8 then
  715.               local item = 8
  716.               triggerServerEvent("itemWindowGiveItem", lp, clickedPlayer, item, value)
  717.               local pro8 = pro8 - value
  718.               setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
  719.             else
  720.               outputChatBox("Du hast nicht genug Items!", 255, 48, 48)
  721.             end
  722.           elseif sItemPlayer == "night" then
  723.             if value <= pro9 then
  724.               local item = 9
  725.               triggerServerEvent("itemWindowGiveItem", lp, clickedPlayer, item, value)
  726.               local pro9 = pro9 - value
  727.               setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
  728.             else
  729.               outputChatBox("Du hast nicht genug Items!", 255, 48, 48)
  730.             end
  731.           elseif sItemPlayer == "newspaper" then
  732.             if value <= pro10 then
  733.               local item = 10
  734.               triggerServerEvent("itemWindowGiveItem", lp, clickedPlayer, item, value)
  735.               local pro10 = pro10 - value
  736.               setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
  737.             else
  738.               outputChatBox("Du hast nicht genug Items!", 255, 48, 48)
  739.             end
  740.           elseif sItemPlayer == "samen" then
  741.             if value <= pro11 then
  742.               local item = 11
  743.               triggerServerEvent("itemWindowGiveItem", lp, clickedPlayer, item, value)
  744.               local pro11 = pro11 - value
  745.               setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
  746.             else
  747.               outputChatBox("Du hast nicht genug Items!", 255, 48, 48)
  748.             end
  749.           elseif sItemPlayer == "drogen" then
  750.             if value <= pro12 then
  751.               local item = 12
  752.               triggerServerEvent("itemWindowGiveItem", lp, clickedPlayer, item, value)
  753.               local pro12 = pro12 - value
  754.               setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
  755.             else
  756.               outputChatBox("Du hast nicht genug Items!", 255, 48, 48)
  757.             end
  758.           else
  759.             outputChatBox("Bitte wähle eine Item aus!", 255, 48, 48)
  760.           end
  761.         else
  762.           outputChatBox("Der Spieler existiert nicht!", 255, 48, 48)
  763.         end
  764.       else
  765.         outputChatBox("Bitte gib eine gültige Anzahl an Items ein!", 255, 48, 48)
  766.       end
  767.     else
  768.       outputChatBox("Bitte gib eine gültige Anzahl an Items ein!", 255, 48, 48)
  769.     end
  770.     guiSetText(itemwindow.edit[1], "")
  771.     itemWindowInventar()
  772.   end
  773. end
  774.  
  775. addEventHandler("onClientGUIClick", getRootElement(), itemWindowGiveItem)
  776. itemWindowGiveMoney = function(state)
  777.   -- upvalues: lp
  778.   if state == "left" and source == itemwindow.button[3] then
  779.     local money = tonumber(getElementData(lp, "Geld"))
  780.     local value = tonumber(guiGetText(itemwindow.edit[2]))
  781.     if value ~= nil then
  782.       if value > 0 then
  783.         if value <= money then
  784.           if isElement(getPlayerFromName(guiGetText(statistikwindow.label[9]))) then
  785.             local clickedPlayer = getPlayerFromName(guiGetText(statistikwindow.label[9]))
  786.             triggerServerEvent("itemWindowGiveMoney", lp, clickedPlayer, value)
  787.           else
  788.             outputChatBox("Der Spieler existiert nicht!", 255, 48, 48)
  789.           end
  790.         else
  791.           outputChatBox("Du hast nicht genug Geld!", 255, 48, 48)
  792.         end
  793.       else
  794.         outputChatBox("Bitte gib einen gültigen Betrag ein!", 255, 48, 48)
  795.       end
  796.     else
  797.       outputChatBox("Bitte gib einen gültigen Betrag ein!", 255, 48, 48)
  798.     end
  799.     guiSetText(itemwindow.edit[2], "")
  800.   end
  801. end
  802.  
  803. addEventHandler("onClientGUIClick", getRootElement(), itemWindowGiveMoney)
  804. staatPlayerWindow = function(state)
  805.   if state == "left" and source == playerwindow.button[3] then
  806.     if guiGetVisible(staatwindow.window[1]) == true then
  807.       guiSetVisible(staatwindow.window[1], false)
  808.     end
  809.   else
  810.     if guiGetVisible(statistikwindow.window[1]) == true then
  811.       guiSetVisible(statistikwindow.window[1], false)
  812.     end
  813.     if guiGetVisible(itemwindow.window[1]) == true then
  814.       guiSetVisible(itemwindow.window[1], false)
  815.     end
  816.     if guiGetVisible(licwindow.window[1]) == true then
  817.       guiSetVisible(licwindow.window[1], false)
  818.     end
  819.     guiSetVisible(staatwindow.window[1], true)
  820.   end
  821. end
  822.  
  823. addEventHandler("onClientGUIClick", getRootElement(), staatPlayerWindow)
  824. closeStaatPlayerWindow = function(state)
  825.   if state == "left" and source == staatwindow.button[1] then
  826.     guiSetVisible(staatwindow.window[1], false)
  827.   end
  828. end
  829.  
  830. addEventHandler("onClientGUIClick", getRootElement(), closeStaatPlayerWindow)
  831. scheinStaatPlayerWindow = function(state)
  832.   if state == "left" and source == staatwindow.button[2] then
  833.     if #guiGetText(staatwindow.edit[1]) > 0 then
  834.       local sradio = nil
  835.       if guiRadioButtonGetSelected(staatwindow.radiobutton[1]) == true then
  836.         sradio = 1
  837.       else
  838.         if guiRadioButtonGetSelected(staatwindow.radiobutton[2]) == true then
  839.           sradio = 2
  840.         end
  841.       else
  842.         if guiRadioButtonGetSelected(staatwindow.radiobutton[3]) == true then
  843.           sradio = 3
  844.         end
  845.       else
  846.         if guiRadioButtonGetSelected(staatwindow.radiobutton[4]) == true then
  847.           sradio = 4
  848.         end
  849.       else
  850.         if guiRadioButtonGetSelected(staatwindow.radiobutton[5]) == true then
  851.           sradio = 5
  852.         end
  853.       else
  854.         if guiRadioButtonGetSelected(staatwindow.radiobutton[6]) == true then
  855.           sradio = 6
  856.         end
  857.       else
  858.         if guiRadioButtonGetSelected(staatwindow.radiobutton[7]) == true then
  859.           sradio = 7
  860.         end
  861.       else
  862.         if guiRadioButtonGetSelected(staatwindow.radiobutton[8]) == true then
  863.           sradio = 8
  864.         end
  865.       else
  866.         if guiRadioButtonGetSelected(staatwindow.radiobutton[9]) == true then
  867.           sradio = 9
  868.         end
  869.       else
  870.         outputChatBox("Bitte wähle einen Schein aus!", 255, 48, 48)
  871.         return
  872.       end
  873.       triggerServerEvent("tschein", getLocalPlayer(), getLocalPlayer(), "", guiGetText(statistikwindow.label[9]), sradio, guiGetText(staatwindow.edit[1]))
  874.     else
  875.       outputChatBox("Bitte gib einen Grund ein!", 255, 48, 48)
  876.     end
  877.     guiSetText(staatwindow.edit[1], "")
  878.   end
  879. end
  880.  
  881. addEventHandler("onClientGUIClick", getRootElement(), scheinStaatPlayerWindow)
  882. ticketStaatPlayerWindow = function(state)
  883.   if state == "left" and source == staatwindow.button[3] then
  884.     if #guiGetText(staatwindow.edit[3]) > 0 then
  885.       if #guiGetText(staatwindow.edit[2]) > 0 then
  886.         local preis = math.floor(tonumber(guiGetText(staatwindow.edit[2])))
  887.         if preis > 0 then
  888.           triggerServerEvent("ticket", getLocalPlayer(), getLocalPlayer(), "", guiGetText(statistikwindow.label[9]), preis)
  889.         else
  890.           outputChatBox("Bitte gib einen gültigen Betrag ein!", 255, 48, 48)
  891.         end
  892.       else
  893.         outputChatBox("Bitte gib einen gültigen Betrag ein!", 255, 48, 48)
  894.       end
  895.     else
  896.       outputChatBox("Bitte gib einen Grund ein!", 255, 48, 48)
  897.     end
  898.     guiSetText(staatwindow.edit[2], "")
  899.     guiSetText(staatwindow.edit[3], "")
  900.   end
  901. end
  902.  
  903. addEventHandler("onClientGUIClick", getRootElement(), ticketStaatPlayerWindow)
  904. warpStaatPlayerWindow = function(state)
  905.   if state == "left" and source == staatwindow.button[4] then
  906.     triggerServerEvent("warpIntoCar", getLocalPlayer(), getLocalPlayer(), "", guiGetText(statistikwindow.label[9]))
  907.   end
  908. end
  909.  
  910. addEventHandler("onClientGUIClick", getRootElement(), warpStaatPlayerWindow)
  911. weaponsStaatPlayerWindow = function(state)
  912.   if state == "left" and source == staatwindow.button[5] then
  913.     triggerServerEvent("takeweapons", getLocalPlayer(), getLocalPlayer(), "", guiGetText(statistikwindow.label[9]))
  914.   end
  915. end
  916.  
  917. addEventHandler("onClientGUIClick", getRootElement(), weaponsStaatPlayerWindow)
  918. drogenStaatPlayerWindow = function(state)
  919.   if state == "left" and source == staatwindow.button[6] then
  920.     triggerServerEvent("takeillegal", getLocalPlayer(), getLocalPlayer(), "", guiGetText(statistikwindow.label[9]))
  921.   end
  922. end
  923.  
  924. addEventHandler("onClientGUIClick", getRootElement(), drogenStaatPlayerWindow)
  925. fesselnStaatPlayerWindow = function(state)
  926.   if state == "left" and source == staatwindow.button[7] then
  927.     triggerServerEvent("tie", getLocalPlayer(), getLocalPlayer(), "", guiGetText(statistikwindow.label[9]))
  928.     if guiGetText(staatwindow.button[7]) == "Spieler entfesseln" then
  929.       guiSetText(staatwindow.button[7], "Spieler fesseln")
  930.     end
  931.   else
  932.     guiSetText(staatwindow.button[7], "Spieler entfesseln")
  933.   end
  934. end
  935.  
  936. addEventHandler("onClientGUIClick", getRootElement(), fesselnStaatPlayerWindow)
  937. licPlayerWindow = function(state)
  938.   if state == "left" and source == playerwindow.button[4] then
  939.     if guiGetVisible(licwindow.window[1]) == true then
  940.       guiSetVisible(licwindow.window[1], false)
  941.     end
  942.   else
  943.     if guiGetVisible(statistikwindow.window[1]) == true then
  944.       guiSetVisible(statistikwindow.window[1], false)
  945.     end
  946.     if guiGetVisible(itemwindow.window[1]) == true then
  947.       guiSetVisible(itemwindow.window[1], false)
  948.     end
  949.     if guiGetVisible(staatwindow.window[1]) == true then
  950.       guiSetVisible(staatwindow.window[1], false)
  951.     end
  952.     guiSetVisible(licwindow.window[1], true)
  953.     setPlayerLicenses()
  954.   end
  955. end
  956.  
  957. addEventHandler("onClientGUIClick", getRootElement(), licPlayerWindow)
  958. closeLicPlayerWindow = function(state)
  959.   if state == "left" and source == licwindow.button[1] then
  960.     guiSetVisible(licwindow.window[1], false)
  961.   end
  962. end
  963.  
  964. addEventHandler("onClientGUIClick", getRootElement(), closeLicPlayerWindow)
  965. setPlayerLicenses = function()
  966.   guiGridListClear(licwindow.gridlist[1])
  967.   local lic = getElementData(getPlayerFromName(guiGetText(statistikwindow.label[9])), "Licenses")
  968.   local lic1 = tonumber(gettok(lic, 1, string.byte("|")))
  969.   local lic2 = tonumber(gettok(lic, 2, string.byte("|")))
  970.   local lic3 = tonumber(gettok(lic, 3, string.byte("|")))
  971.   local lic4 = tonumber(gettok(lic, 4, string.byte("|")))
  972.   local lic5 = tonumber(gettok(lic, 5, string.byte("|")))
  973.   local lic6 = tonumber(gettok(lic, 6, string.byte("|")))
  974.   local lic7 = tonumber(gettok(lic, 7, string.byte("|")))
  975.   local lic8 = tonumber(gettok(lic, 8, string.byte("|")))
  976.   local lic9 = tonumber(gettok(lic, 9, string.byte("|")))
  977.   local row = guiGridListAddRow(licwindow.gridlist[1])
  978.   guiGridListSetItemText(licwindow.gridlist[1], row, grid_lic_schein, "Führerschein", false, false)
  979.   if lic1 == 1 then
  980.     fix = "Ja"
  981.   else
  982.     fix = "Nein"
  983.   end
  984.   guiGridListSetItemText(licwindow.gridlist[1], row, grid_lic_besitz, fix, false, false)
  985.   local row = guiGridListAddRow(licwindow.gridlist[1])
  986.   guiGridListSetItemText(licwindow.gridlist[1], row, grid_lic_schein, "Motorradschein", false, false)
  987.   if lic2 == 1 then
  988.     fix = "Ja"
  989.   else
  990.     fix = "Nein"
  991.   end
  992.   guiGridListSetItemText(licwindow.gridlist[1], row, grid_lic_besitz, fix, false, false)
  993.   local row = guiGridListAddRow(licwindow.gridlist[1])
  994.   guiGridListSetItemText(licwindow.gridlist[1], row, grid_lic_schein, "LKW-Schein", false, false)
  995.   if lic3 == 1 then
  996.     fix = "Ja"
  997.   else
  998.     fix = "Nein"
  999.   end
  1000.   guiGridListSetItemText(licwindow.gridlist[1], row, grid_lic_besitz, fix, false, false)
  1001.   local row = guiGridListAddRow(licwindow.gridlist[1])
  1002.   guiGridListSetItemText(licwindow.gridlist[1], row, grid_lic_schein, "Flugschein", false, false)
  1003.   if lic4 == 1 then
  1004.     fix = "Ja"
  1005.   else
  1006.     fix = "Nein"
  1007.   end
  1008.   guiGridListSetItemText(licwindow.gridlist[1], row, grid_lic_besitz, fix, false, false)
  1009.   local row = guiGridListAddRow(licwindow.gridlist[1])
  1010.   guiGridListSetItemText(licwindow.gridlist[1], row, grid_lic_schein, "Helikopterschein", false, false)
  1011.   if lic5 == 1 then
  1012.     fix = "Ja"
  1013.   else
  1014.     fix = "Nein"
  1015.   end
  1016.   guiGridListSetItemText(licwindow.gridlist[1], row, grid_lic_besitz, fix, false, false)
  1017.   local row = guiGridListAddRow(licwindow.gridlist[1])
  1018.   guiGridListSetItemText(licwindow.gridlist[1], row, grid_lic_schein, "Bootschein", false, false)
  1019.   if lic6 == 1 then
  1020.     fix = "Ja"
  1021.   else
  1022.     fix = "Nein"
  1023.   end
  1024.   guiGridListSetItemText(licwindow.gridlist[1], row, grid_lic_besitz, fix, false, false)
  1025.   local row = guiGridListAddRow(licwindow.gridlist[1])
  1026.   guiGridListSetItemText(licwindow.gridlist[1], row, grid_lic_schein, "Waffenschein", false, false)
  1027.   if lic7 == 1 then
  1028.     fix = "Ja"
  1029.   else
  1030.     fix = "Nein"
  1031.   end
  1032.   guiGridListSetItemText(licwindow.gridlist[1], row, grid_lic_besitz, fix, false, false)
  1033.   local row = guiGridListAddRow(licwindow.gridlist[1])
  1034.   guiGridListSetItemText(licwindow.gridlist[1], row, grid_lic_schein, "Reisepass", false, false)
  1035.   if lic8 == 1 then
  1036.     fix = "Ja"
  1037.   else
  1038.     fix = "Nein"
  1039.   end
  1040.   guiGridListSetItemText(licwindow.gridlist[1], row, grid_lic_besitz, fix, false, false)
  1041.   local row = guiGridListAddRow(licwindow.gridlist[1])
  1042.   guiGridListSetItemText(licwindow.gridlist[1], row, grid_lic_schein, "Personalausweis", false, false)
  1043.   if lic9 == 1 then
  1044.     fix = "Ja"
  1045.   else
  1046.     fix = "Nein"
  1047.   end
  1048.   guiGridListSetItemText(licwindow.gridlist[1], row, grid_lic_besitz, fix, false, false)
  1049. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement