Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2020-12-31, 09:24


skakacz







Wiek: 27
Na forum: 2315 dni
Posty: 19
Nick w MP: skakacz

Piwa: 1

Respekt: 50

Witam, mam pewien problem. zmieniajac range w panelu frakcji nie pokazuje nazwy rangi Frakcja nazywa si? PstoriesNews

c_zarzadzanie.lua
Kod:

-- Pierwotny w?‚a?›ciciel i twĂłrca kodu: AmaMa
-- Zakaz uĹĽywania / edycji kodu bez wcze?›niejszej zgody ze strony w?‚a?›ciciela
-- Zakaz wykorzystywania ca?‚ego lub fragmentĂłw kodu
-- W przypadku z?‚amania powyzszych zasad sprawa zostanie skierowana do s?…du pod zarzutem: Naruszenia maj?…tkowych praw autorskich
-- Pierwotnie pe?‚ne prawo do uĹĽywania tego kodu posiada tylko AmaMa

mojeW,mojeH = 1360,768
sW,sH = guiGetScreenSize()
width, height = (sW/mojeW), (sH/mojeH)
panelzsapd = false

local wm={
button={},
gridlist={},
edit={},
box={},
faction=nil,
}

function gui()
exports["buttons"]:createCustomWindow("Panel zarzadzania", 282*width, 228*height, 793*width, 383*height, tocolor(255, 255, 255, 255), false)
end
function gui2()
exports["buttons"]:createCustomWindow("Dodaj cz?‚onka", 432*width, 228*height, 493*width, 343*height, tocolor(255, 255, 255, 255), false)
exports["buttons"]:createCustomText("Tutaj wpisz UID gracza:", 665*width,605*height,693*width,55*height, tocolor(255, 255, 255, 255), 1, "default", "center", "center", false, false, false, false, false)
end
function gui3()
exports["buttons"]:createCustomWindow("Edytuj cz?‚onka", 432*width, 228*height, 493*width, 343*height, tocolor(255, 255, 255, 255), false)
exports["buttons"]:createCustomText("Wybierz wyp?‚at?™:", 338*width,540*height,693*width,55*height, tocolor(255, 255, 255, 255), 1, "default", "center", "center", false, false, false, false, false)
exports["buttons"]:createCustomText("Tutaj wpisz rang?™:", 995*width,540*height,693*width,55*height, tocolor(255, 255, 255, 255), 1, "default", "center", "center", false, false, false, false, false)
end

wm.gridlist[1]=guiCreateGridList(0.22, 0.38, 0.56, 0.23, true)
guiGridListAddColumn(wm.gridlist[1], "Nick", 0.15)
guiGridListAddColumn(wm.gridlist[1], "UID", 0.06)
guiGridListAddColumn(wm.gridlist[1], "Ranga", 0.06)
guiGridListAddColumn(wm.gridlist[1], "Stopie?„", 0.20)
guiGridListAddColumn(wm.gridlist[1], "Wyp?‚ata", 0.08)
guiGridListAddColumn(wm.gridlist[1], "Dodany", 0.2)
guiGridListAddColumn(wm.gridlist[1], "Ostatnio na duty", 0.2)
guiSetVisible(wm.gridlist[1],false)
wm.button[1]=guiCreateButton(0.22, 0.65, 0.15, 0.10, "Dodaj", true)
wm.button[2]=guiCreateButton(0.42, 0.65, 0.16, 0.10, "Edytuj", true)
wm.button[3]=guiCreateButton(0.63, 0.65, 0.15, 0.10, "Wyrzu?‡", true)
guiSetVisible(wm.button[1],false)
guiSetVisible(wm.button[2],false)
guiSetVisible(wm.button[3],false)
wm.edit[1]=guiCreateEdit(0.40, 0.45, 0.20, 0.05, "", true)
wm.button[4]=guiCreateButton(0.34, 0.56, 0.15, 0.10, "Dodaj", true)
wm.button[5]=guiCreateButton(0.51, 0.56, 0.15, 0.10, "Zamknij", true)
guiSetVisible(wm.edit[1],false)
guiSetVisible(wm.button[4],false)
guiSetVisible(wm.button[5],false)
wm.box[1] = guiCreateComboBox(0.33, 0.41, 0.10, 0.14, "", true)
guiSetVisible(wm.box[1],false)
wm.edit[2] = guiCreateEdit(0.57, 0.41, 0.10, 0.03, "", true)
guiSetVisible(wm.edit[2],false)
wm.button[6] = guiCreateButton(0.34, 0.45, 0.08, 0.05, "Zapisz", true)
guiSetVisible(wm.button[6],false)
wm.button[7] = guiCreateButton(0.58, 0.45, 0.08, 0.05, "Zapisz", true)
guiSetVisible(wm.button[7],false)
wm.button[8]=guiCreateButton(0.43, 0.59, 0.14, 0.08, "Zamknij", true)
guiSetVisible(wm.button[8],false)

