Wysłany: 2017-05-02, 14:06
zombiaczek11
Wiek: 30 Na forum: 3576 dni Posty: 26
Nick w MP: Danio
Piwa : 2
Witam mam problem taki i? wyskakuje mi blad taki i nw jak go mam naprawi? wyskakuje on co 5 sekund ERROR: rpg_vehicles/vehicles_global.lua:25: attempt to compare nil with number
local custom_vehicles = { -- Do rozwini ? cia
[ 604 ] = { name = "MFK" },
}
function getVehicleCustomName ( model )
local name = ""
if custom_vehicles [ model ] then
name = custom_vehicles [ model ]. name
else
name = getVehicleNameFromModel ( model )
end
return name
end
function zgasSilnik ()
for i , v in ipairs ( getElementsByType ( "vehicle" )) do
local data = getElementData ( v , "veh:fuel" )
if data then
if tonumber ( data ) <= 0 then
setVehicleEngineState ( v , false )
end
end
end
end
setTimer ( zgasSilnik , 1000 , 0 )
function zgasSilnikGas ()
for i , v in ipairs ( getElementsByType ( "vehicle" )) do
local data = getElementData ( v , "veh:gas" )
if data then
if tonumber ( data ) <= 0 then
setVehicleEngineState ( v , false )
end
end
end
end
setTimer ( zgasSilnikGas , 1000 , 0 )
Prosze o pomoc za pomoc daje +
Wysłany: 2017-05-02, 16:58
mlodasnygo
Wiek: 16 Na forum: 3973 dni Posty: 205
Piwa : 518
Witam
Wed?ug mnie pogubi? si? if
local custom_vehicles = { -- Do rozwini ? cia
[ 604 ] = { name = "MFK" },
}
function getVehicleCustomName ( model )
local name = ""
if custom_vehicles [ model ] then
name = custom_vehicles [ model ]. name
else
name = getVehicleNameFromModel ( model )
end
return name
end
function zgasSilnik ()
for i , v in ipairs ( getElementsByType ( "vehicle" )) do
local data = getElementData ( v , "veh:fuel" )
if data then
if tonumber ( data ) <= 0 then
setVehicleEngineState ( v , false )
end
end
end
end
setTimer ( zgasSilnik , 1000 , 0 )
function zgasSilnikGas ()
for i , v in ipairs ( getElementsByType ( "vehicle" )) do
local data = getElementData ( v , "veh:gas" )
if data then
if tonumber ( data ) <= 0 then setVehicleEngineState ( v , false )
end
end
end
end
setTimer ( zgasSilnikGas , 1000 , 0 )
W 25 linijce end by? postawiony w z?ym miejscu i system si? gubi?
Podpis
600 dni -
10 marca 2017
500 piw -
10 marca 2017
Wysłany: 2017-05-02, 18:28
_Haze
Peace Yo!
Wiek: 24 Na forum: 4185 dni Posty: 1648
Nick w MP: Haze
Piwa : 2628
spr?buj doda? w ifie if tonumber ( data ) <= 0 then da? tak
if tonumber ( data ) and tonumber ( data ) <= 0 then
Więcej szczegółów
Wystawiono 1 piw(a):zombiaczek11
Wysłany: 2017-05-02, 20:19
zombiaczek11
Wiek: 30 Na forum: 3576 dni Posty: 26
Nick w MP: Danio
Piwa : 2
Tagi: pojazdy
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: