Jump to content

What's wrong with this code?


Gouveia

Recommended Posts

Hey. Now I'm liking coding so much dudes! I tried to make a code that when you enter in a van you get a RCBaron, but the game NEVER loads! Here's the code:

 

Create Thread:

 

004F: create_thread ££MansionRC1  

 

 

Van Spawn:

 

014B: $RCVAN1 = init_parked_car_generator #RUMPO -1 -1 0 alarm 0 door_lock 0 0 10000 at -273.500 -631.333 9.368 angle 180.0014C: set_parked_car_generator $RCVAN1 cars_to_generate_to 101

 

 

Main Code:

 

:MansionRC100D6: if 00256: player $PLAYER_CHAR defined004D: jump if false ££MansionRC1         0247: request_model #RCBARON038B: load_requested_models0002: jump ££MansionRC2:MansionRC200D6: if 000DC: player $PLAYER_CHAR driving_car $RCVAN1   004D: jump if false ££MansionRC2016A: fade 1000 ms 1046E: init_player $PLAYER_CHAR rc_car -318.800 -631.333 9.381 180.0 #RCBARON   016A: fade 1000 ms 00002: jump ££MansionRC3:MansionRC300D6: if 000E1: is_key_pressed 0 17    004D: jump if false ££MansionRC30409: blow_up_rc_buggy016A: fade 500 ms 1016A: fade 500 ms 00002: jump ££MansionRC2004E: end_thread

 

 

Well, try to see if something is wrong, please! Thanks is advance

 

-Gouveia

Link to comment
Share on other sites

Leaving for work now, but I see no waits. Add a wait 0 after the MansionRC1 label and see if that helps. I'll try to look it over in the morning.

Link to comment
Share on other sites

space_einstein

:MansionRC1

wait 250 ms ;; you have to put a wait here because it is in loop. if you don't the game will freeze

00D6: if 0

0256: player $PLAYER_CHAR defined

004D: jump if false ££MansionRC1

00D6: if 1

00DD: actor $PLAYER_ACTOR driving_vehicle_type #RUMPO // didn't tried your way but this is how Rockstar did it

00FE: actor $PLAYER_ACTOR sphere 0 X Y Z radius 4.0 4.0 3.0

004D: jump if false ££MansionRC1 ;; shorter way to do this

0247: request_model #RCBARON ;; load model after you are in the van. useless to load model before you are in van

038B: load_requested_models

016A: fade 1000 ms 1

046E: init_player $PLAYER_CHAR rc_car -318.800 -631.333 9.381 180.0 #RCBARON

016A: fade 1000 ms 0

;;0002: jump ££MansionRC3 ;; don't need jump since you are going directly to it anyway

 

:MansionRC3

wait 250 ms ;; again in loop

00D6: if 0

00E1: is_key_pressed 0 17

004D: jump if false ££MansionRC3

0409: blow_up_rc_buggy

016A: fade 500 ms 1

wait 500 ms ;; for the fade to actually work

016A: fade 500 ms 0

0002: jump ££MansionRC1 ;; jump back to top

Link to comment
Share on other sites

thanks dudes... Now I want to know if it is posible to load the real models when I get out of player's range, because I can only see LODs.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.