Wysłany: 2017-12-03, 16:27
dawid465
Wiek: 31 Na forum: 4765 dni Posty: 9
Nick w MP: David
Witam moim problemem jest przecho jak wida? po tytule
Gdy odaj? pojazd do przecho samo go naprawia po wyj?ciu
pom?g? by kto? wyt?umaczy? jak to naprawi? zeby auto by?o rozbit? takie jakie oda?em
Dzi?ki z g?ry
pozdrawiam
Wysłany: 2017-12-03, 16:38
CjPomarancza
:-)
Wiek: 17 Na forum: 3184 dni Posty: 90
Piwa : 12
Wklej kod przechowalni.
Podpis
Pomogłem? Doceń mnie i postaw
Wysłany: 2017-12-03, 17:02
dawid465
Wiek: 31 Na forum: 4765 dni Posty: 9
Nick w MP: David
od strony clienta czy servera
[ Dodano : 2017-12-03, 17:15 ]
--[[
Resource : OURGame v2
Developers : Split < split . programista @ gmail . com >
You have no right to use this code without my permission .
( c ) 2015 < split . programista @ gmail . com >. All rights reserved .
]]
local mdestroy = createMarker (- 2090.78 , 95.69 , 35.32 - 1 , "cylinder" , 6 , 0 , 50 , 205 , 50 )
createBlipAttachedTo ( mdestroy , 35 )
local t = createElement ( "text" )
setElementData ( t , "scale" , 1.5 )
setElementData ( t , "name" , "Pozostawianie pojazd?w" )
setElementPosition ( t ,- 2090.78 , 95.69 , 35.32 )
addEvent ( "onParkingGetRekords" , true )
addEventHandler ( "onParkingGetRekords" , root , function()
local uid = getElementData ( source , "player:uid" )
if not uid then return end
local result = exports [ "ogrpg-db" ]: dbGet ( "SELECT * FROM ogrpg_vehicles WHERE ownedPlayer=? AND parking=1" , uid )
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 )
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 )
end , 3000 , 1 )
end
end )
addEvent ( "onParkingVehicleSpawn" , true )
addEventHandler ( "onParkingVehicleSpawn" , root , function( id )
if not id then return end
local spawn = exports [ "ogrpg-vehicles" ]: onRespawnVehicles ( _ , id ,{- 2099.50 , 88.79 , 35.32 , 0.3 , 359.9 , 88.7 })
if spawn then
outputChatBox ( "* Zrespawniono pojazd." , source )
end
end )
local marker = createMarker (- 2089.35 , 84.26 , 35.31 - 0.9 , "cylinder" , 2 , 205 , 50 , 0 , 50 )
local sphere = createColSphere (- 2089.35 , 84.26 , 35.31 - 0.9 , 6 )
local t = createElement ( "text" )
setElementData ( t , "scale" , 1.5 )
setElementData ( t , "name" , "Odbi?r pojazd?w" )
setElementPosition ( t ,- 2089.35 , 84.26 , 35.31 )
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.4 )
guiGridListAddColumn ( wm . gridlist , "Model" , 0.6 )
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
local row = guiGridListAddRow ( wm . gridlist )
guiGridListSetItemText ( wm . gridlist , row , 1 , v [ "id" ], false , false )
guiGridListSetItemText ( wm . gridlist , row , 2 , getVehicleNameFromModel ( v [ "model" ]), 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 )
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." , 255 , 0 , 0 )
return
end
local id = guiGridListGetItemText ( wm . gridlist , selectedRow , 1 )
guiGridListRemoveRow ( wm . gridlist , selectedRow )
triggerServerEvent ( "onParkingVehicleSpawn" , localPlayer , tonumber ( id ))
end
end )
[ Dodano : 2017-12-04, 14:06 ]
pomoze kto?
Ostatnio zmieniony przez Atroth 2017-12-04, 16:18, w całości zmieniany 1 raz
Wysłany: 2017-12-04, 23:22
Eitho
Wiek: 24 Na forum: 3489 dni Posty: 330
Nick w MP: Eitho
Piwa : 746
Przyda?by si? kod ogrpg-vehicles (skrypt u?ywa go do respienia pojazd?w: local spawn=exports["ogrpg-vehicles"]:onRespawnVehicles(_,id,{-2099.50, 88.79, 35.32, 0.3, 359.9, 88.7})), poniewa? tam mo?e nie by? odczytu lub zapisu uszkodze?, przez co pojazd otrzymujemy naprawiony.
Wysłany: 2017-12-05, 12:25
nomercy
Wiek: 31 Na forum: 3104 dni Posty: 5
Nick w MP: nomercy*
Piwa : 1
Pewnie w tym twoim ?miesznym gamemodzie system pojazd?w nie zapisuje panelstates`?w.
Tagi: przecho :: naprawia :: auta
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: