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

Wysłany: 2017-03-26, 20:01


Pemo97







Wiek: 26
Na forum: 3823 dni
Posty: 49

Piwa: 3

Respekt: 45,3

witam mam bl?d jaki? bo mam pliki z pystories + baze danych i jak si? da do przecho auto to go nie ma, ale w bazie danych jest i nie wiem jak to naprawi? pom?g?by kto??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-26, 20:04


amited







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

Piwa: 512

Respekt: 466
Respekt: 466

a mo?e dasz kod przecho? i ss tabeli pojazd?w

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

 
Wysłany: 2017-03-26, 20:05


Pemo97







Wiek: 26
Na forum: 3823 dni
Posty: 49

Piwa: 3

Respekt: 45,3

client
 --[[
addEventHandler("onResourceStart"resourceRoot, 
function ()
    CuboidNumber_0 createColCuboid(-1951.8657226563613.5295410156333.7819061279314.47.36.2)
end
)
--]]

--[[
addEventHandler("onResourceStart"resourceRoot, 
function ()
    CuboidNumber_0 createColCuboid(-1966.6160888672613.8445434570333.7819061279314.47.36.2)
end
)
--]]

local screenWscreenH guiGetScreenSize()
local marker=createMarker(-1968.79620.4735.17-0.9"cylinder"2255,255,255,50)
local sphere=createColCuboid(-1966.6160888672613.8445434570333.7819061279314.47.36.2)

local t=createElement("text")
setElementData(t,"scale",1.5)
setElementData(t,"name","Odbi?r pojazd?w")
setElementPosition(t,-1968.79620.4735.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"] == "false" 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
            outputChatBox("* Nie ma miejsca aby wyci?gn?? pojazd !",localPlayer)
            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



server

 --[[
addEventHandler("onResourceStart"resourceRoot, 
function ()
    CuboidNumber_0 createColCuboid(-1951.8657226563613.5295410156333.7819061279314.47.36.2)
end
)
--]]

--[[
addEventHandler("onResourceStart"resourceRoot, 
function ()
    CuboidNumber_0 createColCuboid(-1966.6160888672613.8445434570333.7819061279314.47.36.2)
end
)
--]]


local marker=createMarker(-1945.00617.1235.02-2"cylinder"6.4255,255,255,20)
createBlip(-1968.79620.4735.1735,2,0,0,0,0,0,250)
local mdestroy createColCuboid(-1951.8657226563613.5295410156333.7819061279314.47.36.2)
local t=createElement("text")
setElementData(t,"scale",1.5)
setElementData(t,"name","Pozostawianie pojazd?w")
setElementPosition(t,-1945.00617.1235.02)

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,{-1959.97617.0835.371.10.0179.1})
    if spawn then
    --addEventHandler("onClientRender",root,render1)  
    outputChatBox("* Pomy?lnie wyci?gni?to pojazd z przechowalni.",el)
    end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-26, 20:07


amited







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

Piwa: 512

Respekt: 466
Respekt: 466

a tabela? i podaj b??d jak chowasz / wyci?gasz auto

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

 
Wysłany: 2017-03-26, 20:09


Pemo97







Wiek: 26
Na forum: 3823 dni
Posty: 49

Piwa: 3

Respekt: 45,3

Chodzi o to, ?e JA nie mam tego problemu lecz nie kt?rzy gracze

B??d kt?ry wyskakuje czasami:
[2017-03-26 20:07] ERROR: [skrypty]/pystories-parking/s_parking.lua:32: attempt to get length of local 'result' (a boolean value)


tabela(tylko pystories_vehicles):
http://www73.zippyshare.com/v/GhAx0B5N/file.html

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-26, 20:14


amited







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

Piwa: 512

Respekt: 466
Respekt: 466

po prostu kto? nie ma pojazd?w w przecho bo result nie ma warto?ci, a skoro to tylko niekt?rym graczom si? wy?wietla to to. A i mia?e? mi da? ss, a nie ca?? tabel?...

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

 
Wysłany: 2017-03-26, 20:19


Pemo97







Wiek: 26
Na forum: 3823 dni
Posty: 49

Piwa: 3

Respekt: 45,3

Ale nawet jak kupi? auto to nie ma go w przecho.. i jak np. je?dz? autem i daj? do przecho to je usuwa i nie ma go w przecho ale ID auta oraz dane s? w bazie danych

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-26, 20:25


amited







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

Piwa: 512

Respekt: 466
Respekt: 466

to sprawd? z jakim? graczem czy to si? dzieje tylko za 1. razem gdy wejdzie w marker czy musi kilka razy wej?? w marker ?eby mu wy?wietli?o pojazdy

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

 
Wysłany: 2017-03-26, 20:32


Pemo97







Wiek: 26
Na forum: 3823 dni
Posty: 49

Piwa: 3

Respekt: 45,3

gdy gracz wchodzi? nic mu sie nie pokazywa?o ale by?y b??dy w logach

[2017-03-26 20:31] ERROR: [skrypty]/pystories-parking/s_parking.lua:32: attempt to get length of local 'result' (a boolean value)
[2017-03-26 20:31] WARNING: [pystories]/[skrypty]/pystories-db/s_db.lua:18: dbPoll failed; Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
[2017-03-26 20:31] ERROR: [pystories]/[skrypty]/ogrpg-vehicles2/s_vehbuy.lua:218: exports: Call to non-running server resource (ogrpg-db) [string "?"]
[2017-03-26 20:31] INFO: Pojazdow w wodzie/pod mapa: 4
[2017-03-26 20:31] ERROR: [skrypty]/pystories-parking/s_parking.lua:32: attempt to get length of local 'result' (a boolean value)
[2017-03-26 20:31] WARNING: [pystories]/[skrypty]/pystories-db/s_db.lua:18: dbPoll failed; Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
[2017-03-26 20:31] ERROR: [skrypty]/pystories-parking/s_parking.lua:32: attempt to get length of local 'result' (a boolean value)
[2017-03-26 20:31] WARNING: [pystories]/[skrypty]/pystories-db/s_db.lua:18: dbPoll failed; Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
[2017-03-26 20:31] ERROR: [pystories]/[skrypty]/ogrpg-vehicles/s_vehbuy.lua:485: attempt to get length of local 'mk1' (a nil value)

Postaw piwo autorowi tego posta
 

 
Tagi: przechowywalnia
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 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