Wysłany: 2020-04-16, 01:32
killercycDDS
Migacz
Wiek: 25 Na forum: 4512 dni Posty: 629
Nick w MP: killer_cyc[DDS]
Piwa : 1659
Witam mam problem z usuni?ciem naczepy auto usuwa ale naczepy ju? nie.
local auto = createVehicle ( 515 ,- 1733.19 , 120.02 , 4.60 , 359.7 , 0.0 , 178.9 )
local naczepa = createVehicle ( 435 , - 1733.75 , 204.56 , 3.26 , 0.0 , 360.0 , 176.9 )
function zakoncz_prace ( auto , naczepa )
local cars = getAttachedElements ( auto , naczepa )
for i , v in pairs ( cars ) do
if v and isElement ( v ) then destroyElement ( v ) end
end
setElementData ( source , "praca:truck" , false )
destroyElement ( auto )
destroyElement ( naczepa )
end
Bad argument @ 'destroyElement' [ Expected element at argument 1 , got nil ]
Wysłany: 2020-04-16, 04:37
Krasnoludek
Wiek: 46 Na forum: 2242 dni Posty: 31
Nick w MP: Lottus!
a gdyby takie co? zrobi?, a i jakie? b??dy w db3?
Kod: local auto = createVehicle(515,-1733.19, 120.02, 4.60, 359.7, 0.0, 178.9)
local naczepa = createVehicle(435, -1733.75, 204.56, 3.26, 0.0, 360.0, 176.9)
function zakoncz_prace( auto , naczepa)
local cars = getAttachedElements(auto,naczepa)
for i,v in pairs(cars) do
if v and isElement(v) then destroyElement(v) end
end
setElementData(source,"praca:truck",false)
destroyElement(auto) and destroyElement(naczepa)
end
Bad argument @ 'destroyElement' [Expected element at argument 1, got nil]
Wysłany: 2020-04-16, 07:51
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
Masz w sumie 3 funkcj? do usuwania 2 element?w. Nic dziwnego, ?e jedna funkcja wyrzuci b??d. Albo pobierasz przyczepione elementy (co powinno zosta?) albo u?ywasz do usuwania konkretnej zmiennej.
Wysłany: 2020-04-16, 11:18
killercycDDS
Migacz
Wiek: 25 Na forum: 4512 dni Posty: 629
Nick w MP: killer_cyc[DDS]
Piwa : 1659
Mo?esz mi wyt?umaczy? bo teraz usun??em pentle i zrobi?e same destroyelement na auto i naczep? i dalej wywala b??d
function zakoncz_prace ( auto , naczepa )
setElementData ( source , "praca:truck" , false )
destroyElement ( auto )
destroyElement ( naczepa )
end
Wysłany: 2020-04-16, 11:21
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
Nie definiuj oddzielnie 'auto' i 'naczepa' bo te 2 elementy ju? masz zdefiniowane poza funkcj?.
Wysłany: 2020-04-16, 11:23
killercycDDS
Migacz
Wiek: 25 Na forum: 4512 dni Posty: 629
Nick w MP: killer_cyc[DDS]
Piwa : 1659
dalej ten sam b??d tylko teraz na obu destroy element Bad argument @ 'destroyElement' [Expected element at argument 1, got nil]
Tagi: nie :: usuwa :: naczemy
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: