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

Wysłany: 2018-10-20, 16:07


FeiZzu

Początkujący skrypter






Wiek: 23
Na forum: 3207 dni
Posty: 37
Nick w MP: Ventii

Piwa: 8

Respekt: 51

Witam mam mianowicie problem taki, ?e po przepisaniu auta do organizacji.
( Tak s?ysza?em bo nie widzia?em na oczy ) To potem gracz nie mo?e kupowa? aut,
Nie widzi ich w przechowywalni itd. G??wny problem niby polega w przechowywalni.
Wy?le tutaj lua na przepisywanie i przechowywalni i wy?le co mi si? pokazuje w bazie, je?li gracz wchodzi do blipu.

> Je?li gracz wejdzie do blipu ( ten kt?ry przepisa? auto na org )

[18-10-20 16:00] ERROR: [Skrypty]/pystories-parking/s_parking.lua:32: attempt to get length of local 'result' (a boolean value)
[18-10-20 16:00] WARNING: [pystories]/[Bazydanych]/pystories-db/s_db.lua:18: dbPoll failed; Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='

A tutaj jest kod na przecho i urzad.

Przecho >


local marker=createMarker(-2668.606.464.35-2"cylinder"6.4255,255,255,20)
createBlip(-2668.606.464.3535,2,0,0,0,0,0,250)
local mdestroy createColCuboid(-2672.38696289063.26404428482063.35354423522956.25,7.25,2.5)
local t=createElement("text")
setElementData(t,"scale",1.5)
setElementData(t,"name","Pozostawianie pojazd?w")
setElementPosition(t,-2668.606.464.35)

addEvent("onParkingGetRekords"true)
addEventHandler("onParkingGetRekords"root, function()
    local sid=getElementData(source,"player:sid")
    if not sid then return end
    local org getElementData(source,"player:organization")
    local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_vehicles WHERE (ownedPlayer=? OR ownedGroup=?) AND parking=1",sid,org or "Brak")
    if #result > 0 then
        triggerClientEvent(source"onParkingGetVehicles"sourceresult)
    end
end)

addEventHandler("onColShapeHit"mdestroy, function(el,md)
    if getElementType(el) == "player" then
        local veh=getPedOccupiedVehicle(el)
        if not veh then return end
        if getVehicleController(veh) ~= el then return end
        local id=getElementData(veh,"vehicle:id")
        if not id then return end
        if isTimer(timeroddaniathen return end
        setElementFrozen(veh,true)
        outputChatBox("* Trwa zapisywanie pojazdu..."el)
        toggleControl(el,"enter_exit",false)
        timeroddania=setTimer(function()
            setElementFrozen(veh,false)
            local id=getElementData(veh,"vehicle:id")
            if not id then return end
            exports["pystories-vehicles"]:onSaveVehicle(veh)
            destroyElement(veh)
            exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET parking=1 WHERE id=?"id)
            toggleControl(el,"enter_exit",true)
            outputChatBox("* Pomy?lnie zapisano pojazd."el)
        end30001)
    elseif getElementType(el) == "vehicle" then
        local pedsgetVehicleOccupants(el)
        if #peds > 0 then return end
        local id=getElementData(el,"vehicle:id")
        if not id then return end
        if isTimer(timeroddaniathen return end
        timeroddania=setTimer(function()
            setElementFrozen(el,false)
            local id=getElementData(el,"vehicle:id")
            if not id then return end
            exports["pystories-vehicles"]:onSaveVehicle(el)
            destroyElement(el)
            exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET parking=1 WHERE id=?"id)
            outputChatBox("* Pomy?lnie zapisano pojazd."el255255 ,255 ,true)
        end30001)
        setElementFrozen(el,true)
        setVehicleLocked(el,true)
    end
end)

addEvent("onParkingVehicleSpawn"true)
addEventHandler("onParkingVehicleSpawn"root, function(id)
    if not id then return end
    local spawn=exports["pystories-vehicles"]:onRespawnVehicles(_,id,{-2661.1917.964.08360.0360.0181.2})
    if spawn then
    setElementPosition(el, -2656.9817.014.35)
    outputChatBox("* Pomy?lnie wyci?gni?to pojazd z przechowalni.",el)
    end
end)


Urz?d >

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"resourceRootresult)
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=?"iduid)
    if #result < 0 then 
        outputChatBox("* Nie jeste? w?a?cicielem pojazdu."client25500)
        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"idorg)
    if #result > 0 then 
        outputChatBox("* Pojazd nie jest w przechowalni !."client25500)
        return
    end
    local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND ownedPlayer=?"iduid)
    if #result > 0 then 
        if result[1].ownedGroup ~= "0" then 
            local query=exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET ownedGroup=0 WHERE id=? AND ownedPlayer=?"iduid)
            outputChatBox("* Zmieni?e?(a?) pojazdowi "..name.."("..id..") przypis na siebie"client)
            refreshgui(client)
            return
        end
    local query=exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET ownedGroup=? WHERE id=? AND ownedPlayer=?"orgiduid)
    if query then
        outputChatBox("* Zmieni?e?(a?) pojazdowi "..name.."("..id..") przypis na organizacje"client)
        refreshgui(client)
    end
    end
end)

addEvent("org:download"true)
addEventHandler("org:download"resourceRootrefreshgui)


2 >

local marker=createMarker(358.78166.241008.38-1"cylinder"1.225569093)
setElementInterior(marker3)
setElementDimension(marker,1)

local t=createElement("text")
setElementPosition(t,358.78166.241008.38)
setElementInterior(t,3)
setElementDimension(t,1)
setElementData(t,"name","Przepisywanie pojazd?w")

local wm={}
wm.window=guiCreateWindow(0.220.220.590.53"Przepisanie Pojazd?w"true)
guiWindowSetSizable(wm.windowfalse)
guiWindowSetMovable(wm.windowfalse)
guiSetVisible(wm.windowfalse)
wm.gridlist=guiCreateGridList(0.030.090.930.72truewm.window)
guiGridListAddColumn(wm.gridlist"ID"0.2)
guiGridListAddColumn(wm.gridlist"Nazwa"0.5)
guiGridListAddColumn(wm.gridlist"Organizacja"0.5)
wm.submit=guiCreateButton(0.350.840.280.11"Przepisz"truewm.window)
wm.close=guiCreateButton(0.680.840.280.11"Zamknij"truewm.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.gridlistselectedRow1))
        local name=tostring(guiGridListGetItemText(wm.gridlistselectedRow2))
        triggerServerEvent("org:check"resourceRootidname)
    end
    if source == wm.close then
        if guiGetVisible(wm.window) == true then
            showCursor(false)
            guiSetVisible(wm.windowfalse)
        end
    end
end)
 
addEvent("org:refresh"true)
addEventHandler("org:refresh"resourceRoot, function(result)
    guiGridListClear(wm.gridlist)
    for i,v in pairs(result) do
        if string.len(v.plateText) < 1 then v.plateText="Brak" end
        local row=guiGridListAddRow(wm.gridlist)
        if tostring(v.ownedGroup) == "0" then v.ownedGroup "Brak" end
        guiGridListSetItemText(wm.gridlistrow1v.idfalsefalse)
        guiGridListSetItemText(wm.gridlistrow2getVehicleNameFromModel(v.model), falsefalse)
        guiGridListSetItemText(wm.gridlistrow3v.ownedGroup falsefalse)
    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.gridlistthen
        showCursor(true)
        guiSetVisible(wm.windowtrue)
        triggerServerEvent("org:download"resourceRootel)
    end
end)


Prosze o szybk? pomoc!

Postaw piwo autorowi tego posta
 

 
Tagi: przechowywalnia :: organizacje
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA 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