Wysłany: 2016-03-11, 19:17
sasik12
Wiek: 26 Na forum: 3763 dni Posty: 182
Piwa : 7
Witam wszystkich ! Mam problem z przechowywalni? aut bo ustawi?em elementdaty z systemu pojazd?w panaprezesa kt?ry posiadam i niedzia?a przechowywalnia
s_przecho
local mdestroy = createMarker (- 2046.85 , 480.07 , 35.17 - 1 , "cylinder" , 5 , 50 , 255 , 250 , 50 )
createBlipAttachedTo ( mdestroy , 51 )
local t = createElement ( "text" )
setElementData ( veh , "pojazd_paliwo" , 1.5 )
setElementData ( veh , "pojazd_przebieg" , "Pozostawianie pojazd?w" )
setElementPosition ( t ,- 2046.85 , 480.07 , 35.17 )
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 )
outputChatBox ( "* Trwa zapisywanie 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." , el , 255 , 255 , 255 , 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 ,{- 2050.06 , 466.38 , 34.93 , 359.97 , 0.26 , 269.81 })
if spawn then
outputChatBox ( "* Zrespiono pojazd." , source )
end
end )
c_przecho
local marker = createMarker (- 2059.8466796875 , 469.9189453125 , 35.17 - 1.20 , "cylinder" , 2 , 50 , 255 , 250 , 50 )
local sphere = createColSphere (- 2048.19 , 467.72 , 35.17 , 6 )
local t = createElement ( "text" )
setElementData ( veh , "pojazd_paliwo" , 1.5 )
setElementData ( veh , "pojazd_przebieg" , "Odbi?r pojazd?w" )
setElementPosition ( veh ,- 2059.8466796875 , 469.9189453125 , 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.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 )
setCameraMatrix (- 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." , 255 , 0 , 0 )
return
end
local id = guiGridListGetItemText ( wm . gridlist , selectedRow , 1 )
guiGridListRemoveRow ( wm . gridlist , selectedRow )
triggerServerEvent ( "onParkingVehicleSpawn" , localPlayer , tonumber ( id ))
end
end )
[ Komentarz dodany przez: Iggy : 2016-03-11, 19:50 ]
Doda?em tagi [lua]. Pami?taj, ?e gdy dodajesz jaki? kod, umieszczaj go w przeznaczonych do tego znacznikach, tj. [lua], [pawn], [code]. Poprawia to czytelno?? kodu //Iggy.
Ostatnio zmieniony przez Iggy 2016-03-11, 19:47, w całości zmieniany 1 raz
Więcej szczegółów
Wystawiono 1 piw(a):KamiSolo12
Wysłany: 2016-03-11, 19:33
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4260 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
sasik12 , Tutaj za bardzo nic nie zrobisz (Przecho pod OGRPG) , je?eli chcia?by? to przerobi? to moim zdaniem nie ma to sensu... lepiej by?o by ju? napisa? samemu od nowa
Podpis
Support-Team: 25.01.2016
Moderator: 10.07.2016
GG: 51274621
Skype : kuba_wicinski
Wysłany: 2016-03-11, 19:36
sasik12
Wiek: 26 Na forum: 3763 dni Posty: 182
Piwa : 7
wiesz troche nieumiem
A m?g?by? podrzucic mi taki skrypt albo pom?c ?
Za pomoc dzi?ki
Podpis
Uczeń LUA . Mapper MTA.
Wysłany: 2016-03-11, 19:39
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4260 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
sasik12 , Skryptu takiego nie mam , pom?c mo?emy , lub zapraszam do dzia?u "Gie?da" tam na pewno kto? sprzedaje Przecho pod PanaPrezesa.
Podpis
Support-Team: 25.01.2016
Moderator: 10.07.2016
GG: 51274621
Skype : kuba_wicinski
Wysłany: 2016-03-11, 20:08
sasik12
Wiek: 26 Na forum: 3763 dni Posty: 182
Piwa : 7
Jak to napisa? ? Oto jest pytanie... skrypt?w pisa? nieumiem tak moze troche umiem
Ale to i tak niewystarcza
A jakbym chcia? napisa? to po kolei jakich funkcji mam u?y? ?
Podpis
Uczeń LUA . Mapper MTA.
Wysłany: 2016-03-11, 21:05
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4329 dni Posty: 698
Piwa : 2080
Więcej informacji znajdziesz w Wikipedii MTA: dbConnect
Wi?cej podam p??niej najpierw krok po kroku:
1.Zr?b dwa markery
*marker do zostawiania auta
*marker do odbierania auta
2.Event
*je?eli auto stoi w markerze wi?cej ni? 5sekund daj je do przecho
*nadaj element daty
Wi?cej potem, najpierw zr?b to a potem reszta ;D
P.S pos?uguj si? kodem tego przecho co poda?es
Tagi: przechowywalnia :: aut
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: