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

Wysłany: 2016-12-13, 21:45


Basil.







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



Respekt: 60

Ostrzeżeń: 100%
Jak zwi?kszy? w tym kodzie zu?ycie paliwa?


local czas = getTickCount()

isBike = {
    [509]=true, --Bike
    [481]=true, --BMX
    [510]=true, --Mountain bike
    [405]=true, --santiniel
    [431]=true, --busik
    [437]=true, --busiczek
    [524]=true, --betonek
}

function odejmijPaliwo(pojazd)
    if getTickCount() - czas > 150 then
        czas = getTickCount()
        local paliwo = getElementData(pojazd, "pojazd_paliwo") or 0
        local vx,vy,vz = getElementVelocity(pojazd)
        local spd = ((vx^2+vy^2+vz^2)^(0.5)/150)
        if spd > 0 then
            paliwo = paliwo-spd*2
            setElementData(pojazd, "pojazd_paliwo", paliwo)
        end
    end
end

addEventHandler("onClientRender", root, function()
    local pojazd = getPedOccupiedVehicle(localPlayer)
    if not pojazd then return end
    if isBike[getElementModel(pojazd)] then return end
    if not getVehicleEngineState(pojazd) then return end
    if getVehicleController(pojazd) ~= localPlayer then return end
    odejmijPaliwo(pojazd)
end)

function zgasSilnik()
    for i,v in ipairs(getElementsByType("vehicle")) do
    local data = getElementData(v, "pojazd_paliwo")
        if data then
        if tonumber(data) < 0 then
            setVehicleEngineState(v, false)
        end
end
    end
end
setTimer(zgasSilnik, 1000, 999999999)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-13, 21:53


Barcioo

Kiedyś to było ST






Wiek: 26
Na forum: 4189 dni
Posty: 458
Nick w MP: Bartek.

Piwa: 1892

Respekt: 460
Respekt: 460

Nie jestem pewny ale spr?buj zwi?kszy?
paliwo = paliwo-spd*4 


Podpis
Kanał Youtube;
A tu zapraszam
, pomogłem Ci? Wynagrodź mnie :piwo: :)


SUPPORT TEAM- 2016-09-03 do 2018-05-25
Test Mod- 2018-05-25
1k dni na Forum - 2018-01-28


GG: 62111935
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-13, 21:58


Basil.







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



Respekt: 60

Ostrzeżeń: 100%
"Barcioo" napisał/a:

Nie jestem pewny ale spr?buj zwi?kszy?
paliwo = paliwo-spd*4 



Jak to zmieni?em to samoch?d zacz?? gasn??, ale paliwo w og?le szybciej nie spada?o.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-13, 22:46


zabijaka2000







Wiek: 26
Na forum: 5124 dni
Posty: 147
Nick w MP: aleks556

Piwa: 13

Respekt: 80

Ostrzeżeń: 20%
150 zmie? na 50 tam w odejmjPaliwo i zobaczymy co si? stanie

Podpis
San Fierro Stories Roleplay
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-14, 15:15


ZZiomek

..::LUA::..






Wiek: 26
Na forum: 4008 dni
Posty: 134
Nick w MP: NexBoy

Piwa: 5961

Respekt: 155,3
Respekt: 155,3Respekt: 155,3

paliwo = paliwo-spd*10
robi?e? tak?

Podpis

Dodaj na Steam: Kod: 1093365219
Discord: NoOne#3644

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-15, 16:34


Basil.







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



Respekt: 60

Ostrzeżeń: 100%
"ZZiomek" napisał/a:

paliwo = paliwo-spd*10
robi?e? tak?



Tak, nic to nie da?o.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-15, 18:21


SzeregowyTWK

:D CISNE LUDZI






Wiek: 31
Na forum: 3602 dni
Posty: 11
Nick w MP: neymar



Respekt: 50

local spd = ((vx^2+vy^2+vz^2)^(0.5)/150) /// 0.5 zamie? na np. 3 lub inn? liczb?, mo?e zadzia?a :) .

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-15, 19:00


Kibol1908.

Good Boy






Wiek: 27
Na forum: 4252 dni
Posty: 69
Nick w MP: Hello_Boy

Piwa: 99

Respekt: 65,3

Ostrzeżeń: 60%

local czas = getTickCount()

isBike = {
    [509]=true, --Bike
    [481]=true, --BMX
    [510]=true, --Mountain bike
    [405]=true, --santiniel
    [431]=true, --busik
    [437]=true, --busiczek
    [524]=true, --betonek
}

function odejmijPaliwo(pojazd)
    if getTickCount() - czas > 150 then
        czas = getTickCount()
        local paliwo = getElementData(pojazd, "pojazd_paliwo") or 0
        local vx,vy,vz = getElementVelocity(pojazd)
        local spd = ((vx^2+vy^2+vz^2)^(0.5)/300)
        if spd > 0 then
            paliwo = paliwo-spd*2
            setElementData(pojazd, "pojazd_paliwo", paliwo)
        end
    end
end

addEventHandler("onClientRender", root, function()
    local pojazd = getPedOccupiedVehicle(localPlayer)
    if not pojazd then return end
    if isBike[getElementModel(pojazd)] then return end
    if not getVehicleEngineState(pojazd) then return end
    if getVehicleController(pojazd) ~= localPlayer then return end
    odejmijPaliwo(pojazd)
end)

