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

Wysłany: 2019-06-18, 11:43


Kulegg







Wiek: 46
Na forum: 3266 dni
Posty: 283

Piwa: 20

Respekt: 50

Siemka,

Gdy oddaje auto do przechowywalni, i jak je wyjmuje to w db3 nastepuje ten blad



Prawdopodobnie przez ten b??d nie zapisuj? mi si? tuningi zrobione w tunerze, swiatla itp.

Kod przecho ca?y:




local marker=createMarker(-1787.69,785.37,24.89-5.0, "cylinder", 5, 143,0,255,100)
createBlip(-1800.91,802.22,24.89, 35,2,0,0,0,0,0,250)
local mdestroy = createMarker(-1787.59,801.46,24.89-5.0, "cylinder", 5, 143,0,255,100)
local t=createElement("text")
setElementData(t,"scale",1)
setElementData(t,"name","Pozostawianie pojazd?w")
setElementPosition(t,-1787.59,801.46,24.89+1.3)
local tt=createElement("text")
setElementData(tt,"scale",1)
setElementData(tt,"name","Odbi?r pojazd?w")
setElementPosition(tt,-1787.69,785.37,24.89+1.3)

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

addEventHandler("onMarkerHit", 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(timeroddania) then return end
        setElementFrozen(veh,true)
        outputChatBox("* Trwa oddawanie  pojazdu do przechowalni...", el,255,255,255,true)
        toggleControl(el,"enter_exit",false)
        timeroddania=setTimer(function()
            setElementFrozen(veh,false)
            local id=getElementData(veh,"vehicle:id")
            if not id then return end
            exports["ogrpg-vehicles"]:onSaveVehicle(veh)
            destroyElement(veh)
            exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET parking=1 WHERE id=?", id)
            toggleControl(el,"enter_exit",true)
            outputChatBox("* Pomy?lnie zapisano pojazd.", el, 255, 255 ,255 ,true)
        end, 3000, 1)
    elseif getElementType(el) == "vehicle" then
        local peds= getVehicleOccupants(el)
        if #peds > 0 then return end
        local id=getElementData(el,"vehicle:id")
        if not id then return end
        if isTimer(timeroddania) then return end
        timeroddania=setTimer(function()
            setElementFrozen(el,false)
            local id=getElementData(el,"vehicle:id")
            if not id then return end
            exports["ogrpg-vehicles"]:onSaveVehicle(el)
            destroyElement(el)
            exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET parking=1 WHERE id=?", id)
        end, 3000, 1)
        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["ogrpg-vehicles"]:onRespawnVehicles(_,id,{-1787.88,785.32,24.67,0.0,360.0,89.5})
       outputChatBox("* Pomy?lnie przywr?cono pojazd.", source, 255, 255 ,255 ,true)
    if spawn then
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-06-18, 12:35


Wilq







Wiek: 24
Na forum: 4569 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Nieodpowiednie odwo?anie do funkcji 'onRespawnVehicles' w skrypcie 'ogrpg-vehicles'.

Zobacz, czy masz tam tak? funkcj? i czy skrypt jest w??czony.
Zobacz te?, czy argumenty, kt?re przekazuje tej funkcji zgadzaj??si? z tym co p??niej tam wykorzystujesz (np. przy zapisie do bazy danych).

Postaw piwo autorowi tego posta
 

 
Tagi: call: :: failed :: call :: przechowywalnia :: ogrpg
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