#1 28-12-2009 20:48

knightrider1994
Registered: 14-12-2009
Posts: 13

change car color while driving

hi, i need help, i want to change the color of the car whille driving,
but if i press the button that would activate that, the game crashes.....
heres the script:

{$VERSION 3.1.0027}
{$CLEO .cs}

//-------------MAIN---------------
thread 'COLORCHNG'

:COLORCHNG_21
wait 10
if
Player.Defined($PLAYER_CHAR)
else_jump @COLORCHNG_21
if or
Actor.DrivingVehicleType($PLAYER_ACTOR, #ESPERANT)
Actor.DrivingVehicleType($PLAYER_ACTOR, #MANANA)
Actor.DrivingVehicleType($PLAYER_ACTOR, #PEREN)
Actor.DrivingVehicleType($PLAYER_ACTOR, #PREVION)
Actor.DrivingVehicleType($PLAYER_ACTOR, #BFINJECT)
Actor.DrivingVehicleType($PLAYER_ACTOR, #HERMES)
else_jump @COLORCHNG_21

if
0AB0:  key_pressed 67
else_jump @COLORCHNG_22
03C0: 0@ = actor $PLAYER_ACTOR car
0229: set_car 0@ primary_color_to 1 secondary_color_to 1
010D: set_player $PLAYER_ACTOR wanted_level_to 0
jump @COLORCHNG_21
:COLORCHNG_22
if and
0AB0:  key_pressed 67
0AB0:  key_pressed 8
else_jump @COLORCHNG_21
03C0: 0@ = actor $PLAYER_ACTOR car
0229: set_car 0@ primary_color_to 0 secondary_color_to 0
jump @COLORCHNG_21

anybody knows how to do/fix that?

Offline

#2 29-12-2009 13:09

robertom2002
Registered: 17-12-2009
Posts: 22

Re: change car color while driving

I think beacause there's no color 0

Offline

#3 29-12-2009 23:07

Alien
Registered: 12-10-2008
Posts: 564

Re: change car color while driving

robertom2002 wrote:

I think beacause there's no color 0

it is.
the mistake in command
[c]010D: set_player $PLAYER_ACTOR wanted_level_to 0[/c]
Player, not actor. Default player has No 0 ($PLAYER_CHAR) (and 1 ($SECOND_PLAYER) in 2-players mode).

{$CLEO}

while true
    wait 250
    if
        0AB0:  key_pressed 67
    then
        if
            player.Defined($PLAYER_CHAR)
        then
            if or
                Actor.DrivingVehicleType($PLAYER_ACTOR, #ESPERANT)
                Actor.DrivingVehicleType($PLAYER_ACTOR, #MANANA)
                Actor.DrivingVehicleType($PLAYER_ACTOR, #PEREN)
                Actor.DrivingVehicleType($PLAYER_ACTOR, #PREVION)
                Actor.DrivingVehicleType($PLAYER_ACTOR, #BFINJECT)
                Actor.DrivingVehicleType($PLAYER_ACTOR, #HERMES)
            then
                03C0: 0@ = actor $PLAYER_ACTOR car
                if
                    0AB0:  key_pressed 8
                then
                    0229: set_car 0@ primary_color_to 0 secondary_color_to 0                
                else
                    0229: set_car 0@ primary_color_to 1 secondary_color_to 1
                end
                010D: set_player $PLAYER_CHAR wanted_level_to 0
                wait 500            
            end        
        end    
    end
end

Offline

#4 01-01-2010 02:25

knightrider1994
Registered: 14-12-2009
Posts: 13

Re: change car color while driving

thanks, heres a video of all the scripts i made in the last month/the whole year 2009
[youtube]http://www.youtube.com/watch?v=96yG-vP28PQ[/youtube]
another question can i change the texture of anything while the game? i wanted to change the licence plate (its not the standard gta plate,its a special knight plate)

Offline

Board footer

Powered by FluxBB