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: 25
Na forum: 4085 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(431v[1], v[2], v[3])
    setElementData(busy"vopis""Kierowca Autobusu")
    setVehiclePlateText(busy,"Autobus")
    setVehicleColor (busy2550)
    setVehicleRotation busyv[4], v[5], v[6])
    setVehicleHandling(busy,"maxVelocity",150)
    setElementData(busy"pojazdy_przebieg"math.random(5001000))
    setElementData(busy"pojazdy_paliwo"50)
    setVehicleHandling(busy"maxVelocity"80.0)
    setVehicleHandling(busy"driveType""rwd")
    setVehicleHandling(busy"engineType""diesel")

    setElementFrozen(busytrue)
    setVehicleEngineState(busyfalse)
end

function respawnVehicles()
    for i,v in ipairs(getElementsByType("vehicle"resourceRoot)) do
        if not getVehicleOccupant(vthen
            respawnVehicle(v)
            setElementFrozen(vtrue)
            setElementData(v"vopis""Kierowca Autobusu")
            setVehicleColor (v25500)
            setVehicleRotation v00240 )
            setVehicleHandling(v,"maxVelocity",150)
            setElementData(v"pojazdy_przebieg"math.random(5001000))
            setElementData(v"pojazd_paliwo"50)
            setVehicleHandling(v"maxVelocity"80.0)
            setVehicleHandling(v"driveType""rwd")
            setVehicleHandling(v"engineType""diesel")
            setVehicleEngineState(vfalse)
        end
    end
end
setTimer(respawnVehicles50000)
addEvent("checkCars"true)
addEventHandler("checkCars"resourceRootrespawnVehicles)


Usuwanie pojazdu

addEvent("Usun_Pojazd"true)
addEventHandler("Usun_Pojazd"getRootElement(),
function()
    for i,v in ipairs(busy) do
        if v[sourcethen
            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 "0155255)


Prosze o pomoc :(

Postaw piwo autorowi tego posta
 

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


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

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: 3474 dni
Posty: 102
Nick w MP: D4NTE

Piwa: 3277

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 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