Diegoti Posted October 20, 2018 Share Posted October 20, 2018 This script is supposed to create 4 units in front of you in a range of 150 meters, but rarely it sometimes have problem when creating them, someones just are create at the same place, other spawns bugged underground (only when im near hills or mountains) and others spawns just 10 meters in front of me also they dont spawns all the same time or takes some secs to spawns (which hasnt sense) {$CLEO .cs} //-------------MAIN--------------- thread '4chase' while true wait 0 if Player.WantedLevel($PLAYER_CHAR) > 0 then if 856E: car [email protected] defined then gosub @Create end end // s s s s s s s s s s s s s s s s s s s s s s if or 80FE: actor $PLAYER_ACTOR sphere 0 in_sphere [email protected] [email protected] [email protected] radius 200.0 200.0 200.0 not Player.WantedLevel($PLAYER_CHAR) > 0 then gosub @Delete if Player.WantedLevel($PLAYER_CHAR) > 0 then if 856E: car [email protected] defined then gosub @Create end end end end :Create 00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected] if 056E: car [email protected] defined then Actor.DestroyInstantly([email protected]) Actor.DestroyInstantly([email protected]) Actor.DestroyInstantly([email protected]) Actor.DestroyInstantly([email protected]) Car.Destroy([email protected]) Car.Destroy([email protected]) Car.Destroy([email protected]) Car.Destroy([email protected]) Car.RemoveReferences([email protected]) Car.RemoveReferences([email protected]) Car.RemoveReferences([email protected]) Car.RemoveReferences([email protected]) end //-------------------------------------- if Player.WantedLevel($PLAYER_CHAR) > 0 then [email protected]=#COPCARRU [email protected]=#FBI [email protected]=#COLT45 [email protected] = 22 [email protected] = 0.1 [email protected] = 0.1 [email protected] = 1 end if Player.WantedLevel($PLAYER_CHAR) > 1//3 then [email protected]=#HUNTLEY [email protected]=#SWAT [email protected]=#MP5LNG [email protected] = 29 [email protected] = -1.5 [email protected] = 0.1 [email protected] = 2 end if Player.WantedLevel($PLAYER_CHAR) > 2//5 then [email protected]=#SECURICA [email protected]=#ARMY [email protected]=#M4 [email protected] = 31 [email protected] = -1.0 [email protected] = 1.5 [email protected] = 3 end Model.Load([email protected]) Model.Load([email protected]) Model.Load([email protected]) 038B: load_requested_models ////------------------------------------------------- if and Model.Available([email protected]) Model.Available([email protected]) Model.Available([email protected]) then 0ACD: show_text_highpriority "2" time 1000 //------------------------------------------------------------- //Actor.StorePos($PLAYER_ACTOR, [email protected], [email protected], [email protected]) 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 50.0 150.0 0.0 04D3: get_nearest_car_path_coords_from [email protected] [email protected] [email protected] type 2 store_to [email protected] [email protected] [email protected] 02CE: [email protected] = ground_z_at [email protected] [email protected] [email protected] [email protected] = Car.Create([email protected], [email protected], [email protected], [email protected]) //# # # # # # # # # # # 02AC: set_car [email protected] immunities BP 1 FP 0 EP 0 CP 1 MP 1 0208: [email protected] = random_float_in_ranges 0.0 360.0 Car.Angle([email protected]) = [email protected] [email protected] = Actor.Create(Cop, [email protected], [email protected], [email protected], [email protected]) //A A A A A A A A A 0619: enable_actor [email protected] collision_detection 0 0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 0.0 [email protected] [email protected] position 0 shooting_angle_limit 360.0 with_weapon [email protected] 0638: AS_actor [email protected] stay_put 1 Actor.WeaponAccuracy([email protected]) = 90 05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR //------------------------------------------------------------- // //------------------------------------------------------------- //Actor.StorePos($PLAYER_ACTOR, [email protected], [email protected], [email protected]) 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset -50.0 150.0 0.0 04D3: get_nearest_car_path_coords_from [email protected] [email protected] [email protected] type 2 store_to [email protected] [email protected] [email protected] 02CE: [email protected] = ground_z_at [email protected] [email protected] [email protected] [email protected] = Car.Create([email protected], [email protected], [email protected], [email protected]) //# # # # # # # # # # # 02AC: set_car [email protected] immunities BP 1 FP 0 EP 0 CP 1 MP 1 0208: [email protected] = random_float_in_ranges 0.0 360.0 Car.Angle([email protected]) = [email protected] [email protected] = Actor.Create(Cop, [email protected], [email protected], [email protected], [email protected]) //A A A A A A A A A 0619: enable_actor [email protected] collision_detection 0 0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 0.0 0.0 1.5 position 0 shooting_angle_limit 360.0 with_weapon [email protected] 0638: AS_actor [email protected] stay_put 1 Actor.WeaponAccuracy([email protected]) = 90 05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR //------------------------------------------------------------- // //------------------------------------------------------------- //Actor.StorePos($PLAYER_ACTOR, [email protected], [email protected], [email protected]) 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 50.0 170.0 0.0 04D3: get_nearest_car_path_coords_from [email protected] [email protected] [email protected] type 2 store_to [email protected] [email protected] [email protected] 02CE: [email protected] = ground_z_at [email protected] [email protected] [email protected] [email protected] = Car.Create([email protected], [email protected], [email protected], [email protected]) //# # # # # # # # # # # 02AC: set_car [email protected] immunities BP 1 FP 0 EP 0 CP 1 MP 1 0208: [email protected] = random_float_in_ranges 0.0 360.0 Car.Angle([email protected]) = [email protected] [email protected] = Actor.Create(Cop, [email protected], [email protected], [email protected], [email protected]) //A A A A A A A A A 0619: enable_actor [email protected] collision_detection 0 0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 0.0 0.0 1.5 position 0 shooting_angle_limit 360.0 with_weapon [email protected] 0638: AS_actor [email protected] stay_put 1 Actor.WeaponAccuracy([email protected]) = 90 05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR //------------------------------------------------------------- // //------------------------------------------------------------- //Actor.StorePos($PLAYER_ACTOR, [email protected], [email protected], [email protected]) 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset -50.0 170.0 0.0 04D3: get_nearest_car_path_coords_from [email protected] [email protected] [email protected] type 2 store_to [email protected] [email protected] [email protected] 02CE: [email protected] = ground_z_at [email protected] [email protected] [email protected] [email protected] = Car.Create([email protected], [email protected], [email protected], [email protected]) //# # # # # # # # # # # 02AC: set_car [email protected] immunities BP 1 FP 0 EP 0 CP 1 MP 1 0208: [email protected] = random_float_in_ranges 0.0 360.0 Car.Angle([email protected]) = [email protected] [email protected] = Actor.Create(Cop, [email protected], [email protected], [email protected], [email protected]) //A A A A A A A A A 0619: enable_actor [email protected] collision_detection 0 0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 0.0 0.0 1.5 position 0 shooting_angle_limit 360.0 with_weapon [email protected] 0638: AS_actor [email protected] stay_put 1 Actor.WeaponAccuracy([email protected]) = 90 05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR //------------------------------------------------------------- // if [email protected] == 1 then 0229: set_car [email protected] primary_color_to 0 secondary_color_to 1 0229: set_car [email protected] primary_color_to 0 secondary_color_to 1 0229: set_car [email protected] primary_color_to 0 secondary_color_to 1 0229: set_car [email protected] primary_color_to 0 secondary_color_to 1 end if [email protected] == 2 then 0229: set_car [email protected] primary_color_to 0 secondary_color_to 0 0229: set_car [email protected] primary_color_to 0 secondary_color_to 0 0229: set_car [email protected] primary_color_to 0 secondary_color_to 0 0229: set_car [email protected] primary_color_to 0 secondary_color_to 0 end if [email protected] == 3 then 0229: set_car [email protected] primary_color_to 48 secondary_color_to 72 0229: set_car [email protected] primary_color_to 48 secondary_color_to 72 0229: set_car [email protected] primary_color_to 48 secondary_color_to 72 0229: set_car [email protected] primary_color_to 48 secondary_color_to 72 end 020A: lock_car_doors [email protected] mode 4 020A: lock_car_doors [email protected] mode 4 020A: lock_car_doors [email protected] mode 4 020A: lock_car_doors [email protected] mode 4 Actor.Health([email protected]) = 1000 Actor.Health([email protected]) = 1000 Actor.Health([email protected]) = 1000 Actor.Health([email protected]) = 1000 end wait 1 return :Delete if 056E: car [email protected] defined then Car.Destroy([email protected]) Car.Destroy([email protected]) Car.Destroy([email protected]) Car.Destroy([email protected]) Actor.DestroyInstantly([email protected]) Actor.DestroyInstantly([email protected]) Actor.DestroyInstantly([email protected]) Actor.DestroyInstantly([email protected]) Car.RemoveReferences([email protected]) Car.RemoveReferences([email protected]) Car.RemoveReferences([email protected]) Car.RemoveReferences([email protected]) end //[email protected] = 1 wait 1 return ///////- Link to comment Share on other sites More sharing options...
ZAZ Posted October 21, 2018 Share Posted October 21, 2018 (edited) the spawned cars can stuck in the street if street goes up or down by 20.0 degree then car will stuck in street test it by spawning higher and also in a closer range, if they appear better 04C4: store_coords_to 10@ 11@ 12@ from_actor $PLAYER_ACTOR with_offset 50.0 50.0 0.0 04D3: get_nearest_car_path_coords_from 10@ 11@ 12@ type 2 store_to 13@ 14@ 15@ //02CE: 16@ = ground_z_at 13@ 14@ 15@ 15@ += 10.0 1@ = Car.Create(25@, 13@, 14@, 15@) Edited October 21, 2018 by ZAZ CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Diegoti Posted October 21, 2018 Author Share Posted October 21, 2018 Well, it works but the main problem is that those units take some seconds to spawn, idk why does this happens. Link to comment Share on other sites More sharing options...
Sanmodder Posted October 21, 2018 Share Posted October 21, 2018 40 m is enough right now do not give 170 m and on the third offset give -1.0 then car when creating on streets and it's best to study the distance from the earth with this opcode 0819: 162 @ = actor $ PLAYER_ACTOR distance_from_ground and the cars in gta san andreas have f*cked up intelligences they fall into ditches they fall over and much more add this opcodes 072F: enable_car 6 @ stuck_check_distance 0.5 time 4000 and_restore_if stuck 1 flipped 1 unk_place_on_road_properly 1 to_path 7 // extended 03CC 0587: enable_car 6 @ validate_position 0 Link to comment Share on other sites More sharing options...
Diegoti Posted October 21, 2018 Author Share Posted October 21, 2018 Yup, but it still having problems when spawning, somethings when im driving a mid/high speed, they just appear in front of my of over me. Link to comment Share on other sites More sharing options...
Strs Posted October 26, 2018 Share Posted October 26, 2018 totally useless what kind of idea is this without driver no chasing and no shooting stay idle in turret mod at least make it chasing player with driver and if you want to find out what is the problem make it simple make it one car with driver in it and one soldier and see if it works then add one by one Link to comment Share on other sites More sharing options...