Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Decompiled using luadec 2.1 UNICODE by sztupy (http://winmo.sztupy.hu) and viruscamp
- -- Command line was: C:\Users\Noneatme\Documents\luadec\selfclick_c.lua
- local lp = getLocalPlayer()
- local x, y = guiGetScreenSize()
- addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function()
- -- upvalues: x , y
- click_window = guiCreateWindow(x / 2 - 257, y / 2 - 132.5, 515, 265, "", false)
- guiWindowSetMovable(click_window, false)
- guiWindowSetSizable(click_window, false)
- click_tabpanel = guiCreateTabPanel(9, 29, 497, 227, false, click_window)
- click_tab_inv = guiCreateTab("Inventar", click_tabpanel)
- click_grid_inv = guiCreateGridList(8, 6, 355, 190, false, click_tab_inv)
- guiGridListSetSelectionMode(click_grid_inv, 2)
- grid_inv_item = guiGridListAddColumn(click_grid_inv, "Item", 0.5)
- grid_inv_anzahl = guiGridListAddColumn(click_grid_inv, "Anzahl", 0.4)
- click_button_wegwerfen = guiCreateButton(368, 128, 121, 27, "Wegwerfen", false, click_tab_inv)
- guiSetFont(click_button_wegwerfen, "default-bold-small")
- click_button_benutzen = guiCreateButton(368, 164, 121, 27, "Benutzen", false, click_tab_inv)
- guiSetFont(click_button_benutzen, "default-bold-small")
- click_button_close1 = guiCreateButton(465, 7, 24, 22, "X", false, click_tab_inv)
- guiSetFont(click_button_close1, "default-bold-small")
- click_tab_sta = guiCreateTab("Statistik", click_tabpanel)
- click_label_name1 = guiCreateLabel(15, 12, 99, 19, "Name:", false, click_tab_sta)
- guiSetFont(click_label_name1, "default-bold-small")
- click_label_name2 = guiCreateLabel(150, 12, 99, 19, "", false, click_tab_sta)
- guiSetFont(click_label_name2, "default-bold-small")
- click_label_spielzeit1 = guiCreateLabel(15, 32, 99, 19, "Spielzeit:", false, click_tab_sta)
- guiSetFont(click_label_spielzeit1, "default-bold-small")
- click_label_spielzeit2 = guiCreateLabel(150, 32, 99, 19, "", false, click_tab_sta)
- guiSetFont(click_label_spielzeit2, "default-bold-small")
- click_label_geld1 = guiCreateLabel(15, 52, 99, 19, "Geld:", false, click_tab_sta)
- guiSetFont(click_label_geld1, "default-bold-small")
- click_label_geld2 = guiCreateLabel(150, 52, 99, 19, "", false, click_tab_sta)
- guiSetFont(click_label_geld2, "default-bold-small")
- click_label_bankgeld1 = guiCreateLabel(15, 72, 99, 19, "Bankgeld:", false, click_tab_sta)
- guiSetFont(click_label_bankgeld1, "default-bold-small")
- click_label_bankgeld2 = guiCreateLabel(150, 72, 99, 19, "", false, click_tab_sta)
- guiSetFont(click_label_bankgeld2, "default-bold-small")
- click_label_fraktion1 = guiCreateLabel(15, 92, 99, 19, "Fraktion:", false, click_tab_sta)
- guiSetFont(click_label_fraktion1, "default-bold-small")
- click_label_fraktion2 = guiCreateLabel(150, 92, 99, 19, "", false, click_tab_sta)
- guiSetFont(click_label_fraktion2, "default-bold-small")
- click_label_rang1 = guiCreateLabel(15, 112, 102, 19, "Fraktionsrang:", false, click_tab_sta)
- guiSetFont(click_label_rang1, "default-bold-small")
- click_label_rang2 = guiCreateLabel(150, 112, 102, 19, "", false, click_tab_sta)
- guiSetFont(click_label_rang2, "default-bold-small")
- click_label_job1 = guiCreateLabel(15, 132, 99, 19, "Job:", false, click_tab_sta)
- guiSetFont(click_label_job1, "default-bold-small")
- click_label_job2 = guiCreateLabel(150, 132, 150, 19, "", false, click_tab_sta)
- guiSetFont(click_label_job2, "default-bold-small")
- click_label_gh1 = guiCreateLabel(15, 152, 99, 19, "Handyguthaben:", false, click_tab_sta)
- guiSetFont(click_label_gh1, "default-bold-small")
- click_label_gh2 = guiCreateLabel(150, 152, 99, 19, "", false, click_tab_sta)
- guiSetFont(click_label_gh2, "default-bold-small")
- click_label_bo1 = guiCreateLabel(15, 172, 99, 19, "Bonusobjekte:", false, click_tab_sta)
- guiSetFont(click_label_bo1, "default-bold-small")
- click_label_bo2 = guiCreateLabel(150, 172, 99, 19, "", false, click_tab_sta)
- guiSetFont(click_label_bo2, "default-bold-small")
- click_button_close2 = guiCreateButton(465, 7, 24, 22, "X", false, click_tab_sta)
- guiSetFont(click_button_close2, "default-bold-small")
- click_tab_lic = guiCreateTab("Lizenzen", click_tabpanel)
- click_grid_lic = guiCreateGridList(8, 6, 355, 190, false, click_tab_lic)
- guiGridListSetSelectionMode(click_grid_lic, 2)
- grid_lic_schein = guiGridListAddColumn(click_grid_lic, "Lizenz", 0.5)
- grid_lic_besitz = guiGridListAddColumn(click_grid_lic, "in Besitz", 0.4)
- click_button_close3 = guiCreateButton(465, 7, 24, 22, "X", false, click_tab_lic)
- guiSetFont(click_button_close3, "default-bold-small")
- click_tab_veh = guiCreateTab("Fahrzeuge", click_tabpanel)
- click_grid_veh = guiCreateGridList(8, 6, 450, 190, false, click_tab_veh)
- guiGridListSetSelectionMode(click_grid_veh, 2)
- grid_veh_slot = guiGridListAddColumn(click_grid_veh, "Slot", 0.1)
- grid_veh_veh = guiGridListAddColumn(click_grid_veh, "Fahrzeug", 0.23)
- grid_veh_zustand = guiGridListAddColumn(click_grid_veh, "Zustand", 0.3)
- grid_veh_ort = guiGridListAddColumn(click_grid_veh, "Standort", 0.33)
- click_button_close4 = guiCreateButton(465, 7, 24, 22, "X", false, click_tab_veh)
- guiSetFont(click_button_close4, "default-bold-small")
- guiSetVisible(click_window, false)
- drogenpic = guiCreateStaticImage(0, 0, 1920, 1080, "clicksys/drogen.png", false)
- guiSetVisible(drogenpic, false)
- end
- )
- openClickWindow1 = function()
- -- upvalues: lp
- local vis = guiGetVisible(click_window)
- if vis == false and getElementData(lp, "windowvis") == false then
- guiSetVisible(click_window, true)
- showCursor(true)
- setInventar()
- setStatistik()
- setLicenses()
- guiGridListClear(click_grid_veh)
- triggerServerEvent("setVehiclesServer", lp, lp)
- setElementData(lp, "windowvis", true)
- end
- end
- addEvent("openClickWindow1", true)
- addEventHandler("openClickWindow1", getRootElement(), openClickWindow1)
- openClickWindow2 = function()
- -- upvalues: lp
- local vis = guiGetVisible(click_window)
- if vis == false then
- guiSetVisible(click_window, true)
- showCursor(true)
- setInventar()
- setStatistik()
- setLicenses()
- guiGridListClear(click_grid_veh)
- triggerServerEvent("setVehiclesServer", lp, lp)
- setElementData(lp, "windowvis", true)
- elseif vis == true then
- guiSetVisible(click_window, false)
- showCursor(false)
- setElementData(lp, "windowvis", false)
- end
- end
- bindKey("i", "down", openClickWindow2)
- setInventar = function()
- -- upvalues: lp
- guiGridListClear(click_grid_inv)
- local pro = getElementData(lp, "Inventar")
- local pro1 = tonumber(gettok(pro, 1, string.byte("|")))
- local pro2 = tonumber(gettok(pro, 2, string.byte("|")))
- local pro3 = tonumber(gettok(pro, 3, string.byte("|")))
- local pro4 = tonumber(gettok(pro, 4, string.byte("|")))
- local pro5 = tonumber(gettok(pro, 5, string.byte("|")))
- local pro6 = tonumber(gettok(pro, 6, string.byte("|")))
- local pro7 = tonumber(gettok(pro, 7, string.byte("|")))
- local pro8 = tonumber(gettok(pro, 8, string.byte("|")))
- local pro9 = tonumber(gettok(pro, 9, string.byte("|")))
- local pro10 = tonumber(gettok(pro, 10, string.byte("|")))
- local pro11 = tonumber(gettok(pro, 11, string.byte("|")))
- local pro12 = tonumber(gettok(pro, 12, string.byte("|")))
- if pro1 >= 1 then
- local row = guiGridListAddRow(click_grid_inv)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_item, "Blumen", false, false)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_anzahl, pro1, false, false)
- end
- if pro2 >= 1 then
- local row = guiGridListAddRow(click_grid_inv)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_item, "Fotoapparat", false, false)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_anzahl, pro2, false, false)
- end
- if pro3 >= 1 then
- local row = guiGridListAddRow(click_grid_inv)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_item, "Benzinkanister", false, false)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_anzahl, pro3, false, false)
- end
- if pro4 >= 1 then
- local row = guiGridListAddRow(click_grid_inv)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_item, "Rubbellos", false, false)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_anzahl, pro4, false, false)
- end
- if pro5 >= 1 then
- local row = guiGridListAddRow(click_grid_inv)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_item, "Snack", false, false)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_anzahl, pro5, false, false)
- end
- if pro6 >= 1 then
- local row = guiGridListAddRow(click_grid_inv)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_item, "Fertigessen", false, false)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_anzahl, pro6, false, false)
- end
- if pro7 >= 1 then
- local row = guiGridListAddRow(click_grid_inv)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_item, "Bier", false, false)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_anzahl, pro7, false, false)
- end
- if pro8 >= 1 then
- local row = guiGridListAddRow(click_grid_inv)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_item, "Zigaretten", false, false)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_anzahl, pro8, false, false)
- end
- if pro9 >= 1 then
- local row = guiGridListAddRow(click_grid_inv)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_item, "Nachtsichtgerät", false, false)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_anzahl, pro9, false, false)
- end
- if pro10 >= 1 then
- local row = guiGridListAddRow(click_grid_inv)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_item, "Newspaper", false, false)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_anzahl, pro10, false, false)
- end
- if pro11 >= 1 then
- local row = guiGridListAddRow(click_grid_inv)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_item, "Hanfsamen", false, false)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_anzahl, pro11, false, false)
- end
- if pro12 >= 1 then
- local row = guiGridListAddRow(click_grid_inv)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_item, "Drogen", false, false)
- guiGridListSetItemText(click_grid_inv, row, grid_inv_anzahl, pro12, false, false)
- end
- end
- invClick = function()
- if click_grid_inv then
- local rowindex, columnindex = guiGridListGetSelectedItem(click_grid_inv)
- local selectedItem = guiGridListGetItemText(click_grid_inv, rowindex, grid_inv_item)
- if selectedItem == "Blumen" then
- sItem = "blumen"
- end
- elseif selectedItem == "Fotoapparat" then
- sItem = "foto"
- elseif selectedItem == "Benzinkanister" then
- sItem = "bcanister"
- elseif selectedItem == "Rubbellos" then
- sItem = "rubbel"
- elseif selectedItem == "Snack" then
- sItem = "snack"
- elseif selectedItem == "Fertigessen" then
- sItem = "fessen"
- elseif selectedItem == "Bier" then
- sItem = "bier"
- elseif selectedItem == "Zigaretten" then
- sItem = "zigs"
- elseif selectedItem == "Nachtsichtgerät" then
- sItem = "night"
- elseif selectedItem == "Newspaper" then
- sItem = "newspaper"
- elseif selectedItem == "Hanfsamen" then
- sItem = "samen"
- elseif selectedItem == "Drogen" then
- sItem = "drogen"
- else
- sItem = "none"
- end
- end
- addEventHandler("onClientGUIClick", getRootElement(), invClick)
- useObject = function(state)
- -- upvalues: lp
- if state == "left" and source == click_button_benutzen then
- local pro = getElementData(lp, "Inventar")
- local pro1 = tonumber(gettok(pro, 1, string.byte("|")))
- local pro2 = tonumber(gettok(pro, 2, string.byte("|")))
- local pro3 = tonumber(gettok(pro, 3, string.byte("|")))
- local pro4 = tonumber(gettok(pro, 4, string.byte("|")))
- local pro5 = tonumber(gettok(pro, 5, string.byte("|")))
- local pro6 = tonumber(gettok(pro, 6, string.byte("|")))
- local pro7 = tonumber(gettok(pro, 7, string.byte("|")))
- local pro8 = tonumber(gettok(pro, 8, string.byte("|")))
- local pro9 = tonumber(gettok(pro, 9, string.byte("|")))
- local pro10 = tonumber(gettok(pro, 10, string.byte("|")))
- local pro11 = tonumber(gettok(pro, 11, string.byte("|")))
- local pro12 = tonumber(gettok(pro, 12, string.byte("|")))
- if sItem == "blumen" then
- local value = 1
- triggerServerEvent("inviGiveObject", lp, lp, value)
- local pro1 = pro1 - 1
- setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
- elseif sItem == "foto" then
- local value = 2
- triggerServerEvent("inviGiveObject", lp, lp, value)
- local pro2 = pro2 - 1
- setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
- elseif sItem == "bcanister" then
- if isPedInVehicle(lp) then
- local value = 3
- triggerServerEvent("inviGiveObject", lp, lp, value)
- else
- outputChatBox("Du musst in einem Fahrzeug sitzen!", 255, 48, 48)
- end
- elseif sItem == "rubbel" then
- local value = 4
- triggerServerEvent("inviGiveObject", lp, lp, value)
- local pro4 = pro4 - 1
- setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
- elseif sItem == "snack" then
- local value = 5
- triggerServerEvent("inviGiveObject", lp, lp, value)
- local pro5 = pro5 - 1
- setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
- elseif sItem == "fessen" then
- local value = 6
- triggerServerEvent("inviGiveObject", lp, lp, value)
- local pro6 = pro6 - 1
- setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
- elseif sItem == "bier" then
- local value = 7
- triggerServerEvent("inviGiveObject", lp, lp, value)
- local pro7 = pro7 - 1
- setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
- elseif sItem == "zigs" then
- outputChatBox("Bitte verwende /smoke!", 255, 48, 48)
- elseif sItem == "night" then
- local value = 9
- triggerServerEvent("inviGiveObject", lp, lp, value)
- local pro9 = pro9 - 1
- setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
- elseif sItem == "newspaper" then
- outputChatBox("Bitte verwende /newspaper!", 255, 48, 48)
- elseif sItem == "samen" then
- outputChatBox("Bitte verwende /grow weed!", 255, 48, 48)
- elseif sItem == "drogen" then
- local value = 12
- triggerServerEvent("inviGiveObject", lp, lp, value)
- local pro12 = pro12 - 1
- setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
- end
- setInventar()
- end
- end
- addEventHandler("onClientGUIClick", getRootElement(), useObject)
- trashObject = function(state)
- -- upvalues: lp
- if state == "left" and source == click_button_wegwerfen then
- local pro = getElementData(lp, "Inventar")
- local pro1 = tonumber(gettok(pro, 1, string.byte("|")))
- local pro2 = tonumber(gettok(pro, 2, string.byte("|")))
- local pro3 = tonumber(gettok(pro, 3, string.byte("|")))
- local pro4 = tonumber(gettok(pro, 4, string.byte("|")))
- local pro5 = tonumber(gettok(pro, 5, string.byte("|")))
- local pro6 = tonumber(gettok(pro, 6, string.byte("|")))
- local pro7 = tonumber(gettok(pro, 7, string.byte("|")))
- local pro8 = tonumber(gettok(pro, 8, string.byte("|")))
- local pro9 = tonumber(gettok(pro, 9, string.byte("|")))
- local pro10 = tonumber(gettok(pro, 10, string.byte("|")))
- local pro11 = tonumber(gettok(pro, 11, string.byte("|")))
- local pro12 = tonumber(gettok(pro, 12, string.byte("|")))
- local geld = getElementData(lp, "Geld")
- if sItem == "blumen" then
- setElementData(lp, "Inventar", "0|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
- elseif sItem == "foto" then
- setElementData(lp, "Inventar", "" .. pro1 .. "|0|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
- elseif sItem == "bcanister" then
- setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|0|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
- elseif sItem == "rubbel" then
- setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|0|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
- elseif sItem == "snack" then
- setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|0|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
- elseif sItem == "fessen" then
- setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|0|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
- elseif sItem == "bier" then
- setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|0|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
- elseif sItem == "zigs" then
- setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|0|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
- elseif sItem == "night" then
- setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|0|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
- elseif sItem == "newspaper" then
- setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|0|" .. pro11 .. "|" .. pro12 .. "")
- elseif sItem == "samen" then
- setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|0|" .. pro12 .. "")
- elseif sItem == "drogen" then
- setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|0")
- end
- setInventar()
- end
- end
- addEventHandler("onClientGUIClick", getRootElement(), trashObject)
- math.round = function(number, decimals, method)
- if not decimals then
- decimals = 0
- end
- local factor = 10 ^ decimals
- if method == "ceil" or method == "floor" then
- return math[method](number * factor) / factor
- else
- return tonumber("%." .. decimals .. "f":format(number))
- end
- end
- setStatistik = function()
- -- upvalues: lp
- guiSetText(click_label_name2, getPlayerName(lp))
- local playingtime = tonumber(getElementData(lp, "Spielzeit"))
- local playingtime1 = math.floor(playingtime / 60) .. ":" .. playingtime - math.floor(playingtime / 60) * 60
- local playingtime2 = playingtime - math.floor(playingtime / 60) * 60
- if playingtime2 > 9 then
- clickPlayingtime = math.floor(playingtime / 60) .. ":" .. playingtime - math.floor(playingtime / 60) * 60
- else
- clickPlayingtime = math.floor(playingtime / 60) .. ":0" .. playingtime - math.floor(playingtime / 60) * 60
- end
- guiSetText(click_label_spielzeit2, clickPlayingtime)
- local money = tonumber(getElementData(lp, "Geld"))
- guiSetText(click_label_geld2, "" .. money .. "$")
- local bmoney = tonumber(getElementData(lp, "Bankgeld"))
- guiSetText(click_label_bankgeld2, "" .. bmoney .. "$")
- local frak = tonumber(getElementData(lp, "Fraktion"))
- if frak == 0 then
- clickFraktion = "-"
- elseif frak == 1 then
- clickFraktion = "Polizei"
- elseif frak == 2 then
- clickFraktion = "Froggys"
- elseif frak == 3 then
- clickFraktion = "Army"
- elseif frak == 4 then
- clickFraktion = "FBI"
- elseif frak == 5 then
- clickFraktion = "Taxi"
- elseif frak == 6 then
- clickFraktion = "Newsreporter"
- elseif frak == 7 then
- clickFraktion = "Medic"
- elseif frak == 8 then
- clickFraktion = "Grove Street"
- elseif frak == 9 then
- clickFraktion = "Ballas"
- elseif frak == 10 then
- clickFraktion = "Mafia"
- end
- guiSetText(click_label_fraktion2, clickFraktion)
- local rang = tonumber(getElementData(lp, "Rang"))
- if frak == 0 then
- clickRang = "-"
- elseif frak == 1 then
- if rang == 1 then
- clickRang = "Officer"
- elseif rang == 2 then
- clickRang = "Serrgeant"
- elseif rang == 3 then
- clickRang = "Inspector"
- elseif rang == 4 then
- clickRang = "Co-Chief"
- elseif rang == 5 then
- clickRang = "Chief"
- end
- elseif frak == 2 then
- if rang == 1 then
- clickRang = "Kaulquappe"
- elseif rang == 2 then
- clickRang = "Babyfrosch"
- elseif rang == 3 then
- clickRang = "Frosch"
- elseif rang == 4 then
- clickRang = "Co-Froschkönig"
- elseif rang == 5 then
- clickRang = "Froschkönig"
- end
- elseif frak == 3 then
- if rang == 1 then
- clickRang = "Soldat"
- elseif rang == 2 then
- clickRang = "Lieutenant"
- elseif rang == 3 then
- clickRang = "Hauptmann"
- elseif rang == 4 then
- clickRang = "Colonel"
- elseif rang == 5 then
- clickRang = "General"
- end
- elseif frak == 4 then
- if rang == 1 then
- clickRang = "Agent"
- elseif rang == 2 then
- clickRang = "Special Agent"
- elseif rang == 3 then
- clickRang = "Senior Agent"
- elseif rang == 4 then
- clickRang = "Assistant Director"
- elseif rang == 5 then
- clickRang = "Director"
- end
- elseif frak == 5 then
- if rang == 1 then
- clickRang = "Freiarbeiter"
- elseif rang == 2 then
- clickRang = "Angestellter"
- elseif rang == 3 then
- clickRang = "Abteilungsleiter"
- elseif rang == 4 then
- clickRang = "Co-Direktor"
- elseif rang == 5 then
- clickRang = "Direktor"
- end
- elseif frak == 6 then
- if rang == 1 then
- clickRang = "Anzeiger"
- elseif rang == 2 then
- clickRang = "Reporter"
- elseif rang == 3 then
- clickRang = "Chefreporter"
- elseif rang == 4 then
- clickRang = "Redakteur"
- elseif rang == 5 then
- clickRang = "Chefredakteur"
- end
- elseif frak == 7 then
- if rang == 1 then
- clickRang = "Krankenhelfer"
- elseif rang == 2 then
- clickRang = "Sanitäter"
- elseif rang == 3 then
- clickRang = "Arzthelfer"
- elseif rang == 4 then
- clickRang = "Notarzt"
- elseif rang == 5 then
- clickRang = "Chefarzt"
- end
- elseif frak == 8 then
- if rang == 1 then
- clickRang = "Wannabe"
- elseif rang == 2 then
- clickRang = "Ghettofreak"
- elseif rang == 3 then
- clickRang = "Dealer"
- elseif rang == 4 then
- clickRang = "Big Smoke"
- elseif rang == 5 then
- clickRang = "CJ"
- end
- elseif frak == 9 then
- if rang == 1 then
- clickRang = "Anwärter"
- elseif rang == 2 then
- clickRang = "Wachhund"
- elseif rang == 3 then
- clickRang = "Dealer"
- elseif rang == 4 then
- clickRang = "Geldeintreiber"
- elseif rang == 5 then
- clickRang = "Kane"
- end
- elseif frak == 10 then
- if rang == 1 then
- clickRang = "Wachhund"
- end
- elseif rang == 2 then
- clickRang = "Repräsentant"
- elseif rang == 3 then
- clickRang = "Erpresser"
- elseif rang == 4 then
- clickRang = "Underboss"
- elseif rang == 5 then
- clickRang = "Pate"
- end
- local job = (tonumber(getElementData(lp, "Job")))
- local jobname = nil
- if job == 0 then
- jobname = "Arbeitslos"
- elseif job == 1 then
- jobname = "Busfahrer"
- elseif job == 2 then
- jobname = "Pilot"
- elseif job == 3 then
- jobname = "Gepäcktransporter"
- elseif job == 4 then
- jobname = "Müllmann"
- elseif job == 5 then
- jobname = "LKW-Fahrer"
- elseif job == 6 then
- jobname = "Mechaniker"
- elseif job == 7 then
- jobname = "Waffendealer"
- elseif job == 8 then
- jobname = "Anwalt"
- elseif job == 9 then
- jobname = "Hotdogverkäufer"
- end
- guiSetText(click_label_rang2, clickRang)
- guiSetText(click_label_job2, jobname)
- local gh = tonumber(getElementData(lp, "Telefongh"))
- local gh = math.round(gh, 2)
- if gh == 0 then
- guiSetText(click_label_gh2, "0.00$")
- else
- guiSetText(click_label_gh2, "" .. gh .. "$")
- end
- guiSetText(click_label_bo2, tonumber(getElementData(lp, "Bonusobjekte")))
- end
- setLicenses = function()
- -- upvalues: lp
- guiGridListClear(click_grid_lic)
- local lic = getElementData(lp, "Licenses")
- local lic1 = tonumber(gettok(lic, 1, string.byte("|")))
- local lic2 = tonumber(gettok(lic, 2, string.byte("|")))
- local lic3 = tonumber(gettok(lic, 3, string.byte("|")))
- local lic4 = tonumber(gettok(lic, 4, string.byte("|")))
- local lic5 = tonumber(gettok(lic, 5, string.byte("|")))
- local lic6 = tonumber(gettok(lic, 6, string.byte("|")))
- local lic7 = tonumber(gettok(lic, 7, string.byte("|")))
- local lic8 = tonumber(gettok(lic, 8, string.byte("|")))
- local lic9 = tonumber(gettok(lic, 9, string.byte("|")))
- local row = guiGridListAddRow(click_grid_lic)
- guiGridListSetItemText(click_grid_lic, row, grid_lic_schein, "Führerschein", false, false)
- if lic1 == 1 then
- fix = "Ja"
- else
- fix = "Nein"
- end
- guiGridListSetItemText(click_grid_lic, row, grid_lic_besitz, fix, false, false)
- local row = guiGridListAddRow(click_grid_lic)
- guiGridListSetItemText(click_grid_lic, row, grid_lic_schein, "Motorradschein", false, false)
- if lic2 == 1 then
- fix = "Ja"
- else
- fix = "Nein"
- end
- guiGridListSetItemText(click_grid_lic, row, grid_lic_besitz, fix, false, false)
- local row = guiGridListAddRow(click_grid_lic)
- guiGridListSetItemText(click_grid_lic, row, grid_lic_schein, "LKW-Schein", false, false)
- if lic3 == 1 then
- fix = "Ja"
- else
- fix = "Nein"
- end
- guiGridListSetItemText(click_grid_lic, row, grid_lic_besitz, fix, false, false)
- local row = guiGridListAddRow(click_grid_lic)
- guiGridListSetItemText(click_grid_lic, row, grid_lic_schein, "Flugschein", false, false)
- if lic4 == 1 then
- fix = "Ja"
- else
- fix = "Nein"
- end
- guiGridListSetItemText(click_grid_lic, row, grid_lic_besitz, fix, false, false)
- local row = guiGridListAddRow(click_grid_lic)
- guiGridListSetItemText(click_grid_lic, row, grid_lic_schein, "Helikopterschein", false, false)
- if lic5 == 1 then
- fix = "Ja"
- else
- fix = "Nein"
- end
- guiGridListSetItemText(click_grid_lic, row, grid_lic_besitz, fix, false, false)
- local row = guiGridListAddRow(click_grid_lic)
- guiGridListSetItemText(click_grid_lic, row, grid_lic_schein, "Bootschein", false, false)
- if lic6 == 1 then
- fix = "Ja"
- else
- fix = "Nein"
- end
- guiGridListSetItemText(click_grid_lic, row, grid_lic_besitz, fix, false, false)
- local row = guiGridListAddRow(click_grid_lic)
- guiGridListSetItemText(click_grid_lic, row, grid_lic_schein, "Waffenschein", false, false)
- if lic7 == 1 then
- fix = "Ja"
- else
- fix = "Nein"
- end
- guiGridListSetItemText(click_grid_lic, row, grid_lic_besitz, fix, false, false)
- local row = guiGridListAddRow(click_grid_lic)
- guiGridListSetItemText(click_grid_lic, row, grid_lic_schein, "Reisepass", false, false)
- if lic8 == 1 then
- fix = "Ja"
- else
- fix = "Nein"
- end
- guiGridListSetItemText(click_grid_lic, row, grid_lic_besitz, fix, false, false)
- local row = guiGridListAddRow(click_grid_lic)
- guiGridListSetItemText(click_grid_lic, row, grid_lic_schein, "Personalausweis", false, false)
- if lic9 == 1 then
- fix = "Ja"
- else
- fix = "Nein"
- end
- guiGridListSetItemText(click_grid_lic, row, grid_lic_besitz, fix, false, false)
- end
- setVehicles = function(source, i, name, status, zone)
- -- upvalues: lp
- if lp == getLocalPlayer() then
- local row = guiGridListAddRow(click_grid_veh)
- guiGridListSetItemText(click_grid_veh, row, grid_veh_slot, i, false, false)
- guiGridListSetItemText(click_grid_veh, row, grid_veh_veh, name, true, false)
- guiGridListSetItemText(click_grid_veh, row, grid_veh_zustand, status, false, false)
- guiGridListSetItemText(click_grid_veh, row, grid_veh_ort, zone, false, false)
- end
- end
- addEvent("setVehicles", true)
- addEventHandler("setVehicles", getRootElement(), setVehicles)
- closeClickWindow1 = function(state)
- -- upvalues: lp
- if state == "left" and source == click_button_close1 then
- guiSetVisible(click_window, false)
- setElementData(lp, "windowvis", false)
- showCursor(false)
- end
- end
- addEventHandler("onClientGUIClick", getRootElement(), closeClickWindow1)
- closeClickWindow2 = function(state)
- -- upvalues: lp
- if state == "left" and source == click_button_close2 then
- guiSetVisible(click_window, false)
- showCursor(false)
- setElementData(lp, "windowvis", false)
- end
- end
- addEventHandler("onClientGUIClick", getRootElement(), closeClickWindow2)
- closeClickWindow3 = function(state)
- -- upvalues: lp
- if state == "left" and source == click_button_close3 then
- guiSetVisible(click_window, false)
- showCursor(false)
- setElementData(lp, "windowvis", false)
- end
- end
- addEventHandler("onClientGUIClick", getRootElement(), closeClickWindow3)
- closeClickWindow4 = function(state)
- -- upvalues: lp
- if state == "left" and source == click_button_close4 then
- guiSetVisible(click_window, false)
- showCursor(false)
- setElementData(lp, "windowvis", false)
- end
- end
- addEventHandler("onClientGUIClick", getRootElement(), closeClickWindow4)
- newspaper = {
- window = {},
- staticimage = {},
- label = {},
- button = {}}
- addEventHandler("onClientResourceStart", resourceRoot, function()
- -- upvalues: x , y
- newspaper.window[1] = guiCreateWindow(x / 2 - 282, y / 2 - 260, 564, 520, "", false)
- guiWindowSetMovable(newspaper.window[1], false)
- guiWindowSetSizable(newspaper.window[1], false)
- newspaper.label[1] = guiCreateLabel(16, 189, 527, 90, "", false, newspaper.window[1])
- guiLabelSetVerticalAlign(newspaper.label[1], "top")
- guiLabelSetHorizontalAlign(newspaper.label[1], "center", true)
- guiSetFont(newspaper.label[1], "clear-normal")
- newspaper.label[2] = guiCreateLabel(16, 289, 527, 90, "", false, newspaper.window[1])
- guiLabelSetVerticalAlign(newspaper.label[2], "top")
- guiLabelSetHorizontalAlign(newspaper.label[2], "center", true)
- guiSetFont(newspaper.label[2], "clear-normal")
- newspaper.label[3] = guiCreateLabel(16, 389, 527, 90, "", false, newspaper.window[1])
- guiLabelSetVerticalAlign(newspaper.label[3], "top")
- guiLabelSetHorizontalAlign(newspaper.label[3], "center", true)
- guiSetFont(newspaper.label[3], "clear-normal")
- newspaper.staticimage[1] = guiCreateStaticImage(7, 20, 525, 180, "clicksys/news.png", false, newspaper.window[1])
- guiSetVisible(newspaper.window[1], false)
- newspaper.button[1] = guiCreateButton(528, 26, 22, 22, "X", false, newspaper.window[1])
- guiSetFont(newspaper.button[1], "default-bold-small")
- guiBringToFront(newspaper.button[1])
- end
- )
- openNewspaper = function()
- -- upvalues: lp
- if tonumber(getElementData(lp, "Fraktion")) ~= 6 then
- local pro = getElementData(lp, "Inventar")
- local pro1 = tonumber(gettok(pro, 1, string.byte("|")))
- local pro2 = tonumber(gettok(pro, 2, string.byte("|")))
- local pro3 = tonumber(gettok(pro, 3, string.byte("|")))
- local pro4 = tonumber(gettok(pro, 4, string.byte("|")))
- local pro5 = tonumber(gettok(pro, 5, string.byte("|")))
- local pro6 = tonumber(gettok(pro, 6, string.byte("|")))
- local pro7 = tonumber(gettok(pro, 7, string.byte("|")))
- local pro8 = tonumber(gettok(pro, 8, string.byte("|")))
- local pro9 = tonumber(gettok(pro, 9, string.byte("|")))
- local pro10 = tonumber(gettok(pro, 10, string.byte("|")))
- local pro11 = tonumber(gettok(pro, 11, string.byte("|")))
- local pro12 = tonumber(gettok(pro, 12, string.byte("|")))
- if pro10 >= 1 then
- local pro10 = pro10 - 1
- setElementData(lp, "Inventar", "" .. pro1 .. "|" .. pro2 .. "|" .. pro3 .. "|" .. pro4 .. "|" .. pro5 .. "|" .. pro6 .. "|" .. pro7 .. "|" .. pro8 .. "|" .. pro9 .. "|" .. pro10 .. "|" .. pro11 .. "|" .. pro12 .. "")
- triggerServerEvent("openNewspaperServerside", lp)
- else
- outputChatBox("Du hast keine Zeitung!", 255, 48, 48)
- end
- else
- triggerServerEvent("openNewspaperServerside", lp)
- end
- end
- addCommandHandler("newspaper", openNewspaper)
- openNewspaperClientside = function(text)
- -- upvalues: lp
- guiSetVisible(newspaper.window[1], true)
- setElementData(lp, "windowvis", true)
- guiSetInputEnabled(true)
- showCursor(true)
- guiSetText(newspaper.label[1], "")
- guiSetText(newspaper.label[2], "")
- guiSetText(newspaper.label[3], "")
- if text ~= nil then
- local textTable = split(text, "|")
- local i = 1
- for k,v in ipairs(textTable) do
- if i <= 3 then
- guiSetText(newspaper.label[i], v)
- i = i + 1
- end
- end
- end
- end
- addEvent("openNewspaperClientside", true)
- addEventHandler("openNewspaperClientside", getRootElement(), openNewspaperClientside)
- closeNewspaper = function(state)
- -- upvalues: lp
- if state == "left" and source == newspaper.button[1] then
- guiSetVisible(newspaper.window[1], false)
- setElementData(lp, "windowvis", false)
- guiSetInputEnabled(false)
- showCursor(false)
- end
- end
- addEventHandler("onClientGUIClick", getRootElement(), closeNewspaper)
- createDrogenPic = function()
- guiSetVisible(drogenpic, true)
- guiMoveToBack(drogenpic)
- if isTimer(tookDrogenTimer1) or isTimer(tookDrogenTimer2) or isTimer(tookDrogenTimer3) or isTimer(tookDrogenTimer4) or isTimer(tookDrogenTimer5) then
- return
- end
- guiSetAlpha(drogenpic, 0)
- tookDrogenTimer1 = setTimer(function()
- tookDrogenTimer2 = setTimer(function()
- local alpha = guiGetAlpha(drogenpic)
- guiSetAlpha(drogenpic, alpha + 0.005)
- end, 50, 150)
- end, 8000, 1)
- tookDrogenTimer3 = setTimer(function()
- tookDrogenTimer4 = setTimer(function()
- local alpha = guiGetAlpha(drogenpic)
- guiSetAlpha(drogenpic, alpha - 0.005)
- end, 50, 150)
- end, 70000, 1)
- tookDrogenTimer5 = setTimer(function()
- guiSetVisible(drogenpic, false)
- end, 85500, 1)
- end
- addEvent("createDrogenPic", true)
- addEventHandler("createDrogenPic", getRootElement(), createDrogenPic)
- onDrogenPicClick = function()
- if source == drogenpic then
- guiMoveToBack(drogenpic)
- end
- end
- addEventHandler("onClientGUIClick", getRootElement(), onDrogenPicClick)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement