0 Üye ve 1 Ziyaretçi konuyu incelemekte.
--//Genel ayarları ayarlıyabileceğiniz kısım.ayarlar = { acl = "Polis",--//Hangi ACL grubunun paneli açabileceğini ayarlıyabileceğiniz kısım. komut = "hapis", --//Panelin açma komutunu ayarlıyabileceğiniz kısım. g_karakter = 206, --//Hapise atılınca verilecek karakteri ayarlıyabileceğiniz kısım. c_karakter = 0, --//Hapisten çıkınca verilecek karakteri ayarlıyabileceğiniz kısım.--//Hapise atılınca gidilecek kordinatları ayarlıyabileceğiniz kısım. giris_kordinatlari = { {243.4, 3172.6, 2.1}, {244.1, 3186.5, 2.1}, }, --//Hapisten çıkınca gidilecek kordinatlları ayarlıyabileceğiniz kısım. cikis_kordinatlari = { {266.2, 3164.5, 3.1}, {263.2, 3190.1, 2.6}, },}--//Mesaj ayarlarını ayarlıyabileceğiniz kısım.chatbox = { hata_mesaj1 = "Bu oyuncu zaten hapiste!", --//Hata mesajı 1 düzenleyebileceğiniz kısım. hata_mesaj2 = "Bu oyuncu hapiste değil.", --//Hata mesajı 2 düzenleyebileceğiniz kısım. hata_mesaj3 = "Paneli açmak için gerekli yetkiye sahip değilsin.", --//Hata mesajı 3 düzenleyebileceğiniz kısım. hata_mesaj4 = "Lütfen bir sebep giriniz.", --//Hata mesajı 4 düzenleyebileceğiniz kısım. bilgi_mesaj1 = "Hapise atıldınız. Sebep: #666666", --//Bilgi mesajı 1 düzenleyebileceğiniz kısım. bilgi_mesaj2 = "Süre doldu! hapisten çıktın.", --//Bilgi mesajı 2 düzenleyebileceğiniz kısım.}
--//Hapis Panelx = (terimler.ekran[1]/2-panel.yatay/2)y = (terimler.ekran[2]/2-panel.dikey/2)sure_x = (terimler.ekran[1]/2-panel.sure_yatay/2)sure_y = (terimler.ekran[2]/2-panel.sure_dikey/2)hapis_panel = guiCreateStaticImage(x, y, panel.yatay, panel.dikey, terimler.renk, false)guiSetProperty(hapis_panel, "ImageColours", panel.panel_renk)guiSetVisible(hapis_panel, false)--//Süre Butonusure_buton = guiCreateStaticImage(sure_x, sure_y-250, panel.sure_yatay, panel.sure_dikey, terimler.renk, false)guiSetProperty(sure_buton, "ImageColours", panel.panel_renk)guiSetVisible(sure_buton, false)guiSetAlpha(sure_buton, 0.7)sure_label = guiCreateLabel(0, -15, panel.sure_yatay, panel.sure_dikey, "", false, sure_buton)guiLabelSetHorizontalAlign(sure_label, "center")guiLabelSetVerticalAlign(sure_label, "bottom")guiSetFont(sure_label, terimler.font)function sure_goster()local sure = tostring(getElementData(source, "HapisSure"))guiSetVisible(sure_buton, true)guiSetText(sure_label, "Kalan Süre: "..sure.." Saniye")endaddEvent("SureGoster", true, sure_goster)addEventHandler("SureGoster", terimler.oyuncu, sure_goster)function sure_gizle()guiSetText(sure_label, "Kalan Süre: 0 Saniye")setTimer(guiSetText, 1000, 1, sure_label, "Süre Doldu!")setTimer(guiSetVisible, 3000, 1, sure_buton, false)endaddEvent("SureGizle", true, sure_gizle)addEventHandler("SureGizle", terimler.oyuncu, sure_gizle)function sure_kaldir()guiSetText(sure_label, "Hapisten Çıkartıldınız!")setTimer(guiSetVisible, 2000, 1, sure_buton, false)endaddEvent("SureKaldir", true, sure_kaldir)addEventHandler("SureKaldir", terimler.oyuncu, sure_kaldir)--//Başlıklarpanel_baslik = guiCreateStaticImage(0, 0, panel.yatay, 35, terimler.renk, false, hapis_panel)guiSetProperty(panel_baslik, "ImageColours", panel.baslik_renk)baslik_label = guiCreateLabel(0, -10, panel.yatay, 35, panel.paneladi, false, panel_baslik)guiLabelSetHorizontalAlign(baslik_label, "center")guiLabelSetVerticalAlign(baslik_label, "bottom")guiSetFont(baslik_label, terimler.font)bilgi_baslik = guiCreateStaticImage(0, panel.dikey-20, panel.yatay, 20, terimler.buton, false, hapis_panel)bilgibaslik_label = guiCreateLabel(0, -5, panel.yatay, 20, "Hapis Sistemi V1 © ByCash - "..panel.sunucuadi.." 2018", false, bilgi_baslik)guiLabelSetHorizontalAlign(bilgibaslik_label, "center")guiLabelSetVerticalAlign(bilgibaslik_label, "bottom")guiSetFont(bilgibaslik_label, terimler.font)--//Kapat Butonukapat_buton = guiCreateStaticImage(panel.yatay-50, 0, 50, 35, terimler.renk, false, panel_baslik)guiSetProperty(kapat_buton, "ImageColours", panel.diger_buton_renk)kapat_label = guiCreateLabel(0, -12, 50, 35, "X", false, kapat_buton)guiLabelSetHorizontalAlign(kapat_label, "center")guiLabelSetVerticalAlign(kapat_label, "bottom")guiSetFont(kapat_label, terimler.font)--//GridList 1bilgi1 = guiCreateStaticImage(30, 50, 182, 25, terimler.buton, false, hapis_panel)bilgi1_label = guiCreateLabel(0, 5, 182, 30, "Oyuncu Listesi", false, bilgi1)guiLabelSetHorizontalAlign(bilgi1_label, "center")guiSetFont(bilgi1_label, terimler.font)gizle1 = guiCreateStaticImage(30, 80, 182, panel.dikey-115, terimler.buton, false, hapis_panel)grid1 = guiCreateGridList(0-10, 0-25, 182+20, panel.dikey-115+50, false, gizle1)guiGridListAddColumn(grid1, "Oyuncu Listesi", 0.9)--//Tutuklanma Sebebibilgi2 = guiCreateStaticImage(232, 50, 182, 25, terimler.buton, false, hapis_panel)bilgi2_label = guiCreateLabel(0, 5, 182, 30, "Tutuklanma Sebebi", false, bilgi2)guiLabelSetHorizontalAlign(bilgi2_label, "center")guiSetFont(bilgi2_label, terimler.font)edit_gizle1 = guiCreateStaticImage(232, 80, 182, 30, terimler.buton, false, hapis_panel)sebep_edit = guiCreateEdit(0-7, 0-20, 195, 65, "Bir sebep giriniz.", false, edit_gizle1)guiEditSetMaxLength(sebep_edit, ayarlar.sebep_limit)addEventHandler("onClientGUIClick", getRootElement(),function()if source == sebep_edit thenguiSetText(sebep_edit, "")endend)edit1_resim = guiCreateStaticImage(0, 0, 195, 65, terimler.renk, false, sebep_edit)guiSetProperty(edit1_resim, "ImageColours", panel.panel_renk)guiSetEnabled(edit1_resim, false)guiSetAlpha(edit1_resim, 0.7)--//GridList 3bilgi3 = guiCreateStaticImage(232, 125, 182, 25, terimler.buton, false, hapis_panel)bilgi3_label = guiCreateLabel(0, 5, 182, 30, "Süre Listesi | Dakika", false, bilgi3)guiLabelSetHorizontalAlign(bilgi3_label, "center")guiSetFont(bilgi3_label, terimler.font)gizle3 = guiCreateStaticImage(232, 155, 182, panel.dikey-115-170+35, terimler.buton, false, hapis_panel)grid3 = guiCreateGridList(0-10, 0-25, 182+20, panel.dikey-115+50-170+35, false, gizle3)guiGridListAddColumn(grid3, "Süre", 0.5)--//Buton 1buton1 = guiCreateStaticImage(232, 310, 182, 25, terimler.renk, false, hapis_panel)buton1_label = guiCreateLabel(0, 5, 182, 30, "Hapse At", false, buton1)guiSetProperty(buton1, "ImageColours", panel.diger_buton_renk)guiLabelSetHorizontalAlign(buton1_label, "center")guiSetFont(buton1_label, terimler.font)--//Buton 2buton2 = guiCreateStaticImage(232, 340, 182, 25, terimler.renk, false, hapis_panel)buton2_label = guiCreateLabel(0, 5, 182, 30, "Hapisten Çıkart", false, buton2)guiSetProperty(buton2, "ImageColours", panel.diger_buton_renk)guiLabelSetHorizontalAlign(buton2_label, "center")guiSetFont(buton2_label, terimler.font)--//Fonksiyonlarfunction oyuncu_listesi()guiGridListClear(grid1)for _,player in ipairs(getElementsByType("player")) dorow1 = guiGridListAddRow(grid1)if player thenguiGridListSetItemText(grid1,row1,1,(string.gsub (getPlayerName(player), "#%x%x%x%x%x%x", "")), false, false)guiGridListSetItemData(grid1,row1,1, getPlayerName(player))endendendfor _,sure in pairs (ayarlar.sureler) dolocal row = guiGridListAddRow(grid3)guiGridListSetItemText(grid3, row, 1, sure[1], false, false)guiGridListSetSortingEnabled(grid3, false)endfunction hapse_at()if source == buton1_label thenlocal oyuncu = getPlayerFromName(guiGridListGetItemData(grid1, guiGridListGetSelectedItem(grid1), 1))if oyuncu thenlocal sure = guiGridListGetItemText(grid3, guiGridListGetSelectedItem(grid3), 1)local sebep = guiGetText(sebep_edit)if sebep == "Bir sebep giriniz." thentriggerServerEvent("mesaj1", terimler.oyuncu)elsetriggerServerEvent("at_event", oyuncu, oyuncu, sure, sebep, getLocalPlayer())endendendendaddEventHandler("onClientGUIClick", getRootElement(), hapse_at)function hapisten_cikar()if source == buton2_label thenlocal oyuncu = getPlayerFromName(guiGridListGetItemData(grid1, guiGridListGetSelectedItem(grid1), 1))if oyuncu thentriggerServerEvent("cikar_event", oyuncu, oyuncu)endendendaddEventHandler("onClientGUIClick", getRootElement(), hapisten_cikar)--//Maus EfektiaddEventHandler ("onClientMouseEnter", root,function()if source == baslik_label thenguiSetAlpha(panel_baslik, 0.5)elseif source == bilgibaslik_label thenguiSetAlpha(bilgi_baslik, 0.5)elseif source == buton1_label thenguiSetAlpha(buton1, 0.5)elseif source == buton2_label thenguiSetAlpha(buton2, 0.5)elseif source == kapat_label thenguiSetAlpha(kapat_buton, 0.5)endend)addEventHandler ("onClientMouseLeave", root,function()if source == baslik_label thenguiSetAlpha(panel_baslik, 1)elseif source == bilgibaslik_label thenguiSetAlpha(bilgi_baslik, 1)elseif source == buton1_label thenguiSetAlpha(buton1, 1)elseif source == buton2_label thenguiSetAlpha(buton2, 1)elseif source == kapat_label thenguiSetAlpha(kapat_buton, 1)endend)--//Açma Kapatma Fonksiyonufunction panel_ac()if (guiGetVisible (hapis_panel) == true) thenguiSetVisible(hapis_panel, false)guiSetInputEnabled(false)showCursor(false)elseif (guiGetVisible (hapis_panel) == false) thenguiSetVisible(hapis_panel, true)guiSetInputEnabled(true)showCursor(true)oyuncu_listesi()endendaddEvent("panel_ac", true)addEventHandler("panel_ac", terimler.oyuncu, panel_ac)addEventHandler("onClientGUIClick", getRootElement(),function()if source == kapat_label thenguiSetVisible(hapis_panel, false)guiSetInputEnabled(false)showCursor(false)endend)--//Kontrol Fonksiyonufunction kontrol_kapat()toggleAllControls(false)endaddEvent("kontrol_kapat", true)addEventHandler("kontrol_kapat", getLocalPlayer(), kontrol_kapat)function kontrol_ac()toggleAllControls(true)endaddEvent("kontrol_ac", true)addEventHandler("kontrol_ac", getLocalPlayer(), kontrol_ac)--//Karakter Kaplamasılocal txd = engineLoadTXD("Dosyalar/karakter/mahkum.txd")engineImportTXD(txd, ayarlar.karakter)local dff = engineLoadDFF("Dosyalar/karakter/mahkum.dff")engineReplaceModel(dff, ayarlar.karakter)
--//Panel Açma/Kapatma Fonksiyonufunction panel_ac(oyuncu)hesap = getAccountName(getPlayerAccount(oyuncu))if isObjectInACLGroup("user."..hesap, aclGetGroup(ayarlar.acl)) thentriggerClientEvent("panel_ac", oyuncu)elseoutputChatBox(chatbox.hata_mesaj3, oyuncu, 10, 10, 10, true)endendaddCommandHandler(ayarlar.komut, panel_ac)function mesaj1()outputChatBox(chatbox.hata_mesaj4, source, 70, 70, 70, true)endaddEvent("mesaj1", true)addEventHandler("mesaj1", getRootElement(), mesaj1)--//Fonksiyonlarlocal random1 = math.random(#ayarlar.giris_kordinatlari)local random2 = math.random(#ayarlar.cikis_kordinatlari)function arac_kaldir(oyuncu)local arac = getPedOccupiedVehicle(oyuncu)if arac thendestroyElement(arac)endendsureler = {}timer = {}function hapis(oyuncu, sure, sebep, diger) local hesap = getPlayerAccount(oyuncu) if isTimer(timer[oyuncu]) then outputChatBox(chatbox.hata_mesaj1, source, 70, 70, 70, true) else sureler[oyuncu] = sureler[oyuncu] or tonumber(sure*60) timer[oyuncu] = setTimer(function(oyuncu) sureler[oyuncu] = tonumber(sureler[oyuncu])-1 if sureler[oyuncu] <= 0 then -- eğer süre 0 dan küçükse if isTimer(timer[oyuncu]) then killTimer(timer[oyuncu]) end setElementPosition(oyuncu, unpack(ayarlar.cikis_kordinatlari[random2])) triggerClientEvent(oyuncu, "SureGizle", oyuncu) removeElementData(oyuncu, "HapisSure") outputChatBox(chatbox.bilgi_mesaj2, oyuncu, 70, 70, 70, true) timer[oyuncu] = nil sureler[oyuncu] = nil setAccountData(hesap, "HapisSure", "Yok") setElementModel(oyuncu, ayarlar.c_karakter) triggerClientEvent(oyuncu, "kontrol_ac", oyuncu) else -- 0dan büyükse arac_kaldir(oyuncu) setAccountData(hesap, "HapisSure", sureler[source]) setElementData(oyuncu, "HapisSure", sureler[oyuncu]) setElementPosition(oyuncu, unpack(ayarlar.giris_kordinatlari[random1])) triggerClientEvent(oyuncu, "SureGoster", oyuncu) setElementModel(oyuncu, ayarlar.g_karakter) triggerClientEvent(oyuncu, "kontrol_kapat", oyuncu) end end, 1000, 0, oyuncu) if sebep and diger then -- oyuncu hapisteyken oyundan çıkıp girdiğinde tekrar hapise atıldığında sebep ve diger olmuyor o yüzden if koyduk outputChatBox(chatbox.bilgi_mesaj1.."["..getPlayerName(diger)..": "..sebep.."]", oyuncu, 10, 10, 10, true) end endendaddEvent("at_event", true, hapis)addEventHandler("at_event", getRootElement(), hapis)function hapis_cikar(oyuncu, local_oyuncu) if getElementData(oyuncu, "HapisSure") then local hesap = getPlayerAccount(oyuncu) if isTimer(timer[oyuncu]) then killTimer(timer[oyuncu]) end timer[oyuncu] = nil sureler[oyuncu] = nil removeElementData(oyuncu, "HapisSure") setElementPosition(oyuncu, unpack(ayarlar.cikis_kordinatlari[random2])) triggerClientEvent(oyuncu, "SureKaldir", oyuncu) setAccountData(hesap, "HapisSure", "Yok") setElementModel(oyuncu, ayarlar.c_karakter) triggerClientEvent(oyuncu, "kontrol_ac", oyuncu) else outputChatBox(chatbox.hata_mesaj2, local_oyuncu, 70, 70, 70, true) endendaddEvent("cikar_event", true, hapis_cikar)addEventHandler("cikar_event", getRootElement(), hapis_cikar)addEventHandler("onPlayerQuit", getRootElement(), function() local hesap = getPlayerAccount(source) if isTimer(timer[source]) then setAccountData(hesap, "HapisSure", sureler[source]) if isTimer(timer[source]) then killTimer(timer[source]) end end end)addEventHandler("onPlayerLogin", getRootElement(), function(_,hesap) local hapisveri = getAccountData(hesap, "HapisSure") if hapisveri ~= "Yok" then sureler[source] = tonumber(hapisveri) hapis(source) endend)