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

Wysłany: 2015-09-14, 18:49


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

Witam, chcia?bym mie? na liczniku nie za pomoc? cyfry tylko wskaz?wki ile jest paliwa.
W baku jest 100 L a 1 L to 0.95 stopnia :)

Za pomoc daje :arrow: :piwo: oraz :arrow: R*

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-14, 19:12


Dexnes_

Tiger






Wiek: 26
Na forum: 4401 dni
Posty: 620
Nick w MP: Dexnes

Piwa: 1394

Respekt: 390
Respekt: 390Respekt: 390Respekt: 390Respekt: 390

W gamemode XyzzyRP jest takie co? , wejdz tam i zobacz.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-14, 19:16


sebik2303

Mapper :)






Wiek: 25
Na forum: 4160 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

gdzie ? tam wgl jest licznik ? :)

[ Dodano: 2015-09-14, 19:40 ]
dobra znalaz?em ale nie wiem jak to u?o?y? do mojego xD i wola? bym sam to zrobi? xD

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-15, 09:24


Dexnes_

Tiger






Wiek: 26
Na forum: 4401 dni
Posty: 620
Nick w MP: Dexnes

Piwa: 1394

Respekt: 390
Respekt: 390Respekt: 390Respekt: 390Respekt: 390

Tutaj masz :

        local pp=getElementData(veh,"paliwo")
        if (pp and pp[2] and pp[2]>0then
            local paliwo,bak=unpack(pp)
            dxDrawImage fuel_Xfuel_Yfuel_Wfuel_H'img/paliwo.png' )

            --[[        if (paliwo<1then    -- spowalniamy pojazd!
                setElementVelocity(v,vx/2,vy/2,vz/2)
            end]]--
            

--            if (lastFuelLevel-paliwo>1then
--                lastFuelLevel=lastFuelLevel-1
--            elseif (lastFuelLevel-paliwo<1then
--                lastFuelLevel=lastFuelLevel+1
--            end

            local px,py=GetFuelXY(fuelw_X,fuelw_Ypaliwo/bak*100fuelw_W)
            dxDrawLine(fuelw_X,fuelw_Ypx,pytocolor(155,0,0), 3)
        end





local nieTankowalne={
  [509]=true,    -- 3x rowery
  [510]=true,
  [481]=true,  
}


local function pojazdTankowalny(veh)
  if (not isElement(veh)) then return false end
  if (getElementType(veh)~="vehicle"then return false end
  if (not getElementData(veh"dbid")) then return false end
  if (not getElementData(veh"paliwo")) then return false end
  local vm=getElementModel(veh)
  if nieTankowalne[vmthen return false end
  local typSilnika=getVehicleHandling(veh).engineType
  if (typSilnika=="electric"then return false end
  return true
end

local function pojazdZuzywaPaliwo(veh)
  if (not isElement(veh)) then return false end
  if (getElementType(veh)~="vehicle"then return false end
  if (not getElementData(veh"dbid")) then return false end
  if (not getElementData(veh"paliwo")) then return false end
  local vm=getElementModel(veh)
  if nieTankowalne[vmthen return false end

  return true
end


function getElementSpeed(element,unit)
if (unit == nilthen unit 0 end
if (isElement(element)) then
local x,y,getElementVelocity(element)
if (unit=="mph" or unit==or unit =='1'then
return (x^y^z^2) ^ 0.5 100
else
return (x^y^z^2) ^ 0.5 1.61 100
end
else
  return 0
  end
end


setTimer(function()
  local v=getPedOccupiedVehicle(localPlayer)
  if (not vthen return end
  if (not getVehicleEngineState(v)) then return end
  if (getVehicleController(v)~=localPlayerthen return end
  if (not pojazdZuzywaPaliwo(v)) then return end

  local spd=getElementSpeed(v)
  local spd=spd/4000+0.0001

  local pp=getElementData(v,"paliwo")
  if (pp and pp[2] and pp[2]>0then
    local paliwo,bak=unpack(pp)
    paliwo=paliwo-spd
    if (paliwo<0then paliwo=0 end
    if (paliwo<0.1then
      triggerServerEvent("setVehicleEngineState"vfalse)
      triggerServerEvent("broadcastCaptionedEvent"localPlayer"W poje?dzie ga?nie silnik."55true)
    end
    setElementData(v,"paliwo", {paliwo,bak})
  end

end50000)


Postaw piwo autorowi tego posta
 

 
Tagi: wskazówka :: 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 » wskazówka paliwa 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