function fillUsersData(result)
guiGridListClear(wm.gridlist[1])
for i,v in pairs(result) do
local row=guiGridListAddRow(wm.gridlist[1])
guiGridListSetItemText(wm.gridlist[1], row, 1, v["login"], false, false)
guiGridListSetItemText(wm.gridlist[1], row, 2, v["uid"], false, false)
guiGridListSetItemText(wm.gridlist[1], row, 3, v["rank"], false, false)
guiGridListSetItemText(wm.gridlist[1], row, 4, v["nazwa"], false, false)
guiGridListSetItemText(wm.gridlist[1], row, 5, string.format("%01.02f", v["wyplata"]/100), false, false)
guiGridListSetItemText(wm.gridlist[1], row, 6, v["actived"], false, false)
guiGridListSetItemText(wm.gridlist[1], row, 7, v["lastduty"], false, false)
end
end

function combo(faction)
guiComboBoxClear(wm.box[1])
if faction == "Policja" then
guiComboBoxAddItem(wm.box[1],34.95)
guiComboBoxAddItem(wm.box[1],35.21)
guiComboBoxAddItem(wm.box[1],36.06)
guiComboBoxAddItem(wm.box[1],37.92)
guiComboBoxAddItem(wm.box[1],38.77)
guiComboBoxAddItem(wm.box[1],39.63)
guiComboBoxAddItem(wm.box[1],41.48)
guiComboBoxAddItem(wm.box[1],42.34)
guiComboBoxAddItem(wm.box[1],43.19)
guiComboBoxAddItem(wm.box[1],44.05)
guiComboBoxAddItem(wm.box[1],45.90)
guiComboBoxAddItem(wm.box[1],46.76)
guiComboBoxAddItem(wm.box[1],47.61)
guiComboBoxAddItem(wm.box[1],48.47)
guiComboBoxAddItem(wm.box[1],49.32)
guiComboBoxAddItem(wm.box[1],50.18)
guiComboBoxAddItem(wm.box[1],51.03)
elseif faction == "PSP" then
guiComboBoxAddItem(wm.box[1],18.15)
guiComboBoxAddItem(wm.box[1],25.50)
guiComboBoxAddItem(wm.box[1],26.23)
guiComboBoxAddItem(wm.box[1],27.97)
guiComboBoxAddItem(wm.box[1],28.70)
guiComboBoxAddItem(wm.box[1],28.44)
guiComboBoxAddItem(wm.box[1],29.17)
guiComboBoxAddItem(wm.box[1],29.91)
guiComboBoxAddItem(wm.box[1],30.64)
guiComboBoxAddItem(wm.box[1],31.38)
guiComboBoxAddItem(wm.box[1],32.11)
guiComboBoxAddItem(wm.box[1],33.85)
guiComboBoxAddItem(wm.box[1],34.58)
guiComboBoxAddItem(wm.box[1],35.32)
guiComboBoxAddItem(wm.box[1],36.05)
guiComboBoxAddItem(wm.box[1],37.79)
guiComboBoxAddItem(wm.box[1],38.52)
guiComboBoxAddItem(wm.box[1],39.26)
guiComboBoxAddItem(wm.box[1],40.99)
elseif faction == "PR" then
guiComboBoxAddItem(wm.box[1],20.15)
guiComboBoxAddItem(wm.box[1],23.97)
guiComboBoxAddItem(wm.box[1],26.70)
guiComboBoxAddItem(wm.box[1],29.44)
guiComboBoxAddItem(wm.box[1],32.17)
guiComboBoxAddItem(wm.box[1],35.38)
guiComboBoxAddItem(wm.box[1],38.11)
guiComboBoxAddItem(wm.box[1],41.85)
guiComboBoxAddItem(wm.box[1],44.58)
guiComboBoxAddItem(wm.box[1],47.30)
guiComboBoxAddItem(wm.box[1],50.75)
elseif faction == "SM" then
guiComboBoxAddItem(wm.box[1],9.22)
guiComboBoxAddItem(wm.box[1],9.99)
guiComboBoxAddItem(wm.box[1],10.37)
guiComboBoxAddItem(wm.box[1],10.89)
guiComboBoxAddItem(wm.box[1],11.41)
guiComboBoxAddItem(wm.box[1],12.09)
guiComboBoxAddItem(wm.box[1],12.55)
guiComboBoxAddItem(wm.box[1],12.84)
guiComboBoxAddItem(wm.box[1],13.33)
guiComboBoxAddItem(wm.box[1],13.87)
guiComboBoxAddItem(wm.box[1],14.11)
guiComboBoxAddItem(wm.box[1],14.76)
guiComboBoxAddItem(wm.box[1],15.18)
guiComboBoxAddItem(wm.box[1],15.69)
guiComboBoxAddItem(wm.box[1],17.01)
guiComboBoxAddItem(wm.box[1],18.99)
elseif faction == "PD" then
guiComboBoxAddItem(wm.box[1],15.35)
guiComboBoxAddItem(wm.box[1],22.73)
guiComboBoxAddItem(wm.box[1],24.37)
guiComboBoxAddItem(wm.box[1],25.60)
guiComboBoxAddItem(wm.box[1],26.83)
guiComboBoxAddItem(wm.box[1],28.06)
guiComboBoxAddItem(wm.box[1],29.29)
guiComboBoxAddItem(wm.box[1],30.52)
guiComboBoxAddItem(wm.box[1],31.75)
elseif faction == "TAXI" then
guiComboBoxAddItem(wm.box[1],14.22)
guiComboBoxAddItem(wm.box[1],15.99)
guiComboBoxAddItem(wm.box[1],16.37)
guiComboBoxAddItem(wm.box[1],17.89)
guiComboBoxAddItem(wm.box[1],18.41)
guiComboBoxAddItem(wm.box[1],19.09)
guiComboBoxAddItem(wm.box[1],20.55)
guiComboBoxAddItem(wm.box[1],21.84)
guiComboBoxAddItem(wm.box[1],22.33)
guiComboBoxAddItem(wm.box[1],23.87)
guiComboBoxAddItem(wm.box[1],24.69)
guiComboBoxAddItem(wm.box[1],25.01)
guiComboBoxAddItem(wm.box[1],29.99)
elseif faction == "PstoriesNews" then
guiComboBoxAddItem(wm.box[1],14.22)
guiComboBoxAddItem(wm.box[1],15.99)
guiComboBoxAddItem(wm.box[1],16.37)
guiComboBoxAddItem(wm.box[1],17.89)
guiComboBoxAddItem(wm.box[1],18.41)
guiComboBoxAddItem(wm.box[1],19.09)
guiComboBoxAddItem(wm.box[1],20.55)
guiComboBoxAddItem(wm.box[1],21.84)
guiComboBoxAddItem(wm.box[1],22.33)
guiComboBoxAddItem(wm.box[1],23.87)
guiComboBoxAddItem(wm.box[1],24.69)
guiComboBoxAddItem(wm.box[1],25.01)
guiComboBoxAddItem(wm.box[1],29.99)