function zgasSilnik()
    for i,v in ipairs(getElementsByType("vehicle")) do
    local data = getElementData(v, "pojazd_paliwo")
        if data then
        if tonumber(data) < 0 then
            setVehicleEngineState(v, false)
        end
end
    end
end
setTimer(zgasSilnik, 1000, 999999999)



Sprawd? to :)

i To:


local czas = getTickCount()

isBike = {
    [509]=true, --Bike
    [481]=true, --BMX
    [510]=true, --Mountain bike
    [405]=true, --santiniel
    [431]=true, --busik
    [437]=true, --busiczek
    [524]=true, --betonek
}

function odejmijPaliwo(pojazd)
    if getTickCount() - czas > 150 then
        czas = getTickCount()
        local paliwo = getElementData(pojazd, "pojazd_paliwo") or 0
        local vx,vy,vz = getElementVelocity(pojazd)
        local spd = ((vx^2+vy^2+vz^2)^(0.5)/50)
        if spd > 0 then
            paliwo = paliwo-spd*2
            setElementData(pojazd, "pojazd_paliwo", paliwo)
        end
    end
end

addEventHandler("onClientRender", root, function()
    local pojazd = getPedOccupiedVehicle(localPlayer)
    if not pojazd then return end
    if isBike[getElementModel(pojazd)] then return end
    if not getVehicleEngineState(pojazd) then return end
    if getVehicleController(pojazd) ~= localPlayer then return end
    odejmijPaliwo(pojazd)
end)

function zgasSilnik()
    for i,v in ipairs(getElementsByType("vehicle")) do
    local data = getElementData(v, "pojazd_paliwo")
        if data then
        if tonumber(data) < 0 then
            setVehicleEngineState(v, false)
        end
end
    end
end
setTimer(zgasSilnik, 1000, 999999999)



Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-15, 21:16


Basil.







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



Respekt: 60

Ostrzeżeń: 100%
"Kibol1908." napisał/a:


local czas = getTickCount()

isBike = {
    [509]=true, --Bike
    [481]=true, --BMX
    [510]=true, --Mountain bike
    [405]=true, --santiniel
    [431]=true, --busik
    [437]=true, --busiczek
    [524]=true, --betonek
}

function odejmijPaliwo(pojazd)
    if getTickCount() - czas > 150 then
        czas = getTickCount()
        local paliwo = getElementData(pojazd, "pojazd_paliwo") or 0
        local vx,vy,vz = getElementVelocity(pojazd)
        local spd = ((vx^2+vy^2+vz^2)^(0.5)/300)
        if spd > 0 then
            paliwo = paliwo-spd*2
            setElementData(pojazd, "pojazd_paliwo", paliwo)
        end
    end
end

addEventHandler("onClientRender", root, function()
    local pojazd = getPedOccupiedVehicle(localPlayer)
    if not pojazd then return end
    if isBike[getElementModel(pojazd)] then return end
    if not getVehicleEngineState(pojazd) then return end
    if getVehicleController(pojazd) ~= localPlayer then return end
    odejmijPaliwo(pojazd)
end)

function zgasSilnik()
    for i,v in ipairs(getElementsByType("vehicle")) do
    local data = getElementData(v, "pojazd_paliwo")
        if data then
        if tonumber(data) < 0 then
            setVehicleEngineState(v, false)
        end
end
    end
end
setTimer(zgasSilnik, 1000, 999999999)



Sprawd? to :)

i To:


local czas = getTickCount()

isBike = {
    [509]=true, --Bike
    [481]=true, --BMX
    [510]=true, --Mountain bike
    [405]=true, --santiniel
    [431]=true, --busik
    [437]=true, --busiczek
    [524]=true, --betonek
}

function odejmijPaliwo(pojazd)
    if getTickCount() - czas > 150 then
        czas = getTickCount()
        local paliwo = getElementData(pojazd, "pojazd_paliwo") or 0
        local vx,vy,vz = getElementVelocity(pojazd)
        local spd = ((vx^2+vy^2+vz^2)^(0.5)/50)
        if spd > 0 then
            paliwo = paliwo-spd*2
            setElementData(pojazd, "pojazd_paliwo", paliwo)
        end
    end
end

addEventHandler("onClientRender", root, function()
    local pojazd = getPedOccupiedVehicle(localPlayer)
    if not pojazd then return end
    if isBike[getElementModel(pojazd)] then return end
    if not getVehicleEngineState(pojazd) then return end
    if getVehicleController(pojazd) ~= localPlayer then return end
    odejmijPaliwo(pojazd)
end)

function zgasSilnik()
    for i,v in ipairs(getElementsByType("vehicle")) do
    local data = getElementData(v, "pojazd_paliwo")
        if data then
        if tonumber(data) < 0 then
            setVehicleEngineState(v, false)
        end
end
    end
end
setTimer(zgasSilnik, 1000, 999999999)



Nic to nie robi, nawet jak to na 9999999 ustawi?em to nic si? nie dzia?o xd

Postaw piwo autorowi tego posta
 

 
Tagi: jak :: zwiększyć :: zużycie :: paliwa?
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