Wysłany: 2018-05-01, 15:08
Arztin
floki
Wiek: 25 Na forum: 3023 dni Posty: 66
Nick w MP: Kachi
Piwa : 4
Przenosimy calego pysa 3.0 do FC. Zrobilismy juz spawn i urz?d, ale po przeniesieniu przechowywalni auta si? nie respi? :V
s_parking.lua
--[[
addEventHandler ( "onResourceStart" , resourceRoot ,
function ()
CuboidNumber_0 = createColCuboid (- 400.18 , 1076.28 , 20.09 )
end
)
--]]
--[[
addEventHandler ( "onResourceStart" , resourceRoot ,
function ()
CuboidNumber_0 = createColCuboid (- 395.93 , 1091.02 , 20.09 )
end
)
--]]
local marker = createMarker (- 407.08 , 1086.45 , 19.09 , "cylinder" , 5.4 , 255 , 255 , 255 , 20 )
createBlip (- 1968.79 , 620.47 , 35.17 , 35 , 2 , 0 , 0 , 0 , 0 , 0 , 250 )
local mdestroy = createColCuboid (- 395.93 , 1091.02 , 20.09 )
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 )
c_parking.lua
--[[
addEventHandler ( "onResourceStart" , resourceRoot ,
function ()
CuboidNumber_0 = createColCuboid (- 400.18 , 1076.28 , 20.09 )
end
)
--]]
--[[
addEventHandler ( "onResourceStart" , resourceRoot ,
function ()
CuboidNumber_0 = createColCuboid (- 395.93 , 1091.02 , 20.09 )
end
)
--]]
local screenW , screenH = guiGetScreenSize ()
local marker = createMarker (- 411.32 , 1077.18 , 19.09 , "cylinder" , 2 , 255 , 255 , 255 , 50 )
local sphere = createColCuboid (- 395.93 , 1091.02 , 20.09 )
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 )
Podpis
Multi-Zone.gclan.pl
CZEKAMY NA CIEBIE!
Ostatnio zmieniony przez Arztin 2018-05-01, 15:32, w całości zmieniany 2 razy
Wysłany: 2018-05-01, 15:22
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
pewnie przenios?e? marker ale ju? nie zmieni?e? pozycji respu pojazdu
Podpis
"amited" napisał/a :
Wysłany: 2018-05-01, 15:43
Rumper
Majster od pysa
Wiek: 15 Na forum: 3315 dni Posty: 231
Nick w MP: Rumper
Piwa : 592
Mo?e dlatego sie nie wyci?ga bo nie w?onczy?e? skryptu pystories-vehicles albo nie zmieni?e?
onRespawnVehicles ( _ , id ,{- 1959.97 , 617.08 , 35.37 , 1.1 , 0.0 , 179.1 })
Wysłany: 2018-05-01, 15:49
Arztin
floki
Wiek: 25 Na forum: 3023 dni Posty: 66
Nick w MP: Kachi
Piwa : 4
onRespawnVehicles(_,id,{-1959.97, 617.08, 35.37, 1.1, 0.0, 179.1})
Gdzie to jest?
Podpis
Multi-Zone.gclan.pl
CZEKAMY NA CIEBIE!
Wysłany: 2018-05-01, 16:15
Rumper
Majster od pysa
Wiek: 15 Na forum: 3315 dni Posty: 231
Nick w MP: Rumper
Piwa : 592
W pliku s_parking na samym dole
Wysłany: 2018-05-01, 18:45
Arztin
floki
Wiek: 25 Na forum: 3023 dni Posty: 66
Nick w MP: Kachi
Piwa : 4
Wysłany: 2018-05-05, 13:49
Xrent
-
Wiek: 21 Na forum: 3047 dni Posty: 230
Nick w MP: Pazdam
Piwa : 535
Co to jest ?
Kod: createColCuboid(-395.93,1091.02,20.09)
Skoro ma 6 wymaganych argument?w a ty da?e? pozycje x,y,z markera polecam coleditor
Masz tu linka kliknij
Tagi: przeniosłem :: przecho :: nie :: wyciąga :: auta.
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: