Quantcast

Jump to content

» «
Photo

[SA|WIP] Emergency Vehicles in Traffic

1 reply to this topic
kikiboy95
  • kikiboy95

    Ol' sql, brah.

  • Members
  • Joined: 23 Mar 2010
  • None

#1

Posted 26 November 2013 - 09:21 PM

Description

I always liked the cop chases which were hapenning sometimes in the streets of San Andreas. Then I thought of making a code that would spawn i.e. an ambulance with rotation on, rushing through the traffic. :) 

 

 

For now, I managed to make copcars, ambulance and enforcer to spawn, alongside with their drivers in them.

 

The problems I am getting with this current version of the code are:

 

 

  • Cars that spawn, sometims spawn in front of me, even though I made a rectangle in where they can spawn
  • Sometimes, the spawned cars get thrown from the air, even though spawn commands haven't modified the Z-axis at all... It looks like God is throwing them from the sky or smt like that :D
  • They appear to frequently, like every 5-6 seconds, even though I've set the wait command at the beginning of the code for 10000ms (10 seconds)

 

I'll post the link for the CLEO script and a code preview for those who would like to take a look what's wrong:

 

The link:

https://www.mediafir...r7po0li2rr75mxt

 

 

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder....files/SASCM.rar) on 13.10.2007
 
{$VERSION 3.1.0027}
{$CLEO .cs}
 
//-------------MAIN---------------
thread 'AMB' 
4@ = 416 
7@ = 274 
 
:AMB_27
wait 10000 
if 
   Player.Defined($PLAYER_CHAR)
else_jump @AMB_27 
077E: get_active_interior_to 9@ 
if and
  9@ == 0 
  $ONMISSION == 0 
   not Player.WantedLevel($PLAYER_CHAR) > 1
else_jump @AMB_27 
 
:AMB_85
wait 0 
0@ = -1 
if 
   Player.Defined($PLAYER_CHAR)
else_jump @AMB_85 
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset -210.0 200.0 0.0 
04C4: store_coords_to 14@ 15@ 16@ from_actor $PLAYER_ACTOR with_offset 210.0 250.0 0.0 
053E: 0@ = get_random_car_with_model -1 in_rectangle_cornerA 11@ 12@ cornerB 14@ 15@ 
if 
   not 0@ == -1 
else_jump @AMB_85 
if and
   not Car.Model(0@) == #AMBULAN
   not Car.Model(0@) == #LINERUN
   not Car.Model(0@) == #TOWTRUCK
   not Car.Model(0@) == #UTILITY
   not Car.Model(0@) == #COPCARLA
   not Car.Model(0@) == #COPCARSF
   not Car.Model(0@) == #COPCARVG
   not Car.Model(0@) == #COPCARRU
else_jump @AMB_27 
jump @AMB_289 
 
:AMB_289
if and
   not Car.Model(0@) == #PETRO
   not Car.Model(0@) == #BUS
   not Car.Model(0@) == #COACH
   not Car.Model(0@) == #TUG
   not Car.Model(0@) == #ENFORCER
   not Car.Model(0@) == #FBIRANCH
   not Car.Model(0@) == #RHINO
   not Car.Model(0@) == #BARRACKS
else_jump @AMB_27 
jump @AMB_371 
 
:AMB_371
if and
   not Car.Model(0@) == #BAGBOXA
   not Car.Model(0@) == #ARTICT1
   not Car.Model(0@) == #ARTICT2
   not Car.Model(0@) == #ARTICT3
   not Car.Model(0@) == #ENFORCER
   not Car.Model(0@) == #UTILTR1
   not Car.Model(0@) == #PETROTR
else_jump @AMB_27 
jump @AMB_445 
 
:AMB_445
wait 0 
gosub @AMB_895 
Model.Load(4@)
Model.Load(7@)
if and
   Model.Available(4@)
   Model.Available(7@)
else_jump @AMB_445 
0407: store_coords_to 17@ 18@ 19@ from_car 0@ with_offset 0.0 0.0 0.0 
10@ = Car.Angle(0@)
Car.Destroy(0@)
0395: clear_area 1 at 17@ 18@ 19@ radius 5.0 
1@ = Car.Create(4@, 17@, 18@, 19@)
Car.Angle(1@) = 10@
0338: set_car 1@ visibility 0 
0129: 2@ = create_actor_pedtype 4 model 7@ in_car 1@ driverseat 
Car.SetMaxSpeed(1@, 0.0)
Car.LockInCurrentPosition(1@) = True
072F: enable_car 0@ stuck_check_distance 10.0 time 2000 and_restore_if stuck 1 flipped 1 unknown 1 to_path -1 // extended 03CC 
0087: 11@ = 17@ // (float) 
0087: 12@ = 18@ // (float) 
0087: 13@ = 17@ // (float) 
0087: 14@ = 18@ // (float) 
0087: 20@ = 19@ // (float) 
11@ += 3.0 
12@ += 3.0 
13@ -= 3.0 
14@ -= 3.0 
20@ += 2.0 
01E8: create_forbidden_for_cars_cube_cornerA 11@ 12@ 20@ cornerB 13@ 14@ -2.0 
00AE: set_car 1@ traffic_behaviour_to 3 
0338: set_car 1@ visibility 1 
Car.LockInCurrentPosition(1@) = False
Car.SetSpeedInstantly(1@, 11.0)
Car.SetMaxSpeed(1@, 42.0)
Car.SetDriverBehaviour(1@, FollowRoad)
0397: enable_car 1@ siren 1 
Model.Destroy(4@)
Model.Destroy(7@)
if 
   Player.Defined($PLAYER_CHAR)
else_jump @AMB_856 
if and
   not Car.Wrecked(1@)
82BF:   not car 1@ sunk 
81F4:   not car 1@ flipped 
else_jump @AMB_856 
jump @AMB_856 
 
:AMB_856
Actor.RemoveReferences(2@)
Car.RemoveReferences(1@)
01E7: remove_forbidden_for_cars_cube_cornerA 11@ 12@ 20@ cornerB 13@ 14@ -2.0 
jump @AMB_27 
 
:AMB_895
wait 0 
0209: 6@ = random_int_in_ranges 0 7 
0871: init_jump_table 6@ total_jumps 7 default_jump 0 @AMB_971 jumps 0 @AMB_994 1 @AMB_1017 2 @AMB_1040 3 @AMB_1086 4 @AMB_1063 5 @AMB_1017 6 @AMB_1086 
 
:AMB_971
4@ = 416 
7@ = 274 
jump @AMB_1109 
 
:AMB_994
4@ = 416 
7@ = 275 
jump @AMB_1109 
 
:AMB_1017
4@ = 416 
7@ = 276 
jump @AMB_1109 
 
:AMB_1040
4@ = 597 
7@ = 280 
jump @AMB_1109 
 
:AMB_1063
4@ = 427 
7@ = 286 
jump @AMB_1109 
 
:AMB_1086
4@ = 598 
7@ = 282 
jump @AMB_1109 
 
:AMB_1109
return 
 

 

 

 


kikiboy95
  • kikiboy95

    Ol' sql, brah.

  • Members
  • Joined: 23 Mar 2010
  • None

#2

Posted 27 November 2013 - 12:36 AM

No one tested it ? :(





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users