Peppo_o'Paccio Posted March 14, 2010 Share Posted March 14, 2010 (edited) Well, I created a script that spawns a Bullet on the Chiliad typing DRIVE on the keyboard. I can spawn the Bullet, and for 5 seconds appears a marker on it. But when I destroy/go away from the vehicle, my game crashes . This is the code {$CLEO .cs}:Car03A4: name_thread 'DRIVE':Car_10001: wait 0 ms if0256: player $PLAYER_CHAR defined004D: jump_if_false @Car_1 :Letters_10001: wait 0 msif 0AB0: key_pressed 68 //----------D004D: jump_if_false @Letters_1:Letters_20001: wait 0 ms if0AB0: key_pressed 82 //----------R004D: jump_if_false @Letters_2:Letters_30001: wait 0 ms if0AB0: key_pressed 73 //----------I004D: jump_if_false @Letters_3:Letters_40001: wait 0 ms if0AB0: key_pressed 86 //----------V004D: jump_if_false @Letters_4:Letters_50001: wait 0 ms if0AB0: key_pressed 69 //----------E004D: jump_if_false @Letters_50001: wait 0 ms 0002: jump @Loading:Loading0001: wait 0 ms 0247: load_model #BULLET :Checking0001: wait 0 msif0248: model #BULLET available004D: jump_if_false @Checking00A5: [email protected] = create_car #BULLET at -2235.6467 -1727.957 480.85450175: set_car [email protected] Z_angle_to 187.71310186: [email protected] = create_marker_above_car [email protected]: set_marker [email protected] type_to 10249: release_model #BULLET:Car_20001: wait 5000 ms if0256: player $PLAYER_CHAR defined004D: jump_if_false @Car_2 0164: disable_marker [email protected]:Car_30001: wait 0 msif0256: player $PLAYER_CHAR defined 004D: jump_if_false @Car_3 if8202: not actor $PLAYER_ACTOR near_car [email protected] radius 500.0 500.0 flag 0004D: jump_if_false @Car_301C3: remove_references_to_car [email protected] 0002: jump @Car_10A93: end_custom_thread I don't know what's wrong . Please, can anyone help me? EDIT: Now it works! I replaced 01C3: remove_references_to_car [email protected] with 00A6: destroy_car [email protected] Really better. Edited March 14, 2010 by Peppo_o'Paccio Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now