Wysłany: 2017-03-26, 20:01
Pemo97
Wiek: 26 Na forum: 3822 dni Posty: 49
Piwa : 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??
Wysłany: 2017-03-26, 20:04
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
a mo?e dasz kod przecho? i ss tabeli pojazd?w
Podpis
"amited" napisał/a :
Wysłany: 2017-03-26, 20:05
Pemo97
Wiek: 26 Na forum: 3822 dni Posty: 49
Piwa : 3
client
--[[
addEventHandler ( "onResourceStart" , resourceRoot ,
function ()
CuboidNumber_0 = createColCuboid (- 1951.8657226563 , 613.52954101563 , 33.78190612793 , 14.4 , 7.3 , 6.2 )
end
)
--]]
--[[
addEventHandler ( "onResourceStart" , resourceRoot ,
function ()
CuboidNumber_0 = createColCuboid (- 1966.6160888672 , 613.84454345703 , 33.78190612793 , 14.4 , 7.3 , 6.2 )
end
)
--]]
local screenW , screenH = guiGetScreenSize ()
local marker = createMarker (- 1968.79 , 620.47 , 35.17 - 0.9 , "cylinder" , 2 , 255 , 255 , 255 , 50 )
local sphere = createColCuboid (- 1966.6160888672 , 613.84454345703 , 33.78190612793 , 14.4 , 7.3 , 6.2 )
local t = createElement ( "text" )
setElementData ( t , "scale" , 1.5 )
setElementData ( t , "name" , "Odbi?r pojazd?w" )
setElementPosition ( t ,- 1968.79 , 620.47 , 35.17 )
local wm ={}
wm . window = guiCreateWindow ( 0.25 , 0.26 , 0.51 , 0.42 , "Odbieranie pojazd?w" , true )
guiWindowSetSizable ( wm . window , false )
guiWindowSetMovable ( wm . window , false )
guiSetVisible ( wm . window , false )
wm . gridlist = guiCreateGridList ( 0.04 , 0.09 , 0.92 , 0.65 , true , wm . window )
guiGridListAddColumn ( wm . gridlist , "ID" , 0.2 )
guiGridListAddColumn ( wm . gridlist , "Model" , 0.55 )
guiGridListAddColumn ( wm . gridlist , "Zarejestrowany" , 0.2 )
wm . submit = guiCreateButton ( 0.04 , 0.76 , 0.47 , 0.19 , "Wyjmij pojazd" , true , wm . window )
wm . close = guiCreateButton ( 0.57 , 0.75 , 0.39 , 0.20 , "Zamknij" , true , wm . 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 . gridlist , row , 1 , v [ "id" ], false , false )
guiGridListSetItemText ( wm . gridlist , row , 2 , getVehicleNameFromModel ( v [ "model" ]), false , false )
guiGridListSetItemText ( wm . gridlist , row , 3 , v [ "registered" ], false , false )
end
end )
addEventHandler ( "onClientMarkerHit" , marker , function( el , md )
if el ~= localPlayer then return end
if isPedInVehicle ( el ) then return end
if guiGetVisible ( wm . window ) == false then
showCursor ( true )
guiSetVisible ( wm . window , true )
triggerServerEvent ( "onParkingGetRekords" , localPlayer )
-- etCameraMatrix (- 2056.26 , 468.77 , 38.49 , - 2048.08 , 467.73 , 35.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 ( localPlayer , localPlayer )
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 . gridlist , selectedRow , 1 )
local register = guiGridListGetItemText ( wm . gridlist , selectedRow , 3 )
if register == "NIE" then
outputChatBox ( "* Zarejestruj pojazd w urz?dzie! Jego ID to " .. id , 255 , 0 , 0 )
return end
guiGridListRemoveRow ( wm . gridlist , selectedRow )
triggerServerEvent ( "onParkingVehicleSpawn" , localPlayer , tonumber ( id ))
end
end )
server
--[[
addEventHandler ( "onResourceStart" , resourceRoot ,
function ()
CuboidNumber_0 = createColCuboid (- 1951.8657226563 , 613.52954101563 , 33.78190612793 , 14.4 , 7.3 , 6.2 )
end
)
--]]
--[[
addEventHandler ( "onResourceStart" , resourceRoot ,
function ()
CuboidNumber_0 = createColCuboid (- 1966.6160888672 , 613.84454345703 , 33.78190612793 , 14.4 , 7.3 , 6.2 )
end
)
--]]
local marker = createMarker (- 1945.00 , 617.12 , 35.02 - 2 , "cylinder" , 6.4 , 255 , 255 , 255 , 20 )
createBlip (- 1968.79 , 620.47 , 35.17 , 35 , 2 , 0 , 0 , 0 , 0 , 0 , 250 )
local mdestroy = createColCuboid (- 1951.8657226563 , 613.52954101563 , 33.78190612793 , 14.4 , 7.3 , 6.2 )
local t = createElement ( "text" )
setElementData ( t , "scale" , 1.5 )
setElementData ( t , "name" , "Pozostawianie pojazd?w" )
setElementPosition ( t ,- 1945.00 , 617.12 , 35.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" , source , result )
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 ( timeroddania ) then 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 )
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 [ "pystories-vehicles" ]: onSaveVehicle ( el )
destroyElement ( el )
exports [ "pystories-db" ]: dbSet ( "UPDATE pystories_vehicles SET parking=1 WHERE id=?" , id )
outputChatBox ( "* Pomy?lnie zapisano pojazd." , el , 255 , 255 , 255 , true )
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 [ "pystories-vehicles" ]: onRespawnVehicles ( _ , id ,{- 1959.97 , 617.08 , 35.37 , 1.1 , 0.0 , 179.1 })
if spawn then
-- addEventHandler ( "onClientRender" , root , render1 )
outputChatBox ( "* Pomy?lnie wyci?gni?to pojazd z przechowalni." , el )
end
end )
Wysłany: 2017-03-26, 20:07
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
a tabela? i podaj b??d jak chowasz / wyci?gasz auto
Podpis
"amited" napisał/a :
Wysłany: 2017-03-26, 20:09
Pemo97
Wiek: 26 Na forum: 3822 dni Posty: 49
Piwa : 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
Wysłany: 2017-03-26, 20:14
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
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 :
Wysłany: 2017-03-26, 20:19
Pemo97
Wiek: 26 Na forum: 3822 dni Posty: 49
Piwa : 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
Wysłany: 2017-03-26, 20:25
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
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 :
Wysłany: 2017-03-26, 20:32
Pemo97
Wiek: 26 Na forum: 3822 dni Posty: 49
Piwa : 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)
Tagi: przechowywalnia
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: