Jump to content

Realist Cops and Traffic Mod in Cleo


ToonSkull

Recommended Posts

This grabs the wanted level and stores it. Then it scans 30 meters (about 100 feet) around you for any cops or civilians (gangs don't narc). You will still hear a police report but no stars will post. At this point you should look for a red marker on your radar. That person is running for help. Then if you can kill them in 30 seconds you will still have no stars. If the witness is a cop the stars will apply right away and the mod waits for you to clear them.

{$VERSION 3.1.0027}
{$CLEO .cs}
//This mod hooks the wanted level and checks for cops within 100 feet of the player.
//Coded by Vincent Black aka ToonSkull
//June 6th, 2010
//-------------MAIN---------------
thread 'RCOPCARS' 
//Load Wanted Level into variable 1@
:RCOPCARS_19
wait 0 
1@ = Player.WantedLevel($PLAYER_CHAR)
if 
 1@ > 0 
jf @RCOPCARS_19 
Player.ClearWantedLevel($PLAYER_CHAR)
10@ = 0 
//Set a counter to zero in 10@
:RCOPCARS_61
wait 0 
04C4: store_coords_to $4 $5 $6 from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0 
08E5: get_actor_in_sphere $4 $5 $6 radius 30.0 handle_as 3@ 
if 
  not 10@ >= 100 
jf @RCOPCARS_19 
10@ += 1 
//Stop scanning after 100 loops assume no one saw anything.
if 
056D:   actor 3@ defined 
jf @RCOPCARS_61 
089F: get_actor 3@ pedtype_to 5@ 
if or
 5@ == 4 
 5@ == 5 
 5@ == 6 
jf @RCOPCARS_61 
//We have a witness.
//Set timer to zero.
32@ = 0 
if 
  not 5@ == 6 
jf @RCOPCARS_241 
//Witness Marker
12@ = Marker.CreateAboveActor(3@)
07E0: set_marker 12@ type_to 0 
Marker.SetColor(12@, 0)

:RCOPCARS_241
wait 0 
if 
  Actor.Dead(3@)
jf @RCOPCARS_273 
//Killed the Witness.
Marker.Disable(12@)
jump @RCOPCARS_19 

:RCOPCARS_273
if or
 32@ >= 30000    //30 seconds to kill the witness
 5@ == 6         //Witness is a cop so timer don't matter.
jf @RCOPCARS_241 
//Reset Wanted Level stored in 1@
Player.WantedLevel($PLAYER_CHAR) = 1@
if 
  not 5@ == 6 
jf @RCOPCARS_307 
Marker.Disable(12@)
//Loop here until Wanted Level is cleared.
:RCOPCARS_307
wait 0 
1@ = Player.WantedLevel($PLAYER_CHAR)
if 
 1@ == 0 
jf @RCOPCARS_307 
jump @RCOPCARS_19 

Next this code is based on HippieCommunist's who is too busy with GTA IV to even talk to me. Some users don't care that all the modded cars have the doors locked. This version also has doors locked but if you read through my comments you can see how to swap it for car health. I set my distance to 60.0 meters because it felt right. I found setting it higher fewer cars get selected. While setting it lower makes for more accidents. I also made sure the passengers got placed back inside the vehicle. His mod the passengers disappear and only the drivers remain.

{$VERSION 3.1.0027}
{$CLEO .cs}

//-------------MAIN---------------
thread 'REALTRAFFIC'
//Based on HippieCommunist version 2008 - 2010.
//Re-coded by Vincent Black aka ToonSkull
//June 5th, 2010
:REALTRAFFIC_19
wait 0
//Grab any vechicles near player
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
073E: get_car_in_sphere 1@ 2@ 3@ radius 60.0 model -1 handle_as 0@
//Car Info
if
056E:   car 0@ defined
jf @REALTRAFFIC_19
//Driver Info
046C: 1@ = car 0@ driver
if
056D:   actor 1@ defined
jf @REALTRAFFIC_19
if
 not Actor.DrivingPoliceVehicle(1@)
jf @REALTRAFFIC_19
//This is a cool way to figure out which cars are modified. Just Lock the doors.
//See notes if you don't like this option.
//4@ = Car.Health(0@)
09B3: get_car 0@ door_status 4@
089F: get_actor 1@ pedtype_to 3@
//No mods, bikes, Criminals, or Cops
if and
 not 4@ >= 3     //Doors are locked = car is already modded - ALT is "4@ == 1000"
 not 3@ == 6     //Is a Cop
 not 3@ == 20    //Is a Criminal
847A:   not actor 1@ driving_bike
jf @REALTRAFFIC_19
03F3: get_car 0@ primary_color_to 11@ secondary_color_to 12@
5@ = Car.Model(0@)
6@ = Car.Angle(0@)
02E3: 7@ = car 0@ speed
//Get the driver
0665: get_actor 1@ model_to 2@
0407: store_coords_to 8@ 9@ 10@ from_car 0@ with_offset 0.0 0.0 0.0
Actor.RemoveReferences(1@)
//Car Capacity Check  
13@ = 0
14@ = 0
15@ = 0
01EA: 22@ = car 0@ max_passengers
//Two Door Check
if
22@ == 3
jf @REALTRAFFIC_404
//Four Door Check Rear Seats
//Rear Seat passenger
if
8431:   not car 0@ passenger_seat_free 2
jf @REALTRAFFIC_355
0432: 16@ = get_actor_handle_from_car 0@ passenger_seat 2
0665: get_actor 16@ model_to 13@
089F: get_actor 16@ pedtype_to 19@
Actor.RemoveReferences(16@)
//Rear Seat passenger
:REALTRAFFIC_355
if
8431:   not car 0@ passenger_seat_free 1
jf @REALTRAFFIC_404
0432: 17@ = get_actor_handle_from_car 0@ passenger_seat 1
0665: get_actor 17@ model_to 14@
089F: get_actor 17@ pedtype_to 20@
Actor.RemoveReferences(17@)
//Front Seat Passenger
:REALTRAFFIC_404
if
8431:   not car 0@ passenger_seat_free 0
jf @REALTRAFFIC_453
0432: 18@ = get_actor_handle_from_car 0@ passenger_seat 0
0665: get_actor 18@ model_to 15@
089F: get_actor 18@ pedtype_to 21@
Actor.RemoveReferences(18@)

:REALTRAFFIC_453
Car.Destroy(0@)
0@ = Car.Create(5@, 8@, 9@, 10@)
Car.Angle(0@) = 6@
//This line was used for testing it turns the cars black
//Not all the cars turn black as I approach them so it still needs tweaking.
//0229: set_car 0@ primary_color_to 0 secondary_color_to 0
0229: set_car 0@ primary_color_to 11@ secondary_color_to 12@
0129: 1@ = create_actor_pedtype 3@ model 2@ in_car 0@ driverseat
//Place passengers (if any)
if
 not 13@ == 0
jf @REALTRAFFIC_559
01C8: 16@ = create_actor_pedtype 19@ model 13@ in_car 0@ passenger_seat 2
0526: set_actor 16@ stay_in_car 1
Model.Destroy(13@)
Actor.RemoveReferences(16@)

:REALTRAFFIC_559
if
 not 14@ == 0
jf @REALTRAFFIC_610
01C8: 17@ = create_actor_pedtype 20@ model 14@ in_car 0@ passenger_seat 1
0526: set_actor 17@ stay_in_car 1
Model.Destroy(14@)
Actor.RemoveReferences(17@)

:REALTRAFFIC_610
if
 not 15@ == 0
jf @REALTRAFFIC_661
01C8: 18@ = create_actor_pedtype 21@ model 15@ in_car 0@ passenger_seat 0
0526: set_actor 18@ stay_in_car 1
Model.Destroy(15@)
Actor.RemoveReferences(18@)
//Set behaviors
:REALTRAFFIC_661
Car.SetSpeedInstantly(0@, 7@)
Car.SetToNormalDriver(0@)
Car.SetDriverBehaviour(0@, FollowRoad)
00AE: set_car 0@ traffic_behaviour_to 1
//Lock the doors - some players don't like this option so it could be
//written to use Car.Health(0@) and just add 1 point so car health is not normal.
//4@ += 1
//Car.Health(0@) = 4@
Car.DoorStatus(0@) = 3
04E0: car 0@ abandon_path_radius 0
Model.Destroy(5@)
Model.Destroy(2@)
Actor.RemoveReferences(1@)
Car.RemoveReferences(0@)
jump @REALTRAFFIC_19 

My third mod is REAL police car chases and I am still working on it. Once I am done I will upload all 3 in a zip file to the downloads section.

Link to comment
Share on other sites

Nice... I'll try testing this when I have time.

Something is causing the traffic mod to crash near the tunnel by the airport. I can't figure it out yet. I am tired of the cops assisting other gang members when they shouldn't be taking sides. Other than that, I am trying to get the cop cars to stay on your tail and not drive like a bunch of dorks.

EDIT: Ok I figured it out there are single passenger fork trucks over there.

Edited by ToonSkull
Link to comment
Share on other sites

OK you can now download all three here.

There are some things you might want to know. Real traffic has 2 versions the one titled "real traffic alt" will NOT lock the car doors. Install only 1 of these 2 mods. This mod was pretty glitch filled and while I fixed most of them there are some minor issues. Like alternate version vehicles might change in appearance upon approach. I have ran the mod without crashing the program for sometime now. Hippiecommunist on GTAforums original code worked to some degree and I thank him for laying the foundation.

Real Cops watches for you to get any stars. It scans the area around you for police. Then is holds them, you will hear the police report and be notified that there is a witness. If you kill the Witness within 30 seconds the star won't show up. However stars go into effect right away is the witness is a cop.

Real Cop Cars watches for 3 things to occur. You must be wanted, driving a vehicle, and speeding over 25 KPH. Then 2 special made police vehicles spawn right behind you. They have but one motivating factor. KILL the player. They will continue to pursue your vehicle until it is riddled with bullets. Note: if you jump from your vehicle they chase the vehicle.

You can do whatever you like with these mods. I have included notes on how each section is supposed to work.

HAVE FUN!

Vincent Black

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...