end
end

addEvent("lider:showGUI", true)
addEventHandler("lider:showGUI", resourceRoot, function(fid,result)
if panelzsapd == false then
-- Ustawienia
showCursor(true,false)
toggleControl("sprint", false)
toggleControl("jump", false)
toggleControl("action", false)
toggleControl("fire", false)
addEventHandler("onClientRender",root,gui)
guiSetVisible(wm.gridlist[1],true)
guiSetVisible(wm.button[1],true)
guiSetVisible(wm.button[2],true)
guiSetVisible(wm.button[3],true)
guiSetEnabled(wm.button[2], false)
guiSetEnabled(wm.button[3], false)
wm.faction=fid
fillUsersData(result)
panelzsapd = true
end
end)
addEvent("lider:refresh", true)
addEventHandler("lider:refresh", resourceRoot, fillUsersData)

addEventHandler("onClientMarkerLeave", resourceRoot, function(el,md)
if el~=localPlayer then return end
if panelzsapd == true then
showCursor(false)
toggleControl("sprint", true)
toggleControl("jump", true)
toggleControl("action", true)
toggleControl("fire", true)
guiSetVisible(wm.gridlist[1],false)
guiSetVisible(wm.button[1],false)
guiSetVisible(wm.button[2],false)
guiSetVisible(wm.button[3],false)
guiSetEnabled(wm.button[2], false)
guiSetEnabled(wm.button[3], false)
guiSetVisible(wm.edit[1],false)
guiSetVisible(wm.button[4],false)
guiSetVisible(wm.button[5],false)
removeEventHandler("onClientRender",root,gui3)
removeEventHandler("onClientRender",root,gui2)
guiSetVisible(wm.box[1],false)
guiSetVisible(wm.edit[2],false)
guiSetVisible(wm.button[6],false)
guiSetVisible(wm.button[7],false)
guiSetVisible(wm.button[8],false)
removeEventHandler("onClientRender",root,gui)
panelzsapd = false
end
end)

