Quantcast

Jump to content

» «
Photo

[SA|WIP] Emergency Vehicles in Traffic

1 reply to this topic
MAD BOSS
  • MAD BOSS

    Chief Executive

  • Members
  • Joined: 23 Mar 2010
  • Malta

#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' 
 
:AMB_27
wait 10000 
if 
   Player.Defined($PLAYER_CHAR)
else_jump @AMB_27 
077E: get_active_interior_to [email protected] 
if and
  $ONMISSION == 0 
   not Player.WantedLevel($PLAYER_CHAR) > 1
else_jump @AMB_27 
 
:AMB_85
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
else_jump @AMB_85 
04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset -210.0 200.0 0.0 
04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 210.0 250.0 0.0 
053E: [email protected] = get_random_car_with_model -1 in_rectangle_cornerA [email protected] [email protected] cornerB [email protected] [email protected] 
if 
   not [email protected] == -1 
else_jump @AMB_85 
if and
   not Car.Model([email protected]) == #AMBULAN
   not Car.Model([email protected]) == #LINERUN
   not Car.Model([email protected]) == #TOWTRUCK
   not Car.Model([email protected]) == #UTILITY
   not Car.Model([email protected]) == #COPCARLA
   not Car.Model([email protected]) == #COPCARSF
   not Car.Model([email protected]) == #COPCARVG
   not Car.Model([email protected]) == #COPCARRU
else_jump @AMB_27 
jump @AMB_289 
 
:AMB_289
if and
   not Car.Model([email protected]) == #PETRO
   not Car.Model([email protected]) == #BUS
   not Car.Model([email protected]) == #COACH
   not Car.Model([email protected]) == #TUG
   not Car.Model([email protected]) == #ENFORCER
   not Car.Model([email protected]) == #FBIRANCH
   not Car.Model([email protected]) == #RHINO
   not Car.Model([email protected]) == #BARRACKS
else_jump @AMB_27 
jump @AMB_371 
 
:AMB_371
if and
   not Car.Model([email protected]) == #BAGBOXA
   not Car.Model([email protected]) == #ARTICT1
   not Car.Model([email protected]) == #ARTICT2
   not Car.Model([email protected]) == #ARTICT3
   not Car.Model([email protected]) == #ENFORCER
   not Car.Model([email protected]) == #UTILTR1
   not Car.Model([email protected]) == #PETROTR
else_jump @AMB_27 
jump @AMB_445 
 
:AMB_445
wait 0 
gosub @AMB_895 
Model.Load([email protected])
Model.Load([email protected])
if and
   Model.Available([email protected])
   Model.Available([email protected])
else_jump @AMB_445 
0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 0.0 0.0 0.0 
Car.Destroy([email protected])
0395: clear_area 1 at [email protected] [email protected] [email protected] radius 5.0 
0338: set_car [email protected] visibility 0 
0129: [email protected] = create_actor_pedtype 4 model [email protected] in_car [email protected] driverseat 
Car.SetMaxSpeed([email protected], 0.0)
Car.LockInCurrentPosition([email protected]) = True
072F: enable_car [email protected] stuck_check_distance 10.0 time 2000 and_restore_if stuck 1 flipped 1 unknown 1 to_path -1 // extended 03CC 
01E8: create_forbidden_for_cars_cube_cornerA [email protected] [email protected] [email protected] cornerB [email protected] [email protected] -2.0 
00AE: set_car [email protected] traffic_behaviour_to 3 
0338: set_car [email protected] visibility 1 
Car.LockInCurrentPosition([email protected]) = False
Car.SetSpeedInstantly([email protected], 11.0)
Car.SetMaxSpeed([email protected], 42.0)
Car.SetDriverBehaviour([email protected], FollowRoad)
0397: enable_car [email protected] siren 1 
Model.Destroy([email protected])
Model.Destroy([email protected])
if 
   Player.Defined($PLAYER_CHAR)
else_jump @AMB_856 
if and
   not Car.Wrecked([email protected])
82BF:   not car [email protected] sunk 
81F4:   not car [email protected] flipped 
else_jump @AMB_856 
jump @AMB_856 
 
:AMB_856
Actor.RemoveReferences([email protected])
Car.RemoveReferences([email protected])
01E7: remove_forbidden_for_cars_cube_cornerA [email protected] [email protected] [email protected] cornerB [email protected] [email protected] -2.0 
jump @AMB_27 
 
:AMB_895
wait 0 
0209: [email protected] = random_int_in_ranges 0 7 
0871: init_jump_table [email protected] 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
jump @AMB_1109 
 
:AMB_994
jump @AMB_1109 
 
:AMB_1017
jump @AMB_1109 
 
:AMB_1040
jump @AMB_1109 
 
:AMB_1063
jump @AMB_1109 
 
:AMB_1086
jump @AMB_1109 
 
:AMB_1109
return 
 

 

 

 


MAD BOSS
  • MAD BOSS

    Chief Executive

  • Members
  • Joined: 23 Mar 2010
  • Malta

#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