#1 17-10-2010 23:16

rooood
Registered: 17-10-2010
Posts: 3

"add_car_component" Not working

I'm doing a script that saves the last car the player drove and loads it later.
The script is almost like the example from the cleo tutorial, but saving more things.
One of these things is the car mods, like wheels, nitro, etc, but everytime the script runs this specific line it crashes:

06E7: 21@ = add_car_component 24@ to_car 0@

21@ is an unused var just to fullfil the parameter, 24@ is the component model obtained with the opcode 096D.

Of course I'm loading the component and checking is it already loaded before running this, but it keeps crashing.
This is the code that adds the component:
    if
    24@ <> 0
    then
        repeat
            wait 0
        until 06EA:   car_component_available 24@
        06E7: 21@ = add_car_component 24@ to_car 0@
        06EB: release_car_component 24@
    end

Why isn't this working? I'm declaring 24@ as Integer btw.

Oh, and btw there is a better way to save all components rather than trying to save like 5 (or another specific amount of) itens?
Because sometimes there's only one, sometimes there's more than 5 components.

Offline

Board footer

Powered by FluxBB