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

Wysłany: 2016-11-19, 12:41


macieq.

Grafik






Wiek: 28
Na forum: 3513 dni
Posty: 42
Nick w MP: 1Macieq



Respekt: 50

Kiedy w??cz? licznik mam 0 paliwa, a tepne si? do stacji "ogrpg-cpny" nie napelnia mia, pobiera kase itp.. ale nie daje mi paliwa
local rowery={[509]=true,[481]=true,[510]=true}

addEventHandler("onClientRender"root, function()

    local veh=getPedOccupiedVehicle(localPlayer) 
    
    if not veh then return end
    if rowery[getElementModel(veh)] then return end -- rowery nie ma ja gownolicznika
    if getVehicleController(veh) ~= localPlayer then return end -- sterownosc gownolicznika tznauta..
    
    local vx,vy,vz=getElementVelocity(veh)
    predkosc=(vx^2+vy^2+vz^2)^0.45*1.55*100  
    
    local paliwo string.format "%01.0f"getElementData(veh"paliwo") or 0) -- tutaj gownopaliwojak masz 0 to ci nie odpali czy jak to tam
    if predkosc 0 then return end 
    
    local screenWscreenH guiGetScreenSize()
    local **** = getElementData(veh,"vehicle:mileage") or 0
    local fuelgetElementData(veh,"vehicle:fuel") or 0
    if fuel 10 and fuel <= 100 then
      
        dxDrawRectangle(screenW 0.8075screenH 0.8000screenW 0.0049screenH 0.2409tocolor(2552550255), false)
        dxDrawRectangle(screenW 0.8125screenH 0.8000screenW 0.1917screenH 0.3294tocolor(000255), false) --Czarne gowno
        dxDrawRectangle(screenW 0.9963screenH 0.8000screenW 0.0049screenH 0.2409tocolor(12552550255), false)
        dxDrawText(('%01d'):format(math.floor(****)).."km"screenW 0.8613screenH 0.7878screenW 0.9539screenH 0.8424tocolor(255255255255), 3.00"Bebas""center""center"falsefalsefalsefalsefalse)
        dxDrawRectangle(screenW 0.8075screenH 0.8000screenW 0.3000screenH 0.0052tocolor(2552550255), false)
        dxDrawText(string.format("%.0f",predkosc).." KM/H"screenW 0.8613screenH 0.8878screenW 0.9539screenH 0.8424tocolor(255255255255), 3.00"Bebas""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Paliwo : "..fuel.." L"screenW 0.8513screenH 0.9685screenW 0.9539screenH 0.9531tocolor(255255255255), 2.00"Bebas""center""center"falsefalsefalsefalsefalse)
        dxDrawText("&#169; yGame"screenW 0.8161screenH 0.8090screenW 1.0531screenH 1.0716tocolor(2552550255), 0.80"Bebas""left""top"falsefalsefalsefalsefalse)
       

end
)



 
local time getTickCount()
function zabiera_paliwo(auto)

    if getTickCount() - time 100 then
    time getTickCount()
    local vx,vy,vz getElementVelocity(auto)
    local predkosc = ((vx^2+vy^2+vz^2)^(0.5)/100)
    local paliwo getElementData(auto"paliwo") or 0
    if predkosc 0 then -- je?eli samoch?d stoi w miejscu paliwa nie bedzie zabierac
    paliwo paliwo-predkosc*2
    setElementData(auto"paliwo"paliwo)
    
end
end
end