addEventHandler("onClientGUIClick", resourceRoot, function()
if source == wm.gridlist[1] then
local selectedRow=guiGridListGetSelectedItem(wm.gridlist[1])
if not selectedRow or selectedRow < 0 then
guiSetEnabled(wm.button[2], false)
guiSetEnabled(wm.button[3], false)
else
guiSetEnabled(wm.button[2], true)
guiSetEnabled(wm.button[3], true)
end
end
if source == wm.button[1] then
guiSetVisible(wm.gridlist[1],false)
guiSetVisible(wm.button[1],false)
guiSetVisible(wm.button[2],false)
guiSetVisible(wm.button[3],false)
removeEventHandler("onClientRender",root,gui)
addEventHandler("onClientRender",root,gui2)
guiSetVisible(wm.edit[1],true)
guiSetVisible(wm.button[4],true)
guiSetVisible(wm.button[5],true)
end
if source == wm.button[4] then
local text=guiGetText(wm.edit[1])
if not text then return end
triggerServerEvent("lider:addUser", resourceRoot, text, wm.faction)
removeEventHandler("onClientRender",root,gui2)
guiSetVisible(wm.edit[1],false)
guiSetVisible(wm.button[4],false)
guiSetVisible(wm.button[5],false)
panelzsapd = false
triggerServerEvent("panel:refreshgui",resourceRoot,wm.faction)
end
if source == wm.button[5] then
removeEventHandler("onClientRender",root,gui2)
guiSetVisible(wm.edit[1],false)
guiSetVisible(wm.button[4],false)
guiSetVisible(wm.button[5],false)
panelzsapd = false
triggerServerEvent("panel:refreshgui",resourceRoot,wm.faction)
end
if source == wm.button[3] then
local selectedRow=guiGridListGetSelectedItem(wm.gridlist[1])
if not selectedRow or selectedRow < 0 then return end
local rank=guiGridListGetItemText(wm.gridlist[1], selectedRow, 3)
if wm.faction == "Policja" then
if tonumber(rank) == 17 then outputChatBox("Gracz ma lidera!!!!",255,0,0) return end
elseif wm.faction == "PSP" then
if tonumber(rank) == 19 then outputChatBox("Gracz ma lidera!!!!",255,0,0) return end
elseif wm.faction == "PR" then
if tonumber(rank) == 11 then outputChatBox("Gracz ma lidera!!!!",255,0,0) return end
elseif wm.faction == "SMSA" then
if tonumber(rank) == 16 then outputChatBox("Gracz ma lidera!!!!",255,0,0) return end
elseif wm.faction == "PD" then
if tonumber(rank) == 9 then outputChatBox("Gracz ma lidera!!!!",255,0,0) return end
elseif wm.faction == "OSP" then
if tonumber(rank) == 11 then outputChatBox("Gracz ma lidera!!!!",255,0,0) return end
end
local name=guiGridListGetItemText(wm.gridlist[1], selectedRow, 2)
if not name then return end
triggerServerEvent("lider:deleteUser", resourceRoot, name, wm.faction)
removeEventHandler("onClientRender",root,gui)
guiSetVisible(wm.gridlist[1],false)
guiSetVisible(wm.button[1],false)
guiSetVisible(wm.button[2],false)
guiSetVisible(wm.button[3],false)
panelzsapd = false
triggerServerEvent("panel:refreshgui",resourceRoot,wm.faction)
end
if source == wm.gridlist[1] then
local selectedRow=guiGridListGetSelectedItem(wm.gridlist[1])
if not selectedRow or selectedRow < 0 then
guiSetEnabled(wm.button[2], false)
guiSetEnabled(wm.button[3], false)
else
guiSetEnabled(wm.button[2], true)
guiSetEnabled(wm.button[3], true)
end
end
if source == wm.button[2] then
guiSetVisible(wm.gridlist[1],false)
guiSetVisible(wm.button[1],false)
guiSetVisible(wm.button[2],false)
guiSetVisible(wm.button[3],false)
removeEventHandler("onClientRender",root,gui)
addEventHandler("onClientRender",root,gui3)
guiSetVisible(wm.box[1],true)
guiSetVisible(wm.edit[2],true)
guiSetVisible(wm.button[6],true)
guiSetVisible(wm.button[7],true)
guiSetVisible(wm.button[8],true)
combo(wm.faction)
end
if source == wm.button[8] then
removeEventHandler("onClientRender",root,gui3)
guiSetVisible(wm.box[1],false)
guiSetVisible(wm.edit[2],false)
guiSetVisible(wm.button[6],false)
guiSetVisible(wm.button[7],false)
guiSetVisible(wm.button[8],false)
panelzsapd = false
triggerServerEvent("panel:refreshgui",resourceRoot,wm.faction)
end
if source == wm.button[6] then
local item = guiComboBoxGetSelected(wm.box[1])
local text = guiComboBoxGetItemText(wm.box[1], item)
local selectedRow=guiGridListGetSelectedItem(wm.gridlist[1])
if not selectedRow or selectedRow < 0 then return end
if not text then return end
local name=guiGridListGetItemText(wm.gridlist[1], selectedRow, 2)
if not name then return end
triggerServerEvent("lider:editweave", resourceRoot, name, text, wm.faction)
removeEventHandler("onClientRender",root,gui3)
guiSetVisible(wm.box[1],false)
guiSetVisible(wm.edit[2],false)
guiSetVisible(wm.button[6],false)
guiSetVisible(wm.button[7],false)
guiSetVisible(wm.button[8],false)
panelzsapd = false
triggerServerEvent("panel:refreshgui",resourceRoot,wm.faction)
end
if source == wm.button[7] then
local text=guiGetText(wm.edit[2])
local selectedRow=guiGridListGetSelectedItem(wm.gridlist[1])
if not selectedRow or selectedRow < 0 then return end
local name=guiGridListGetItemText(wm.gridlist[1], selectedRow, 2)
if not name then return end
if not text then return end
if wm.faction == "Policja" then
if tonumber(text) and tonumber(text) > 16 then outputChatBox("Maksymalna ranga to 16!",255,0,0) return end
elseif wm.faction == "PSP" then
if tonumber(text) and tonumber(text) > 18 then outputChatBox("Maksymalna ranga to 18!",255,0,0) return end
elseif wm.faction == "PR" then
if tonumber(text) and tonumber(text) > 10 then outputChatBox("Maksymalna ranga to 10!",255,0,0) return end
elseif wm.faction == "SMSA" then
if tonumber(text) and tonumber(text) > 15 then outputChatBox("Maksymalna ranga to 15!",255,0,0) return end
elseif wm.faction == "PD" then
if tonumber(text) and tonumber(text) > 9 then outputChatBox("Maksymalna ranga to 9!",255,0,0) return end
elseif wm.faction == "OSP" then
if tonumber(text) and tonumber(text) > 11 then outputChatBox("Maksymalna ranga to 12!",255,0,0) return end
elseif wm.faction == "PstoriesNews" then
if tonumber(text) and tonumber(text) > 10 then outputChatBox("Maksymalna ranga to 10!",255,0,0) return end

end
triggerServerEvent("lider:editUser", resourceRoot, name, text, wm.faction)
end
end)


