Jerry123 Posted August 7, 2010 Share Posted August 7, 2010 (edited) I created a script that makes police to driveby you but it just does nothing. {$CLEO}:1thread 'POLICE':2wait 0if andplayer.Defined($player_char)player.Controllable($player_char)Actor.Driving($player_Actor)Player.WantedLevel($player_char) > 1jf @2:CARAVAILABLEwait 0gosub @[email protected] == -1jf @GETMODELjump @CARAVAILABLE:CARSUBActor.StorePos($player_Actor, [email protected] [email protected] [email protected])073E: get_car_in_sphere [email protected] [email protected] [email protected] radius 50.0 model -1 handle_as [email protected]:GETMODELwait 0if orCar.Model([email protected]) == #COPCARLACar.Model([email protected]) == #COPCARSFCar.Model([email protected]) == #COPCARRUCar.Model([email protected]) == #COPCARVGCar.Model([email protected]) == #COPBIKEjf @CARAVAILABLE:GETDRIVER046C: [email protected] = car [email protected] driver:DRIVERAVAILABLEwait [email protected] == -1jf @PEDTYPECar.RemoveReferences([email protected])jump @CARAVAILABLE:PEDTYPE089F: get_actor [email protected] pedtype_to [email protected]:DRIVERCHECKwait 0if NOT [email protected] == 6jf @ACTORActor.RemoveReferences([email protected])Car.RemoveReferences([email protected])jump @CARAVAILABLE:ACTOR0665: get_actor [email protected] model_to [email protected] Model.Load([email protected])repeatwait 0until Model.Available([email protected])#MICRO_UZI.Load()repeatwait 0until #MICRO_UZI.Available():CREATE01C8: [email protected] = create_actor_pedtype 6 model [email protected] in_car [email protected] passenger_seat 001B2: give_actor [email protected] weapon 28 ammo 9999 // Load the weapon model before using this07DD: set_actor [email protected] temper_to 10001B9: set_actor [email protected] armed_weapon_to 28 0713: actor [email protected] driveby_actor $player_Actor car -1 point 0.0 0.0 0.0 radius 100.0 4 1 firing_rate 100Car.RemoveReferences([email protected])Model.Destroy([email protected])#MICRO_UZI.Destroy()jump @2 Edited August 8, 2010 by Jerry123 Link to comment Share on other sites More sharing options...
ZAZ Posted August 7, 2010 Share Posted August 7, 2010 (edited) :2wait 0if andplayer.Defined($player_char)player.Controllable($player_char)Actor.Driving($player_Actor)Player.WantedLevel($player_char) > 1jf @2//VVVVVVVVV//the thread reading process runs into the subscript and crash when it reads return//VVVVVVVVV:CARSUBActor.StorePos($player_Actor, [email protected] [email protected] [email protected])073E: get_car_in_sphere [email protected] [email protected] [email protected] radius 50.0 model -1 handle_as [email protected] the thread reading process runs into the subscript and crash when it reads return the subscript should only be read when the gosub @CARSUB sends to the subscript :2wait 0if andplayer.Defined($player_char)player.Controllable($player_char)Actor.Driving($player_Actor)Player.WantedLevel($player_char) > 1jf @2:CARAVAILABLEwait 0gosub @[email protected] == -1jf @GETMODELjump @CARAVAILABLE:CARSUBActor.StorePos($player_Actor, [email protected] [email protected] [email protected])073E: get_car_in_sphere [email protected] [email protected] [email protected] radius 50.0 model -1 handle_as [email protected] Edited August 7, 2010 by ZAZ CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Jerry123 Posted August 7, 2010 Author Share Posted August 7, 2010 :2wait 0if andplayer.Defined($player_char)player.Controllable($player_char)Actor.Driving($player_Actor)Player.WantedLevel($player_char) > 1jf @2//VVVVVVVVV//the thread reading process runs into the subscript and crash when it reads return//VVVVVVVVV:CARSUBActor.StorePos($player_Actor, [email protected] [email protected] [email protected])073E: get_car_in_sphere [email protected] [email protected] [email protected] radius 50.0 model -1 handle_as [email protected] the thread reading process runs into the subscript and crash when it reads return the subscript should only be read when the gosub @CARSUB sends to the subscript :2wait 0if andplayer.Defined($player_char)player.Controllable($player_char)Actor.Driving($player_Actor)Player.WantedLevel($player_char) > 1jf @2:CARAVAILABLEwait 0gosub @[email protected] = -1jf @GETMODELjump @CARAVAILABLE:CARSUBActor.StorePos($player_Actor, [email protected] [email protected] [email protected])073E: get_car_in_sphere [email protected] [email protected] [email protected] radius 50.0 model -1 handle_as [email protected] Thanks ZAZ. I edited my post with the current version of my script. But still crashes Link to comment Share on other sites More sharing options...
ZAZ Posted August 7, 2010 Share Posted August 7, 2010 jump @CARSUB cause the same failure like I mentioned in previous post [email protected] = -1 is not a condition a condition have 2 equal signes (i havn't seen it in previous post and reposted it wrong): [email protected] == -1 btw. you're far far away to get the script work as you want doing stuff with random cars is a difficult theme you should write easier scripts CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Jerry123 Posted August 8, 2010 Author Share Posted August 8, 2010 jump @CARSUB cause the same failure like I mentioned in previous post [email protected] = -1 is not a condition a condition have 2 equal signes (i havn't seen it in previous post and reposted it wrong): [email protected] == -1 btw. you're far far away to get the script work as you want doing stuff with random cars is a difficult theme you should write easier scripts Thanks. I corrected some WRONGS and now it doesn't crash but it does nothing.... (FEUER ) Link to comment Share on other sites More sharing options...
ZAZ Posted August 8, 2010 Share Posted August 8, 2010 jump @CARSUB cause the same failure like I mentioned in previous post [email protected] = -1 is not a condition a condition have 2 equal signes (i havn't seen it in previous post and reposted it wrong): [email protected] == -1 btw. you're far far away to get the script work as you want doing stuff with random cars is a difficult theme you should write easier scripts Thanks. I corrected some WRONGS and now it doesn't crash but it does nothing.... (FEUER ) add a marker to your car to see what happens CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Jerry123 Posted August 8, 2010 Author Share Posted August 8, 2010 jump @CARSUB cause the same failure like I mentioned in previous post [email protected] = -1 is not a condition a condition have 2 equal signes (i havn't seen it in previous post and reposted it wrong): [email protected] == -1 btw. you're far far away to get the script work as you want doing stuff with random cars is a difficult theme you should write easier scripts Thanks. I corrected some WRONGS and now it doesn't crash but it does nothing.... (FEUER ) add a marker to your car to see what happens I created it on the begin of GetModel but the MArker only appears on Vehicles that are NOT Police Vehicles... WTF Link to comment Share on other sites More sharing options...
ZAZ Posted August 8, 2010 Share Posted August 8, 2010 (edited) jump @CARSUB cause the same failure like I mentioned in previous post [email protected] = -1 is not a condition a condition have 2 equal signes (i havn't seen it in previous post and reposted it wrong): [email protected] == -1 btw. you're far far away to get the script work as you want doing stuff with random cars is a difficult theme you should write easier scripts Thanks. I corrected some WRONGS and now it doesn't crash but it does nothing.... (FEUER ) add a marker to your car to see what happens I created it on the begin of GetModel but the MArker only appears on Vehicles that are NOT Police Vehicles... WTF Exactly, but it isn't the case that the engine don't catch police cars. The problem is that the engine catches any cars and you must wait a long time till it catches a police car. You have to do more complex methods. Test the script below It catches the police cars if wantedlevel is bigger than 0, add a marker and let it explode {$CLEO .cs}:MultRandCar_103A4: name_thread 'MultRandCar'0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = 0 // integer values0006: [email protected] = 8 // integer values0006: [email protected] = -1 // integer [email protected] = 0:MultRandCar_20001: wait 250 ms00D6: if 00256: player $PLAYER_CHAR defined004D: jump_if_false @MultRandCar_2077E: get_active_interior_to [email protected] and010F: player $PLAYER_CHAR wanted_level > 00039: [email protected] == 0 // integer values 0038: $ONMISSION == 0 8965: not actor $PLAYER_ACTOR swimming 84A7: not actor $PLAYER_ACTOR driving_boat 89AE: not actor $PLAYER_ACTOR driving_train 004D: jump_if_false @MultRandCar_20819: [email protected] = actor $PLAYER_ACTOR distance_from_ground if 0023: 20.0 > [email protected] 004D: jump_if_false @MultRandCar_20002: jump @MultRandCar_503F0: enable_text_draw 1045A: text_draw_1number 150.0 40.0 'NUMBER' [email protected] // value045A: text_draw_1number 170.0 40.0 'NUMBER' [email protected] // value045A: text_draw_1number 220.0 50.0 'NUMBER' [email protected] // value045A: text_draw_1number 300.0 50.0 'NUMBER' [email protected] // value0006: [email protected]([email protected],16i) = -104C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset -50.0 -50.0 0.004C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset 50.0 50.0 0.0//053E: [email protected]([email protected],16i) = get_random_car_with_actors -1 in_area [email protected] [email protected] [email protected] [email protected]//053E: [email protected]([email protected],16i) = get_random_car_with_model -1 in_rectangle_cornerA [email protected] [email protected] cornerB [email protected] [email protected]: gosub @MultRandCar_Table0001: wait 50 ms00D6: if 08039: NOT [email protected]([email protected],16i) == -1 // integer values004D: jump_if_false @MultRandCar_20441: [email protected] = car [email protected]([email protected],16i) modelif [email protected] == [email protected] == [email protected] == [email protected] == [email protected] == [email protected] == [email protected] == 528004D: jump_if_false @MultRandCar_30186: [email protected] = create_marker_above_car [email protected]([email protected],16i)07E0: set_marker [email protected] type_to 10085: [email protected] = [email protected] // (int)//0085: [email protected] = [email protected] // (int)if0119: car [email protected]([email protected],16i) wrecked 004D: jump_if_false @MultRandCar_30001: wait 500 ms0164: disable_marker [email protected]: [email protected] = -1 // integer values0006: [email protected] = 8 // integer values0001: wait 500 ms:MultRandCar_3000A: [email protected] += 1 // integer values0001: wait 250 ms:MultRandCar_50001: wait 250 ms00D6: if 00256: player $PLAYER_CHAR defined004D: jump_if_false @MultRandCar_13077E: get_active_interior_to [email protected] and010F: player $PLAYER_CHAR wanted_level > 00039: [email protected] == 0 // integer values 0038: $ONMISSION == 0 8965: not actor $PLAYER_ACTOR swimming 84A7: not actor $PLAYER_ACTOR driving_boat 89AE: not actor $PLAYER_ACTOR driving_train 004D: jump_if_false @MultRandCar_130819: [email protected] = actor $PLAYER_ACTOR distance_from_ground if 0023: 20.0 > [email protected] 004D: jump_if_false @MultRandCar_1303F0: enable_text_draw 1045A: text_draw_1number 150.0 50.0 'NUMBER' [email protected] // value045A: text_draw_1number 170.0 50.0 'NUMBER' [email protected] // value045A: text_draw_1number 220.0 50.0 'NUMBER' [email protected] // value045A: text_draw_1number 300.0 50.0 'NUMBER' [email protected] // valueif002D: [email protected] >= [email protected] // integer values004D: jump_if_false @MultRandCar_704C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset -50.0 -50.0 0.004C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset 50.0 50.0 0.0//053E: [email protected]([email protected],16i) = get_random_car_with_actors -1 in_area [email protected] [email protected] [email protected] [email protected]//053E: [email protected]([email protected],16i) = get_random_car_with_model -1 in_rectangle_cornerA [email protected] [email protected] cornerB [email protected] [email protected]: gosub @MultRandCar_Table0001: wait 50 ms00D6: if 08039: NOT [email protected]([email protected],16i) == -1 // integer values004D: jump_if_false @MultRandCar_50441: [email protected] = car [email protected]([email protected],16i) modelif [email protected] == [email protected] == [email protected] == [email protected] == [email protected] == [email protected] == [email protected] == 528 004D: jump_if_false @MultRandCar_6if8039: NOT [email protected] == -1 // integer values004D: jump_if_false @MultRandCar_5aif803B: not [email protected]([email protected],16i) == [email protected]([email protected],16i)004D: jump_if_false @MultRandCar_6:MultRandCar_5a0085: [email protected] = [email protected] // (int)0186: [email protected] = create_marker_above_car [email protected]([email protected],16i)07E0: set_marker [email protected] type_to 1//0085: [email protected] = [email protected] // (int)if0119: car [email protected]([email protected],16i) wrecked 004D: jump_if_false @MultRandCar_5b0001: wait 500 ms0164: disable_marker [email protected]//0006: [email protected] = -1 // integer values//0006: [email protected] = 8 // integer values0002: jump @MultRandCar_6:MultRandCar_5b0001: wait 500 ms0164: disable_marker [email protected]: explode_car [email protected]([email protected],16i) // versionA0001: wait 500 ms:MultRandCar_6000A: [email protected] += 1 // integer values0002: jump @MultRandCar_5:MultRandCar_70006: [email protected] = 0 // integer values:MultRandCar_90001: wait 250 ms03F0: enable_text_draw 1045A: text_draw_1number 150.0 60.0 'NUMBER' [email protected] // value045A: text_draw_1number 170.0 60.0 'NUMBER' [email protected] // value045A: text_draw_1number 220.0 50.0 'NUMBER' [email protected] // value045A: text_draw_1number 300.0 50.0 'NUMBER' [email protected] // valueif002D: [email protected] >= [email protected] // integer values004D: jump_if_false @MultRandCar_23if8039: NOT [email protected]([email protected],16i) == -1 // integer values004D: jump_if_false @MultRandCar_110002: jump @MultRandCar_10if003B: [email protected] == [email protected]: jump_if_false @MultRandCar_100001: wait 1000 ms0164: disable_marker [email protected]: [email protected] = -1 // integer valuesif8119: not car [email protected]([email protected],16i) wrecked 004D: jump_if_false @MultRandCar_10 020B: explode_car [email protected]([email protected],16i) // versionA :MultRandCar_1001C3: remove_references_to_car [email protected]([email protected],16i) // Like turning a car into any random car:MultRandCar_11000A: [email protected] += 1 // integer values0002: jump @MultRandCar_9:MultRandCar_130085: [email protected] = [email protected] // (int)0006: [email protected] = 0 // integer values:MultRandCar_150001: wait 0 ms03F0: enable_text_draw 1045A: text_draw_1number 150.0 70.0 'NUMBER' [email protected] // value045A: text_draw_1number 170.0 70.0 'NUMBER' [email protected] // value045A: text_draw_1number 220.0 50.0 'NUMBER' [email protected] // value045A: text_draw_1number 300.0 50.0 'NUMBER' [email protected] // valueif002D: [email protected] >= [email protected] // integer values004D: jump_if_false @MultRandCar_23if8039: NOT [email protected]([email protected],16i) == -1 // integer values004D: jump_if_false @MultRandCar_1701C3: remove_references_to_car [email protected]([email protected],16i) // Like turning a car into any random car:MultRandCar_17000A: [email protected] += 1 // integer values0002: jump @MultRandCar_15:MultRandCar_230006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = 0 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = -1 // integer values0006: [email protected] = 8 // integer [email protected] = 00002: jump @MultRandCar_2:MultRandCar_Table0871: init_jump_table [email protected] total_jumps 7 0 @MultRandCar_00 jumps 0 @MultRandCar_T01 1 @MultRandCar_T11 2 @MultRandCar_T22 3 @MultRandCar_T33 4 @MultRandCar_T44 5 @MultRandCar_T55 6 @MultRandCar_T66:MultRandCar_000006: [email protected]([email protected],16i) = [email protected] = 00002: jump @MultRandCar_Tout1:MultRandCar_T01053E: [email protected]([email protected],16i) = get_random_car_with_model 523 in_rectangle_cornerA [email protected] [email protected] cornerB [email protected] [email protected]@ = 10002: jump @MultRandCar_Tout1:MultRandCar_T11053E: [email protected]([email protected],16i) = get_random_car_with_model 596 in_rectangle_cornerA [email protected] [email protected] cornerB [email protected] [email protected]@ = 20002: jump @MultRandCar_Tout1:MultRandCar_T22053E: [email protected]([email protected],16i) = get_random_car_with_model 597 in_rectangle_cornerA [email protected] [email protected] cornerB [email protected] [email protected]@ = 30002: jump @MultRandCar_Tout1:MultRandCar_T33053E: [email protected]([email protected],16i) = get_random_car_with_model 598 in_rectangle_cornerA [email protected] [email protected] cornerB [email protected] [email protected]@ = 40002: jump @MultRandCar_Tout1:MultRandCar_T44053E: [email protected]([email protected],16i) = get_random_car_with_model 427 in_rectangle_cornerA [email protected] [email protected] cornerB [email protected] [email protected]@ = 50002: jump @MultRandCar_Tout1:MultRandCar_T55053E: [email protected]([email protected],16i) = get_random_car_with_model 490 in_rectangle_cornerA [email protected] [email protected] cornerB [email protected] [email protected]@ = 60002: jump @MultRandCar_Tout1:MultRandCar_T66053E: [email protected]([email protected],16i) = get_random_car_with_model 528 in_rectangle_cornerA [email protected] [email protected] cornerB [email protected] [email protected]@ = 00002: jump @MultRandCar_Tout1:MultRandCar_Tout10051: return Edited August 8, 2010 by ZAZ 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