addEventHandler("onClientRender"root, function()

    local auto getPedOccupiedVehicle(localPlayer)
    if not auto then return end
    if not getVehicleEngineState(autothen return end
    if getVehicleController(auto) ~= localPlayer then return end
    zabiera_paliwo(auto)
    
end
)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-19, 13:04


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3809 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240

prawdopodobnie licznik nie zgadza si? z systemem paliwa.

    setElementData(auto"paliwo"paliwo)-- inne dane
local fuelgetElementData(veh,"vehicle:fuel") or -- inne dane


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-19, 13:09


PapaSmerf







Wiek: 25
Na forum: 3525 dni
Posty: 237

Piwa: 3857

Respekt: 64

"Pawel5321" napisał/a:

prawdopodobnie licznik nie zgadza si? z systemem paliwa.

    setElementData(auto"paliwo"paliwo)-- inne dane
local fuelgetElementData(veh,"vehicle:fuel") or -- inne dane



Ty udajesz czy jeste? g?upi?
to ju? jest w liczniku mu chodzi o w og?le co? innego.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-19, 13:11


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3809 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240

CEO, Chodzi o to , ?e licznik nie pokazuje paliwa , element daty s? niezgodne.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-19, 13:14


PapaSmerf







Wiek: 25
Na forum: 3525 dni
Posty: 237

Piwa: 3857

Respekt: 64

Aa. dobra rozumiem nie zrozumia?em na pocz?tku :D

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-19, 14:11


macieq.

Grafik






Wiek: 28
Na forum: 3513 dni
Posty: 42
Nick w MP: 1Macieq



Respekt: 50

By? m?g?, mi wys??? edytowany ten licznik, co wys?a?em ?
Daje piwko :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-19, 14:17


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3809 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240

daj cpny z ogrpg

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-20, 00:46


nanKy







Wiek: 22
Na forum: 3866 dni
Posty: 498
Nick w MP: nanky

Piwa: 1773

Respekt: 239
Respekt: 239Respekt: 239

W notepad++ zamie? wszystkie "paliwo" na "vehicle:fuel"

[ Dodano: 2016-11-20, 00:50 ]
Albo masz bo widz? ?e ty inteligencj? nie dysponujesz

local rowery={[509]=true,[481]=true,[510]=true}

addEventHandler("onClientRender"root, function()

    local veh=getPedOccupiedVehicle(localPlayer) 
    
    if not veh then return end
    if rowery[getElementModel(veh)] then return end -- rowery nie ma ja gownolicznika
    if getVehicleController(veh) ~= localPlayer then return end -- sterownosc gownolicznika tznauta..
    
    local vx,vy,vz=getElementVelocity(veh)
    predkosc=(vx^2+vy^2+vz^2)^0.45*1.55*100  
    
    local paliwo string.format "%01.0f"getElementData(veh"vehicle:fuel") or 0) -- tutaj gownopaliwojak masz 0 to ci nie odpali czy jak to tam
    if predkosc 0 then return end 
    
    local screenWscreenH guiGetScreenSize()
    local **** = getElementData(veh,"vehicle:mileage") or 0
    local fuelgetElementData(veh,"vehicle:fuel") or 0
    if fuel 10 and fuel <= 100 then
      
        dxDrawRectangle(screenW 0.8075screenH 0.8000screenW 0.0049screenH 0.2409tocolor(2552550255), false)
        dxDrawRectangle(screenW 0.8125screenH 0.8000screenW 0.1917screenH 0.3294tocolor(000255), false) --Czarne gowno
        dxDrawRectangle(screenW 0.9963screenH 0.8000screenW 0.0049screenH 0.2409tocolor(12552550255), false)
        dxDrawText(('%01d'):format(math.floor(****)).."km"screenW 0.8613screenH 0.7878screenW 0.9539screenH 0.8424tocolor(255255255255), 3.00"Bebas""center""center"falsefalsefalsefalsefalse)
        dxDrawRectangle(screenW 0.8075screenH 0.8000screenW 0.3000screenH 0.0052tocolor(2552550255), false)
        dxDrawText(string.format("%.0f",predkosc).." KM/H"screenW 0.8613screenH 0.8878screenW 0.9539screenH 0.8424tocolor(255255255255), 3.00"Bebas""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Paliwo : "..fuel.." L"screenW 0.8513screenH 0.9685screenW 0.9539screenH 0.9531tocolor(255255255255), 2.00"Bebas""center""center"falsefalsefalsefalsefalse)
        dxDrawText("&#169; yGame"screenW 0.8161screenH 0.8090screenW 1.0531screenH 1.0716tocolor(2552550255), 0.80"Bebas""left""top"falsefalsefalsefalsefalse)
       

end
)



 
local time getTickCount()
function zabiera_paliwo(auto)

    if getTickCount() - time 100 then
    time getTickCount()
    local vx,vy,vz getElementVelocity(auto)
    local predkosc = ((vx^2+vy^2+vz^2)^(0.5)/100)
    local paliwo getElementData(auto"vehicle:fuel") or 0
    if predkosc 0 then -- je?eli samoch?d stoi w miejscu paliwa nie bedzie zabierac
    paliwo paliwo-predkosc*2
    setElementData(auto"vehicle:fuel"paliwo)
    
end
end
end

addEventHandler("onClientRender"root, function()

    local auto getPedOccupiedVehicle(localPlayer)
    if not auto then return end
    if not getVehicleEngineState(autothen return end
    if getVehicleController(auto) ~= localPlayer then return end
    zabiera_paliwo(auto)
    
end
)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-20, 12:16


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3809 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240

NankY., jest mo?liwo?? , ?e skrypt na cpny ma jeszcze inny zapis.

Postaw piwo autorowi tego posta
 

 
Tagi: brak :: paliwa :: liczniku
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