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

Wysłany: 2016-12-10, 16:14


Basil.







Wiek: 24
Na forum: 3723 dni
Posty: 80
Nick w MP: njefjem



Respekt: 60

Ostrzeżeń: 100%
Chcia?bym do tego kodu doda? co? takiego, ?e pojazdy wcze?niej zrespione by?y by respione od nowa, tylko nie wiem gdzie i jak ma wygl?da? komenda. Napiszecie mi gotowy kodzik na dole? :D

local positionVehicles = {
    {-2437.6,1032.25,50.51,360.0,360.0,1.2},
    {-2425.85,1032.34,50.51,360.0,360.0,0.01},
}

for i,v in ipairs(positionVehicles) do
    local lodka createVehicle(482v[1], v[2], v[3], v[4], v[5], v[6])
    setElementData(lodka"pojazd_opis""Praca dorywcza\nDostawca paczek")
    setElementData(lodka"pojazd_paliwo"50)
    setVehicleHandling(lodka"maxVelocity"300.0)
    setVehiclePlateText(lodka,"PACZKI")
    addVehicleUpgrade(lodka1025)
    setVehicleColor(lodka255,255,255)
    setElementFrozen(lodkatrue)
end

addEventHandler("onVehicleEnter"resourceRoot, function(playerseat)
    if seat == 0 then
        setElementFrozen(sourcefalse)
        setElementData(player"gracz_praca"true)
        setVehicleHandling("maxVelocity"300.0)
        setVehiclePlateText(lodka,"PACZKI")
        addVehicleUpgrade(lodka1025)
        setVehicleColor(lodka255,255,255)
        exports.notification:showBox(player"info","Roczpocz?to prac? dostawcy paczek.")
        triggerClientEvent(player"STARTJobTrash"resourceRoot)
        setElementData(source"pojazd_opis""Paczki: 10")
    end
end)

function respawnVehicles()
    for i,v in ipairs(getElementsByType("lodka"resourceRoot)) do
        if not getVehicleOccupant(vthen
            respawnVehicle(v)
            setElementFrozen(vtrue)
            setVehicleHandling(v"maxVelocity"300.0)
            setVehiclePlateText(lodka,"PACZKI")
            addVehicleUpgrade(lodka1025)
            setVehicleColor(lodka255,255,255)
            setElementData(v"pojazd_opis""Praca dorywcza\nDostawca paczek")
            setElementData(v"pojazd_paliwo"50)
        end
    end
end

addEventHandler("onVehicleStartEnter",root,function(plr,seat,jacked)
 if jacked then
  cancelEvent()
 end
end)

addEvent("f-wyp"true)
addEventHandler("f-wyp"root, function()
 givePlayerMoney(source500)
end
)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-10, 16:36


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

unction respawnVehicles()
    for i,v in ipairs(getElementsByType("lodka"resourceRoot)) do
        if not getVehicleOccupant(vthen
            respawnVehicle(v)
            setElementFrozen(vtrue)
            setVehicleHandling(v"maxVelocity"300.0)
            setVehiclePlateText(lodka,"PACZKI")
            addVehicleUpgrade(lodka1025)
            setVehicleColor(lodka255,255,255)
            setElementData(v"pojazd_opis""Praca dorywcza\nDostawca paczek")
            setElementData(v"pojazd_paliwo"50)
        end
    end
end

twoja funkcja na respienie
do tego na sam d?? dodaj
setTimer(function()
respawnVehicles()
end,6000*10,0)


Postaw piwo autorowi tego posta
 

 
Tagi: respawn :: pojazdów
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Respawn pojazdów 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