s.lua
Kod:



setTimer(function()
local x = exports['ogrpg-db']:dbGet("SELECT * FROM ogrpg_factions")
if x and #x > 0 then
for i,v in ipairs(x) do
local rank = x[i].rank
local code = x[i].code
if rank == 0 and code == "Policja" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?","Zawieszony",x[i].id)
end
if rank == 1 and code == "Policja" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?","Adept",x[i].id)
end
if rank == 2 and code == "Policja" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Posterunkowy",x[i].id)
end
if rank == 3 and code == "Policja" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Sierzant",x[i].id)
end
if rank == 4 and code == "Policja" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Starszy Sierzant",x[i].id)
end
if rank == 5 and code == "Policja" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Sierzant Sztabowy",x[i].id)
end
if rank == 6 and code == "Policja" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Mlodszy Aspirant",x[i].id)
end
if rank == 7 and code == "Policja" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Aspirant",x[i].id)
end
if rank == 8 and code == "Policja" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Starszy Aspirant",x[i].id)
end
if rank == 9 and code == "Policja" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Aspirant Sztabowy",x[i].id)
end
if rank == 10 and code == "Policja" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Podkomisarz",x[i].id)
end
if rank == 11 and code == "Policja" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Komisarz",x[i].id)
end
if rank == 12 and code == "Policja" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Nadkomisarz",x[i].id)
end
if rank == 13 and code == "Policja" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "PodInspektor",x[i].id)
end
if rank == 14 and code == "Policja" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Mlodszy Inspektor",x[i].id)
end
if rank == 15 and code == "Policja" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Inspektor",x[i].id)
end
if rank == 16 and code == "Policja" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Nadinspektor",x[i].id)
end
if rank == 17 and code == "Policja" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Generalny Inspektor Policji",x[i].id)
end
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
if rank == 0 and code == "PR" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?","Zawieszony",x[i].id)
end
if rank == 1 and code == "PR" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Praktykant",x[i].id)
end
if rank == 2 and code == "PR" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Kierowca Karetki",x[i].id)
end
if rank == 3 and code == "PR" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Ratownik",x[i].id)
end
if rank == 4 and code == "PR" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Ratownik Medyczny",x[i].id)
end
if rank == 5 and code == "PR" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Ratownik Medyczny - Lekarz",x[i].id)
end
if rank == 6 and code == "PR" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Lekarz Systemu",x[i].id)
end
if rank == 7 and code == "PR" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Lekarz Koordynator",x[i].id)
end
if rank == 8 and code == "PR" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Ordynator Szpitala",x[i].id)
end
if rank == 9 and code == "PR" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Dyrektor Stacji Pogotowia Ratunkowego",x[i].id)
end
if rank == 10 and code == "PR" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Zastepca Dyrektora Szpitala",x[i].id)
end
if rank == 11 and code == "PR" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Dyrektor Szpitala",x[i].id)
end
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
if rank == 0 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?","Zawieszony",x[i].id)
end
if rank == 1 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Strazak",x[i].id)
end
if rank == 2 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Starszy strazak",x[i].id)
end
if rank == 3 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Sekcyjny",x[i].id)
end
if rank == 4 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Starszy sekcyjny",x[i].id)
end
if rank == 5 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Mlodszy ogniomistrz",x[i].id)
end
if rank == 6 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Ogniomistrz",x[i].id)
end
if rank == 7 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Starszy ogniomistrz",x[i].id)
end
if rank == 8 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Mlodszy aspirant",x[i].id)
end
if rank == 9 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Aspirant",x[i].id)
end
if rank == 10 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Starszy aspirant",x[i].id)
end
if rank == 11 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Aspirant sztabowy",x[i].id)
end
if rank == 12 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Mlodszy kapitan",x[i].id)
end
if rank == 13 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Kapitan",x[i].id)
end
if rank == 14 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Starszy kapitan",x[i].id)
end
if rank == 15 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Mlodszy brygadier",x[i].id)
end
if rank == 16 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Brygadier",x[i].id)
end
if rank == 17 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Starszy brygadier",x[i].id)
end
if rank == 18 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Nadbrygadier",x[i].id)
end
if rank == 19 and code == "PSP" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "General brygadier",x[i].id)
end
---------------------------------------------
if rank == 0 and code == "PD" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?","Zawieszony",x[i].id)
end
if rank == 1 and code == "PD" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Adept",x[i].id)
end
if rank == 2 and code == "PD" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Budowlany",x[i].id)
end
if rank == 3 and code == "PD" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Laweciarz",x[i].id)
end
if rank == 4 and code == "PD" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Specjalista",x[i].id)
end
if rank == 5 and code == "PD" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Operator",x[i].id)
end
if rank == 6 and code == "PD" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Inspektor",x[i].id)
end
if rank == 7 and code == "PD" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Kierownik",x[i].id)
end
if rank == 8 and code == "PD" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Inzynier",x[i].id)
end
if rank == 9 and code == "PD" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?", "Glowny Inzynier",x[i].id)
end
------------------------------
if rank == 1 and code == "PstoriesNews" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?","Zawieszony",x[i].id)
end
if rank == 2 and code == "PstoriesNews" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?","Aplikant",x[i].id)
end
if rank == 3 and code == "PstoriesNews" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?","M?odszy Redaktor",x[i].id)
end
if rank == 4 and code == "PstoriesNews" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?","Redaktor",x[i].id)
end
if rank == 5 and code == "PstoriesNews" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?","Redaktor Specjalista",x[i].id)
end
if rank == 6 and code == "PstoriesNews" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?","Reporter",x[i].id)
end
if rank == 7 and code == "PstoriesNews" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?","Starszy Reporter",x[i].id)
end
if rank == 8 and code == "PstoriesNews" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?","Redaktor Naczelny",x[i].id)
end
if rank == 9 and code == "PstoriesNews" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?","Sekretarz Redakcji",x[i].id)
end
if rank == 10 and code == "PstoriesNews" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?","Zast?pca Dyrektora",x[i].id)
end
if rank == 11 and code == "PstoriesNews" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?","Dyrektor Naczelny",x[i].id)
end

