fapster
Pseudol
Wiek: 22 Na forum: 4066 dni Posty: 67
Nick w MP: MopSKY
Piwa : 272
Witam ! Posiadam paczke Country Life v3.0. Gdy probuje dodac auto do organizacji wyskakuje b??d ze nie jestem w frakcji.
Tutaj macie kod :
c_org
Kod: local marker=createMarker(345.82, 162.26, 1025.79-0.9, "cylinder", 3, 255, 255, 255, 155)
setElementInterior(marker, 3)
local t=createElement("text")
setElementPosition(t,345.82, 162.26, 1025.79-0.4)
setElementInterior(t,3)
setElementData(t,"name","Przepisywanie pojazdow!")
local wm={}
wm.window=guiCreateWindow(0.22, 0.22, 0.59, 0.53, "Przepisanie", true)
guiWindowSetSizable(wm.window, false)
guiWindowSetMovable(wm.window, false)
guiSetVisible(wm.window, false)
wm.gridlist=guiCreateGridList(0.03, 0.09, 0.93, 0.72, true, wm.window)
guiGridListAddColumn(wm.gridlist, "ID", 0.15)
guiGridListAddColumn(wm.gridlist, "Nazwa", 0.3)
guiGridListAddColumn(wm.gridlist, "Organizacja ID", 0.15)
guiGridListAddColumn(wm.gridlist, "Organizacja NAZWA", 0.5)
wm.submit=guiCreateButton(0.35, 0.84, 0.28, 0.11, "Przepisz", true, wm.window)
wm.close=guiCreateButton(0.68, 0.84, 0.28, 0.11, "Zamknij", true, wm.window)
addEventHandler("onClientGUIClick", root, function(btn,state)
if source == wm.submit then
local selectedRow=guiGridListGetSelectedItem(wm.gridlist)
if selectedRow < 0 then return end
local id=tostring(guiGridListGetItemText(wm.gridlist, selectedRow, 1))
local name=tostring(guiGridListGetItemText(wm.gridlist, selectedRow, 2))
triggerServerEvent("org:check", resourceRoot, id, name)
end
if source == wm.close then
if guiGetVisible(wm.window) == true then
showCursor(false)
guiSetVisible(wm.window, false)
end
end
end)
addEvent("org:refresh", true)
addEventHandler("org:refresh", resourceRoot, function(result)
guiGridListClear(wm.gridlist)
for i,v in pairs(result) do
local row=guiGridListAddRow(wm.gridlist)
if tostring(v.ownedGroup) == "0" then v.ownedGroup = "Brak" end
if not v.name or v.name == "" then v.name = "Brak" end
guiGridListSetItemText(wm.gridlist, row, 1, v.id, false, false)
guiGridListSetItemText(wm.gridlist, row, 2, getVehicleNameFromModel(v.model), false, false)
guiGridListSetItemText(wm.gridlist, row, 3, v.ownedGroup , false, false)
guiGridListSetItemText(wm.gridlist, row, 4, v.name , false, false)
end
end)
addEventHandler("onClientMarkerHit", marker, function(el,md)
if el~=localPlayer then return end
-- if not getElementData(el,"player:organization") then outputChatBox("*Nie posiadasz organizacji!") return end
if not guiGetVisible(wm.gridlist) then
showCursor(true)
guiSetVisible(wm.window, true)
triggerServerEvent("org:download", resourceRoot, el)
end
end)
s_org
Kod: --[[
Developed by Yolos . You dont have agree to use this code! ;3
]]
function refreshgui(element)
local uid=getElementData(element,"player:uid")
if not uid then return end
local result=exports["ogrpg-db"]:dbGet("SELECT ogrpg_vehicles.model,ogrpg_vehicles.id,ogrpg_vehicles.ownedGroup,ogrpg_organization_list.name FROM ogrpg_vehicles left join ogrpg_organization_list on ogrpg_organization_list.id=ogrpg_vehicles.ownedGroup WHERE ownedPlayer=?", uid)
triggerClientEvent(element, "org:refresh", resourceRoot, result)
end
addEvent("org:check", true)
addEventHandler("org:check", resourceRoot, function(id,name)
-- Pobieramy UID gracza
local uid=getElementData(client,"player:uid")
if not uid then return end
-- Sprawdzamy czy jest jeszcze w?a?cicielem
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_vehicles WHERE id=? AND ownedPlayer=?", id, uid)
if #result < 0 then
outputChatBox("* Nie jeste? w?a?cicielem pojazdu.", client, 255, 0, 0)
return
end
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_vehicles WHERE id=? AND parking=0", id)
if #result > 0 then
outputChatBox("* Pojazd nie jest w przechowalni!.", client, 255, 0, 0)
return
end
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_vehicles WHERE id=? AND ownedPlayer=?", id, uid)
if #result > 0 then
if result[1].ownedGroup ~= "0" then
local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET ownedGroup=0 WHERE id=? AND ownedPlayer=?", id, uid)
outputChatBox("* Zmieni?e? pojazdowi "..name.."("..id..") przypis na siebie", client)
refreshgui(client)
return
end
local org = getElementData(client,"player:organization:id")
if not org then outputChatBox("Nie jeste? w frakcji!",client,255,0,0) return end
local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET ownedGroup=? WHERE id=? AND ownedPlayer=?", org, id, uid)
if query then
outputChatBox("* Zmieni?e? pojazdowi "..name.."("..id..") przypis na frakcje", client)
refreshgui(client)
end
end
end)
addEvent("org:download", true)
addEventHandler("org:download", resourceRoot, refreshgui)
Pisze ze nie jestem w organizacji pod tabem pisze ze jestem w bazie danych jestem w organizacji i nwm jak to naprawic jesli bylby ktos chetny do pomocy w naprawieniu tego mozna przez skype albo cos innego. Daje piwko i godny respekt!