Wysłany: 2015-07-18, 11:33
pomaza
Wiek: 39 Na forum: 3982 dni Posty: 79
Piwa : 2
Witam mam problem z usuwaniem pojazdu poniewasz usuwa pojazd ale jak ktos w nim jest i wyjdzie z gry to ju? nie usuwa mo?e kto? mi pomoc troch? poprawi? skrypt ?
Za pomoc
kod
Kod:
function removePreviousVehicles(plr)
for i,v in ipairs(getElementsByType("vehicle", resourceRoot)) do
local sby = getElementData(v, "zrespilGracz")
if sby and sby == plr and getPedOccupiedVehicle(plr) ~= v then
destroyElement(v)
end
end
end
addEventHandler("onMarkerHit", m1, function(el, md)
if getElementData(el, "zrespilGracz") then
outputChatBox("praca w trakcie poprawek", el)
return
end
if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(el) then return end
local x,y,z = getElementPosition(el)
local bus = createVehicle(437, x,y,z,0.0, 0, 180)
setElementData(bus, "zrespilGracz", el)
setElementData(bus, "pojazd_paliwo", 3)
setElementData(bus, "pojazd_przebieg", 100)
warpPedIntoVehicle(el, bus)
removePreviousVehicles(el)
triggerClientEvent(el, "STARTJobBus", resourceRoot, bus)
vehs[el] = bus
end)
addEvent("STOPJobBus", true)
addEventHandler("STOPJobBus", resourceRoot, function()
local pojazd = getPedOccupiedVehicle(localPlayer)
if pojazd then
destroyElement(pojazd)
end
end)
addEvent("destroyVeh", true)
addEventHandler("destroyVeh", getRootElement(),
function()
if vehs[source] then
if isElement(vehs[source]) then destroyElement(vehs[source]) end
end
end)
Wysłany: 2015-07-19, 03:23
_Haze
Peace Yo!
Wiek: 24 Na forum: 4184 dni Posty: 1648
Nick w MP: Haze
Piwa : 2628
Musisz dodac event onClientQuit i tam destroyVeh
Wysłany: 2015-07-19, 13:41
pomaza
Wiek: 39 Na forum: 3982 dni Posty: 79
Piwa : 2
A by m?g? kto? mi ten kod poprawi? ? bo niestety jak ja zrobi?em to nie dzia?a
Wysłany: 2015-07-19, 20:39
_Haze
Peace Yo!
Wiek: 24 Na forum: 4184 dni Posty: 1648
Nick w MP: Haze
Piwa : 2628
addEventHandler ( "onPlayerQuit" , resourceRoot , function( plr , seat )
if seat ~= 0 then return end
destroyElement ( source )
triggerClientEvent ( plr , "destroyVeh" , resourceRoot )
end )
Powinno dzia?a? nie testowa?em
Wysłany: 2015-07-20, 15:32
Tostuch
Wiek: 27 Na forum: 4931 dni Posty: 483
Nick w MP: Tost
Piwa : 137
Nie. Nie b?dzie.
addEventHandler ( "onPlayerQuit" , root , function()
triggerEvent ( "destroyVeh" , source )
end )
Wysłany: 2015-07-21, 11:22
pomaza
Wiek: 39 Na forum: 3982 dni Posty: 79
Piwa : 2
Zobacze czy dziala i dam znac
[ Dodano : 2015-07-21, 13:24 ]
Ok dzia?a piwko leci dla was
Tagi: destroy
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: