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: 4301 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: 4542 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: 4301 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: 4542 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]>0) then
            local paliwo,bak=unpack(pp)
            dxDrawImage ( fuel_X, fuel_Y, fuel_W, fuel_H, 'img/paliwo.png' )

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

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

            local px,py=GetFuelXY(fuelw_X,fuelw_Y, paliwo/bak*100, fuelw_W)
            dxDrawLine(fuelw_X,fuelw_Y, px,py, tocolor(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[vm] then 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[vm] then return false end

  return true
end


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


setTimer(function()
  local v=getPedOccupiedVehicle(localPlayer)
  if (not v) then return end
  if (not getVehicleEngineState(v)) then return end
  if (getVehicleController(v)~=localPlayer) then 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]>0) then
    local paliwo,bak=unpack(pp)
    paliwo=paliwo-spd
    if (paliwo<0) then paliwo=0 end
    if (paliwo<0.1) then
      triggerServerEvent("setVehicleEngineState", v, false)
      triggerServerEvent("broadcastCaptionedEvent", localPlayer, "W poje?dzie ga?nie silnik.", 5, 5, true)
    end
    setElementData(v,"paliwo", {paliwo,bak})
  end

end, 5000, 0)


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