Wysłany: 2017-07-06, 11:45
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
Witam, posiadam cudzy kod jednej z pracy kosiarki i naprawiam w niej b??dy.
Mam problem poniewa? nie wiem jak naprawi? dwa errory:
Kod:
ERROR: praca/client.lua:13: attempt to perform arithmetic on local 'trawa' (a boolean value)
ERROR: praca/client.lua:8: attempt to perform arithmetic on local 'px' (a boolean value)
Kod:
addEventHandler ( "onClientRender" , root ,
function ()
if not isPedInVehicle ( localPlayer ) then return end
local veh = getPedOccupiedVehicle ( localPlayer )
local px , py , psz = getElementVelocity ( veh )
local predkosct = math . ceil ((( px ^ 2 + py ^ 2 + psz ^ 2 )^( 0.5 ))* 140 )
if predkosct >= 1 then
local trawa = getElementData ( veh , "trawa" )
local zebranat = trawa + 0.03
local trawa1 = setElementData ( veh , "trawa" , zebranat )
end
end
)
addEventHandler ( "onClientVehicleExit" , resourceRoot , function( plr , seat )
if seat == 0 then
if plr == localPlayer then
destroyElement ( veh )
end
end
end )
Wysłany: 2017-07-06, 13:17
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
pojazd nie ma elementdaty trawa
Podpis
"amited" napisał/a :
Wysłany: 2017-07-06, 16:04
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
Naprawi?em samemu b??d, w onClientRender doda?em warunek czy gracz posiada rozpocz?t? prac?.
do zamkni?cia
Tagi: boolean :: value
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: