Witam nie dzia?a mi przepisywanie aut na moj? organizacj? nie wiem czemu w db3 nie ma nic:
s_org:
[code]
--[[
Developed by Yolos . You dont have agree to use this code! ;3
]]
function refreshgui(element)
local uid=getElementData(element,"player:sid")
if not uid then return end
local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_vehicles WHERE ownedPlayer=?", uid)
triggerClientEvent(element, "org:refresh", resourceRoot, result)
end
addEvent("org:check", true)
addEventHandler("org:check", resourceRoot, function(id,name)
-- Pobieramy SID gracza
local uid=getElementData(client,"player:sid")
if not uid then return end
-- Sprawdzamy czy jest jeszcze w?‚a?›cicielem
local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND ownedPlayer=?", id, uid)
if #result < 0 then
outputChatBox("#ff0000âś #ffffffNie jeste?› w?‚a?›cicielem pojazdu.", client, 255, 0, 0, true)
return
end
local org = getElementData(client,"player:organization")
if not org then outputChatBox("* Nie jeste?› w organizacji !",client,255,0,0) return end
local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND parking=0", id, org)
if #result > 0 then
outputChatBox("#ff0000âś #ffffffPojazd nie znajd...
Witam przychodze z problem, i? normalnie moge dodac auto do organizacji kazdy moze jezdzic ale gdy odpuszam organizacje lub mnie wyrzuca to moje auta sa dalej do niej przypisane i kazdy wciaz moze z nich korzystac. Za pomoc daje piwka
KOD
[lua]local zaproszenia = {}
local max_people_in_org = 55 ---- MAKSYMALNA LICZBA LUDZI W ORGANIZACJI!
function findPlayer(plr,cel)
local target=nil
if (tonumber(cel) ~= nil) then
for _,thePlayer in ipairs(getElementsByType("player")) do
if getElementData(thePlayer,"player:sid") == tonumber(cel) then target = thePlayer end
end
else -- podano fragment nicku
for _,thePlayer in ipairs(getElementsByType("player")) do
if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), cel:lower(), 0, true) then
if (target) then
outputChatBox("* Znaleziono wiecej niz jednego gracza o pasujacym nicku, podaj wiecej liter.", plr)
return nil
end
target=thePlayer
end
end
end
if target and getElementData(target,"p:inv") then return nil end
return target
end
addEvent("lidero:editUser", true)
addEventHandler("lidero:editUser", resourceRoot, function(text,rank,faction)
local result1=exports["pystories-db"]:dbGet("SELECT * FROM pystories_users WHERE id=?", text)
if not result1 or #result1 < 0 then outputChatBox("* Podany u?ytkownik nie istnieje w baz...
Witam jest jaka? funkcja czy jak to zrobi? ?eby przepisywa? id pojazdu... hmm jak to wyt?umaczy? ?eby sama zapisywa?a id ...
CreateVehicle(kupioneaut, . . . . );
A potem jak bym robi? zamiast kupione auto mia?o id?
no bo jak
djSetInt(pojazdy(dane), "id" --> to tutaj mi daje kupioneauto a ja chcia?bym ?eby samo zmieni?o sobie na id pojazdu...