Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2018-01-06, 18:06


polaczkos







Wiek: 26
Na forum: 4226 dni
Posty: 168
Nick w MP: polaczkos

Piwa: 3

Respekt: 45,3

Witam chodzi o to ?eby po wjechaniu w ostatni punkt usuwa?o pojazd ale nie dzia?a mi to a b??d?w w DB nie

Spawn pojazdu
for i,v in ipairs(busy) do
    local busy = createVehicle(431, v[1], v[2], v[3])
    setElementData(busy, "vopis", "Kierowca Autobusu")
    setVehiclePlateText(busy,"Autobus")
    setVehicleColor (busy, 255, 0, 0 )
    setVehicleRotation ( busy, v[4], v[5], v[6])
    setVehicleHandling(busy,"maxVelocity",150)
    setElementData(busy, "pojazdy_przebieg", math.random(500, 1000))
    setElementData(busy, "pojazdy_paliwo", 50)
    setVehicleHandling(busy, "maxVelocity", 80.0)
    setVehicleHandling(busy, "driveType", "rwd")
    setVehicleHandling(busy, "engineType", "diesel")

    setElementFrozen(busy, true)
    setVehicleEngineState(busy, false)
end

function respawnVehicles()
    for i,v in ipairs(getElementsByType("vehicle", resourceRoot)) do
        if not getVehicleOccupant(v) then
            respawnVehicle(v)
            setElementFrozen(v, true)
            setElementData(v, "vopis", "Kierowca Autobusu")
            setVehicleColor (v, 255, 0, 0)
            setVehicleRotation ( v, 0, 0, 240 )
            setVehicleHandling(v,"maxVelocity",150)
            setElementData(v, "pojazdy_przebieg", math.random(500, 1000))
            setElementData(v, "pojazd_paliwo", 50)
            setVehicleHandling(v, "maxVelocity", 80.0)
            setVehicleHandling(v, "driveType", "rwd")
            setVehicleHandling(v, "engineType", "diesel")
            setVehicleEngineState(v, false)
        end
    end
end
setTimer(respawnVehicles, 5000, 0)
addEvent("checkCars", true)
addEventHandler("checkCars", resourceRoot, respawnVehicles)


Usuwanie pojazdu

addEvent("Usun_Pojazd", true)
addEventHandler("Usun_Pojazd", getRootElement(),
function()
    for i,v in ipairs(busy) do
        if v[source] then
            if isElement(v[source]) then destroyElement(v[source]) end
        end
    end
end)


wywo?anie usun pojazd przy ostatnim punkcje

    if Praca_Target == #Wiejska_Trasa then
        triggerServerEvent("Usun_Pojazd", localPlayer)
        Koniec_Pracy()
        playSoundFrontEnd(5)
        outputChatBox("[INFO] Koniec trasy ", 0, 155, 255)


Prosze o pomoc :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-01-06, 18:25


Kalizman







Wiek: 24
Na forum: 3792 dni
Posty: 1394

Piwa: 4624

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Usu? local z 'bus' a nast?pnie destroyElement.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-01-09, 14:52


DevJumpDj

VILLAGE MTA






Wiek: 27
Na forum: 3615 dni
Posty: 109
Nick w MP: D4NTE

Piwa: 3331

Respekt: 121
Respekt: 121

 onPlayerVehicleExit 

 destroyElement 


Poczytaj wiki. Kolega wy?ej dobrze m?wi.

Podpis


VILLAGE MTA - www.villagemta.pl
D4NTE Właściciel serwera
Postaw piwo autorowi tego posta
 

 
Tagi: usuwanie :: pojazdu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Usuwanie pojazdu Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

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
Dodaj temat do Ulubionych
Wersja do druku