Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: bak
1. element daty na bak
Witam ot??, mam taki kodzik na baki, dzia?a?o mi to kiedy?, lecz po dodaniu kolejnej element daty na bak nie dzia?a. Wszystko w bazie danych dzia?a, tylko nie zwi?ksza si? limit paliwa jak si? tankuje a ma si? element dat? na bak 90dm3. Nie ma ?adnego b??du w DB3.
function tankuj()
    if 
getPedOccupiedVehicle(localPlayerthen
        local limit 
35
        
if (getElementData(getPedOccupiedVehicle(localPlayer), "vehicle:bak") == "50dm3"then
            limit 
50
        end
        
if (getElementData(getPedOccupiedVehicle(localPlayer), "vehicle:bak") == "90dm3"then
            limit 
90
        end            
        
if (getElementData(getPedOccupiedVehicle(localPlayer), "vehicle:fuel") >= limitthen 
            
return 
        
end
        triggerServerEvent
("TANKUJ",localPlayer)
    
end
end
2. Powiekszony bak !
Witam ot?? mam kod na elektryki i chcia?ym o pomoc jak to przerobi? na powi?kszane baki pr?bowa?em, doda? sam, stworzy? zapisy w sql "bak" oraz element daty, lecz nie ogarniam, wi?c prosi? bym o pomoc w przerobieniu elektryk?w !
kod

c_paliwo
[lua]--[[
Resource: OURGame
Developers: Split <[email protected]>
Copyright <[email protected]> 2015-2016
You have no right to use this code without my permission.
]]

-- Kod odpowiadaj?cy za odejmowanie paliwa oraz dodawanie paliwa
-- Wszelkie inne rzeczy s? w systemie pojazd?w // Split
local time=getTickCount()
local isBike={[509]=true,[481]=true,[510]=true}

elektrytki = {
[507] = true,
[559] = true,
}
function isEventHandlerAdded( sEventName, pElementAttachedTo, func )
if
type( sEventName ) == 'string' and
isElement( pElementAttachedTo ) and
type( func ) == 'function'
then
local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo )
if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then
for i, v in ipairs( aAttachedFunctions ) do
if v == func then
return true
end
end
end
end

return false
end
local function naliczaj(veh)
if getTickCount()-time>5000 then
time = getTickCount()
local fuel = getElementData(veh, "vehicle:fuel") or 0
local mileage = getElementData(veh,"vehicle:mileage") or 0
local vx,vy,vz = getElementVelocity(veh)
local s...