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

Wysłany: 2018-08-20, 17:52


Nezzi







Wiek: 32
Na forum: 3887 dni
Posty: 43
Nick w MP: Nezzi



Respekt: 50

Witam mam problem z przechowywalni? jak robi? tuning maluje to auto daje je do przecho i wyjmuje to wszystko usuwa lub jak daje auto do przecho zepsute i je wyjme to jest naprawione prosze o pomoc daje :piwo: R*

c_parking
local screenWscreenH guiGetScreenSize()
local marker=createMarker(-2048.17,346.43,35.13"cylinder"2255,255,255,50)
local sphere=createColSphere(-1743.54,955.78,24.48,5)

local t=createElement("text")
setElementData(t,"scale",1.5)
setElementData(t,"name","OdbiĂłr pojazdĂłw")
setElementPosition(t,-2048.17,346.43,35.17)

local wm={}
wm.window=guiCreateWindow(0.250.260.510.42"Odbieranie pojazdĂłw"true)
guiWindowSetSizable(wm.windowfalse)
guiWindowSetMovable(wm.windowfalse)
guiSetVisible(wm.windowfalse)
wm.gridlist=guiCreateGridList(0.040.090.920.65truewm.window)
guiGridListAddColumn(wm.gridlist"ID"0.2)
guiGridListAddColumn(wm.gridlist"Model"0.55)
guiGridListAddColumn(wm.gridlist"Zarejestrowany"0.2)
wm.submit=guiCreateButton(0.040.760.470.19"Wyjmij pojazd"truewm.window)
wm.close=guiCreateButton(0.570.750.390.20"Zamknij"truewm.window)

addEvent("onParkingGetVehicles"true)
addEventHandler("onParkingGetVehicles"root, function(result)
    guiGridListClear(wm.gridlist)
    if not result then return end
    for i,v in pairs(result) do
        if v["registered"] == "true" then 
        v["registered"] = "NIE"
        else
        v["registered"] = "TAK"
        end
        local row=guiGridListAddRow(wm.gridlist)
        guiGridListSetItemText(wm.gridlistrow1v["id"], falsefalse)
        guiGridListSetItemText(wm.gridlistrow2getVehicleNameFromModel(v["model"]), falsefalse)
        guiGridListSetItemText(wm.gridlistrow3v["registered"], falsefalse)
    end
end)

addEventHandler("onClientMarkerHit"marker, function(el,md)
    if el~=localPlayer then return end
    if isPedInVehicle(elthen return end
    if guiGetVisible(wm.window) == false then
        showCursor(true)
        guiSetVisible(wm.window,true)
        triggerServerEvent("onParkingGetRekords"localPlayer)
        --etCameraMatrix(-2056.26468.7738.49, -2048.08467.7335.17)
    end
end)

addEventHandler("onClientGUIClick"resourceRoot, function()
    if source == wm.close then
        if guiGetVisible(wm.window) == true then
            showCursor(false)
            guiSetVisible(wm.window,false)
            setCameraTarget(localPlayerlocalPlayer)
        end
    end
    if source == wm.submit then
        local selectedRow=guiGridListGetSelectedItem(wm.gridlist) or -1
        if selectedRow 0 then return end
        local vehicles=getElementsWithinColShape(sphere,"vehicle")
        if #vehicles > 0 then
            addEventHandler("onClientRender",root,render1)
            setTimer(renderstop1,4500,1)
            return
        end
        local id=guiGridListGetItemText(wm.gridlistselectedRow1)
        local register=guiGridListGetItemText(wm.gridlistselectedRow3)
        if register == "NIE" then
        outputChatBox("*Zarejestruj pojazd w urz?™dzie! Jego ID to "..id,255,0,0)
        return end
        guiGridListRemoveRow(wm.gridlistselectedRow)
        triggerServerEvent("onParkingVehicleSpawn"localPlayertonumber(id))
    end
end)


function render1()
dxDrawText(" Nie ma miejsca aby wyci?…gn?…?‡ pojazd"screenW 0.3656screenH 0.1553screenW 0.6273screenH 0.3193tocolor(25500255), 1.50"pricedown""center""center"falsefalsefalsefalsefalse)
end

function renderstop1()
removeEventHandler("onClientRender",root,render1)
end


s_parking
local mdestroy=createMarker(-2051.62,340.43,35.17"cylinder"5255,255,255,50)

local t=createElement("text")
setElementData(t,"scale",1.5)
setElementData(t,"name","Pozostawianie pojazdĂłw")
setElementPosition(t,-1764.32,957.57,24.88)

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"sourceresult)
    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(timeroddaniathen return end
        setElementFrozen(veh,false)
        --outputChatBox("Trwa oddawanie  pojazdu."el,255,255,255,true)
        toggleControl(el,"enter_exit",false)
        timeroddania=setTimer(function()
            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."el255255 ,255 ,true)
        end10001)
    end
end)

addEvent("onParkingVehicleSpawn"true)
addEventHandler("onParkingVehicleSpawn"root, function(id)
    if not id then return end
    local spawn=exports["ogrpg-vehicles"]:onRespawnVehicles(_,id,{-1743.54,955.78,24.48,0,0,180})
    if spawn then
    addEventHandler("onClientRender",root,render1)  
    
    end
end)



function render1()
dxDrawText("Zrespiono pojazd"screenW 0.3656screenH 0.1553screenW 0.6273screenH 0.3193tocolor(255255255255), 2.50"pricedown""center""center"falsefalsefalsefalsefalse)
end


function renderstop1()
removeEventHandler("onClientRender",root,render1)
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-21, 17:51


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

pokazd kod zapisu pojazdow a nie przecho i daj ss z bazy mysql ktora masz

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-21, 18:09


Atroth







Wiek: 23
Na forum: 3677 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4808

Respekt: 540
Respekt: 540

Zaleca?bym u?ycie tych funkcji:

https://pastebin.com/JfvYx0WT

Nie jestem ich autorem. Funkcje setVehicleLights i getVehicleLights dorobi?em sam.

Czyli np po s-side:


local lights getVehicleLights(veh)


Zwr?ci Ci to status ?wiate? pobranego przez Ciebie pojazdu. Potem wrzucasz to do bazy danych. Pami?taj aby w polu zapisu da? zapis jako JSON.

Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-22, 10:16


Nezzi







Wiek: 32
Na forum: 3887 dni
Posty: 43
Nick w MP: Nezzi



Respekt: 50

Atroth, Mo?esz mi to jako? lepiej wyt?umaczy? czy co? bo cackam si? z tym ju? prawie 2 tygodnie i nie rozumiem :)

Postaw piwo autorowi tego posta
 

 
Tagi: przechowywalnia :: nie :: zapisuje :: tuningu :: itp
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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