end
end
end
end,5000,0)


[ Dodano: 2020-12-31, 09:27 ]
s_zarzadzanie.lua
https://pastebin.com/AjGtK29y

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-12-31, 10:51


xyzzz^

A nic






Wiek: 18
Na forum: 1993 dni
Posty: 319
Nick w MP: Aspyk21

Piwa: 308

Respekt: 81

Ostrzeżeń: 100%
if rank == <1-17> and code == "Policja" then zmien sobie to jak tylko chcesz

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-12-31, 11:23


TheSebaPL

Mod-team






Wiek: 21
Na forum: 3098 dni
Posty: 964

Piwa: 3102

Respekt: 640,5
Respekt: 640,5Respekt: 640,5

skakacz, jakie? b??dy masz w debugscript 3 ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-12-31, 11:53


skakacz







Wiek: 27
Na forum: 2315 dni
Posty: 19
Nick w MP: skakacz

Piwa: 1

Respekt: 50

"TheSebaPL" napisał/a:

skakacz, jakie? b??dy masz w debugscript 3 ?




[ Dodano: 2020-12-31, 11:54 ]
to jest ta linijka

Kod:


end,5000,0)


[ Dodano: 2020-12-31, 11:58 ]
"Aw4ke" napisał/a:

if rank == <1-17> and code == "Policja" then zmien sobie to jak tylko chcesz



to ma wyglada? tak?
Urywek

Kod:

local code = x[i].code
if rank == <1-17> and code == "Policja" then
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_factions SET nazwa=? WHERE id=?","Zawieszony",x[i].id)
end


Je?eli tak, to dalej nic nie zmienia. Zauwa?y?em, ?e w ka?dej frakcji mam ten problem.

Postaw piwo autorowi tego posta
 

 
Tagi: panel :: frakcji
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Panel Frakcji Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku