Jump to content
Sign in to follow this  
ToonSkull

Realist Cops and Traffic Mod in Cleo

Recommended Posts

ToonSkull    4

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 [email protected]
:RCOPCARS_19
wait 0 
[email protected] = Player.WantedLevel($PLAYER_CHAR)
if 
 [email protected] > 0 
jf @RCOPCARS_19 
Player.ClearWantedLevel($PLAYER_CHAR)
[email protected] = 0 
//Set a counter to zero in [email protected]
: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 [email protected] 
if 
  not [email protected] >= 100 
jf @RCOPCARS_19 
[email protected] += 1 
//Stop scanning after 100 loops assume no one saw anything.
if 
056D:   actor [email protected] defined 
jf @RCOPCARS_61 
089F: get_actor [email protected] pedtype_to [email protected] 
if or
 [email protected] == 4 
 [email protected] == 5 
 [email protected] == 6 
jf @RCOPCARS_61 
//We have a witness.
//Set timer to zero.
[email protected] = 0 
if 
  not [email protected] == 6 
jf @RCOPCARS_241 
//Witness Marker
[email protected] = Marker.CreateAboveActor([email protected])
07E0: set_marker [email protected] type_to 0 
Marker.SetColor([email protected], 0)

:RCOPCARS_241
wait 0 
if 
  Actor.Dead([email protected])
jf @RCOPCARS_273 
//Killed the Witness.
Marker.Disable([email protected])
jump @RCOPCARS_19 

:RCOPCARS_273
if or
 [email protected] >= 30000    //30 seconds to kill the witness
 [email protected] == 6         //Witness is a cop so timer don't matter.
jf @RCOPCARS_241 
//Reset Wanted Level stored in [email protected]
Player.WantedLevel($PLAYER_CHAR) = [email protected]
if 
  not [email protected] == 6 
jf @RCOPCARS_307 
Marker.Disable([email protected])
//Loop here until Wanted Level is cleared.
:RCOPCARS_307
wait 0 
[email protected] = Player.WantedLevel($PLAYER_CHAR)
if 
 [email protected] == 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 [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
073E: get_car_in_sphere [email protected] [email protected] [email protected] radius 60.0 model -1 handle_as [email protected]
//Car Info
if
056E:   car [email protected] defined
jf @REALTRAFFIC_19
//Driver Info
046C: [email protected] = car [email protected] driver
if
056D:   actor [email protected] defined
jf @REALTRAFFIC_19
if
 not Actor.DrivingPoliceVehicle([email protected])
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.
//[email protected] = Car.Health([email protected])
09B3: get_car [email protected] door_status [email protected]
089F: get_actor [email protected] pedtype_to [email protected]
//No mods, bikes, Criminals, or Cops
if and
 not [email protected] >= 3     //Doors are locked = car is already modded - ALT is "[email protected] == 1000"
 not [email protected] == 6     //Is a Cop
 not [email protected] == 20    //Is a Criminal
847A:   not actor [email protected] driving_bike
jf @REALTRAFFIC_19
03F3: get_car [email protected] primary_color_to [email protected] secondary_color_to [email protected]
[email protected] = Car.Model([email protected])
[email protected] = Car.Angle([email protected])
02E3: [email protected] = car [email protected] speed
//Get the driver
0665: get_actor [email protected] model_to [email protected]
0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 0.0 0.0 0.0
Actor.RemoveReferences([email protected])
//Car Capacity Check  
[email protected] = 0
[email protected] = 0
[email protected] = 0
01EA: [email protected] = car [email protected] max_passengers
//Two Door Check
if
[email protected] == 3
jf @REALTRAFFIC_404
//Four Door Check Rear Seats
//Rear Seat passenger
if
8431:   not car [email protected] passenger_seat_free 2
jf @REALTRAFFIC_355
0432: [email protected] = get_actor_handle_from_car [email protected] passenger_seat 2
0665: get_actor [email protected] model_to [email protected]
089F: get_actor [email protected] pedtype_to [email protected]
Actor.RemoveReferences([email protected])
//Rear Seat passenger
:REALTRAFFIC_355
if
8431:   not car [email protected] passenger_seat_free 1
jf @REALTRAFFIC_404
0432: [email protected] = get_actor_handle_from_car [email protected] passenger_seat 1
0665: get_actor [email protected] model_to [email protected]
089F: get_actor [email protected] pedtype_to [email protected]
Actor.RemoveReferences([email protected])
//Front Seat Passenger
:REALTRAFFIC_404
if
8431:   not car [email protected] passenger_seat_free 0
jf @REALTRAFFIC_453
0432: [email protected] = get_actor_handle_from_car [email protected] passenger_seat 0
0665: get_actor [email protected] model_to [email protected]
089F: get_actor [email protected] pedtype_to [email protected]
Actor.RemoveReferences([email protected])

:REALTRAFFIC_453
Car.Destroy([email protected])
[email protected] = Car.Create([email protected], [email protected], [email protected], [email protected])
Car.Angle([email protected]) = [email protected]
//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 [email protected] primary_color_to 0 secondary_color_to 0
0229: set_car [email protected] primary_color_to [email protected] secondary_color_to [email protected]
0129: [email protected] = create_actor_pedtype [email protected] model [email protected] in_car [email protected] driverseat
//Place passengers (if any)
if
 not [email protected] == 0
jf @REALTRAFFIC_559
01C8: [email protected] = create_actor_pedtype [email protected] model [email protected] in_car [email protected] passenger_seat 2
0526: set_actor [email protected] stay_in_car 1
Model.Destroy([email protected])
Actor.RemoveReferences([email protected])

:REALTRAFFIC_559
if
 not [email protected] == 0
jf @REALTRAFFIC_610
01C8: [email protected] = create_actor_pedtype [email protected] model [email protected] in_car [email protected] passenger_seat 1
0526: set_actor [email protected] stay_in_car 1
Model.Destroy([email protected])
Actor.RemoveReferences([email protected])

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

Share this post


Link to post
Share on other sites
ToonSkull    4

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

Share this post


Link to post
Share on other sites
ToonSkull    4

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

Share this post


Link to post
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

Sign in to follow this  

×