Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Script Crashes


Jerry123
 Share

Recommended Posts

I created a script that makes police to driveby you but it just does nothing. angry.gif

 

 

{$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 by Jerry123
Link to comment
Share on other sites

 

: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 by ZAZ
Link to comment
Share on other sites

 

: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 confused.gif

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 devil.gifdevil.gifdevil.gif )

Link to comment
Share on other sites

 

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 devil.gifdevil.gifdevil.gif )

add a marker to your car to see what happens

Link to comment
Share on other sites

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 devil.gifdevil.gifdevil.gif )

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

 

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 devil.gifdevil.gifdevil.gif )

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 by ZAZ
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
 Share

  • 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.