Witam posiadam gamemode paczki PSSM. Niestety suszarki administracyjnej na niej nie by?o wi?c musia?em doda? z innego serwera. Wszystko pi?knie dzia?a (naprawianie itp) tylko nie dzia?a opcja oddawania aut na przecho. Za pomoc daje piwo.
if selected == 2 then
if getElementData(el,"vehicle:spawn") then
exports["pystories-vehicles"]:onSaveVehicle(el)
local query=exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET parking=1,tp_to_parking=? WHERE id=?", getPlayerName(source),getElementData(el,"vehicle:id"))
if query then
destroyElement(el)
outputChatBox("* Pomy?lnie oddano pojazd na parking.", source)
end
else
outputChatBox("* Ten pojazd nie jest prywatny, u?yj opcji 'Usu? pojazd'", source, 255, 0, 0)
end
Fragment kodu przecho:
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 oddawanie pojazdu do przechowalni...", el,255,255,255,true)
toggleControl(el,"enter_exit",false)
timeroddania=setTimer(function()
setElementFrozen(veh,false)
local id=getElementData(veh,"vehicle:id")
if not id then return end
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)
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["ogrpg-vehicles"]:onSaveVehicle(el)
destroyElement(el)
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET parking=1 WHERE id=?", id)
end, 3000, 1)
setElementFrozen(el,true)
setVehicleLocked(el,true)
end
end)
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