chamber Posted March 9, 2013 Share Posted March 9, 2013 A little pseudocode, just to make things easier to read. :MAKESTUFcreate_thread @MAKEGOcreate_thread @CHEKSTUFjump @A_LOOP_NOT_INCLUDED_IN_THIS_EXAMPLE:CHEKSTUFthread 'CHEKSTUF'wait 0if or02BF: is_car_in_water $URCARActor.Dead($PLAYER_ACTOR)00E1: player 0 pressed_key 15then 0459: end_thread_named 'MAKEGO' jump @CLEANUPendjump @CHEKSTUF:MAKEGO03A4: name_thread 'MAKEGO'// Do thingswait 60000// Do more thingswait 60000// Do more things:CLEANUP// Do some other stuffend_thread I can post the full code if needed, but this is essentially a turret mission - if the player dies, the vehicle goes in the water, or the player intentionally exits the vehicle, I need thread 'CHEKSTUF' to kill thread 'MAKEGO' and then do some stuff (removing references to the vehicle, removing the player from the turret, etc). For whatever reason though, it does the stuff in :CLEANUP, but opcode 0459 isn't killing the thread, so I later get a crash after the 'wait's, as the MAKEGO thread is still chugging along, trying to do things to a vehicle that no longer exists. Why? Link to comment Share on other sites More sharing options...
ZAZ Posted March 9, 2013 Share Posted March 9, 2013 code looks good and works for me, thread 'MAKEGO' stoped by keypress 15 unless is_car_in_water $URCAR i couldn't check CLEO MODS CLEO Script Tutorial 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