Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Happy Holidays from the GTANet team!

Lowering Wanted Level


gtaragemachine
 Share

Recommended Posts

gtaragemachine

As far as I know this mod hasn't been done, and I like adding bits of reality to the game.

 

What it does: Each time CJ gets into a vehicle his wanted level drops by one. I made it so it won't drop from 1 to zero though.

 

Purpose for mod: I thought it'd be a little more realistic to shake the trail of the cops by switching cars. So, each time CJ switches cars, the cop trail goes that much colder.

 

The reason I posted this in this coding section is because I have no idea if this is terribly inefficient code or not. I thought I'd ask you experts if it can be cleaned up a bit or if it is good to go. It seems to work ok, though.

 

The code:

 

{$CLEO .cs}:DriveEvade03A4: name_thread 'DrvEvd':DriveEvade_1wait  0 if0256:   player $PLAYER_CHAR defined004D: jump_if_false @DriveEvade_1if0038:   $ONMISSION == 0004D: jump_if_false @DriveEvade_1:DriveEvade_2wait 0if00DF:  actor $PLAYER_ACTOR driving004D: jump_if_false @DriveEvade_1:DriveEvade_3wait  0if010F:   player $PLAYER_CHAR wanted_level > 1004D: jump_if_false @DriveEvade_9:DriveEvade_4wait  0if010F:   player $PLAYER_CHAR wanted_level > 5004D: jump_if_false @DriveEvade_5010D: set_player $PLAYER_CHAR wanted_level_to 50002: jump @DriveEvade_9:DriveEvade_5wait  0if010F:   player $PLAYER_CHAR wanted_level > 4004D: jump_if_false @DriveEvade_6010D: set_player $PLAYER_CHAR wanted_level_to 40002: jump @DriveEvade_9:DriveEvade_6wait  0if010F:   player $PLAYER_CHAR wanted_level > 3004D: jump_if_false @DriveEvade_7010D: set_player $PLAYER_CHAR wanted_level_to 30002: jump @DriveEvade_9:DriveEvade_7wait  0if010F:   player $PLAYER_CHAR wanted_level > 2004D: jump_if_false @DriveEvade_8010D: set_player $PLAYER_CHAR wanted_level_to 20002: jump @DriveEvade_9:DriveEvade_8wait  0if010F:   player $PLAYER_CHAR wanted_level > 1004D: jump_if_false @DriveEvade_9010D: set_player $PLAYER_CHAR wanted_level_to 10002: jump @DriveEvade_9:DriveEvade_9wait 0if 80DF:  NOT actor $PLAYER_ACTOR driving004D: jump_if_false @DriveEvade_90002: jump @DriveEvade_1

 

Link to comment
Share on other sites

To me, I see it as "If it ain't broke don't fix it". Just release it and get credit is my advice.

Link to comment
Share on other sites

^ tounge.gif Nothing bad about tuning it up a just a little...

 

 

{$CLEO .cs}03A4: name_thread 'DRVEVD':STARTwait 0if andPlayer.Defined($PLAYER_CHAR)Actor.Driving($PLAYER_ACTOR)// $ONMISSION == 0 // Why not on mission too?jf @STARTif010F:   player $PLAYER_CHAR wanted_level > 1jf @START03C0: [email protected] = actor $PLAYER_ACTOR car// PLAYER not driving:DRIVE_CHECKwait 0ifnot Actor.Driving($PLAYER_ACTOR)jf @DRIVE_CHECK// COP not near PLAYER; PLAYER in CAR (not [email protected]):CHECKwait 0Actor.RemoveReferences([email protected])00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected]: get_actor_in_sphere [email protected] [email protected] [email protected] radius 20.0 with_pedtype_civilian 1 gang 0 criminal/prostitute 0 handle_as [email protected]: get_actor [email protected] pedtype_to [email protected] [email protected] == 6jf @CHECKActor.RemoveReferences([email protected])if and0449:   actor $PLAYER_ACTOR in_a_car80DB:   not actor $PLAYER_ACTOR in_car [email protected] jf @CHECKCar.RemoveReferences([email protected])01C0: [email protected] = player $PLAYER_CHAR [email protected] -= [email protected] == 0jf @START010D: set_player $PLAYER_CHAR wanted_level_to [email protected] @START

 

ADDED

  • Loop: Checking for nearby COPS
  • Loop: Checking if $PLAYER_ACTOR is in his old car
  • Shortened down with some math rolleyes.gif
I commented out the $ONMISSION check. I think it's more realistic to keep this in missions too but if you don't want it that way then just un-comment it. smile.gif
23088_s.gif

Link to comment
Share on other sites

I can't try to find the correct opcode now because I'm at school. By the way, search for get_actor_ped_event_to and check if the returned value is 72 (PED_EVENT_SEEN_COP), like this:

 

0000: get_actor $PLAYER_ACTOR ped_event_to [email protected] if  not [email protected] == 72 then // cop didn't see youend

 

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

gtaragemachine
^ tounge.gif Nothing bad about tuning it up a just a little...

 

 

{$CLEO .cs}03A4: name_thread 'DRVEVD':STARTwait 0if andPlayer.Defined($PLAYER_CHAR)Actor.Driving($PLAYER_ACTOR)// $ONMISSION == 0 // Why not on mission too?jf @STARTif010F:   player $PLAYER_CHAR wanted_level > 1jf @START03C0: [email protected] = actor $PLAYER_ACTOR car// PLAYER not driving:DRIVE_CHECKwait 0ifnot Actor.Driving($PLAYER_ACTOR)jf @DRIVE_CHECK// COP not near PLAYER; PLAYER in CAR (not [email protected]):CHECKwait 0Actor.RemoveReferences([email protected])00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected]: get_actor_in_sphere [email protected] [email protected] [email protected] radius 20.0 with_pedtype_civilian 1 gang 0 criminal/prostitute 0 handle_as [email protected]: get_actor [email protected] pedtype_to [email protected] [email protected] == 6jf @CHECKActor.RemoveReferences([email protected])if and0449:   actor $PLAYER_ACTOR in_a_car80DB:   not actor $PLAYER_ACTOR in_car [email protected] jf @CHECKCar.RemoveReferences([email protected])01C0: [email protected] = player $PLAYER_CHAR [email protected] -= [email protected] == 0jf @START010D: set_player $PLAYER_CHAR wanted_level_to [email protected] @START

 

ADDED

  • Loop: Checking for nearby COPS
  • Loop: Checking if $PLAYER_ACTOR is in his old car
  • Shortened down with some math rolleyes.gif
I commented out the $ONMISSION check. I think it's more realistic to keep this in missions too but if you don't want it that way then just un-comment it. smile.gif

Thanks for the help. I tried it though and it crashes after CJ gets out of the first car. I tried figuring it out but I'm stumped.

Link to comment
Share on other sites

Damn sorry. I've always had bad luck when the script is tested for some reason. turn.gif

 

EDITED POST when I can fix it! blush.gif

 

 

I can't try to find the correct opcode now because I'm at school.

lol Do you check GTAF at school too? tounge.gif

 

 

By the way, search for get_actor_ped_event_to and check if the returned value is 72 (PED_EVENT_SEEN_COP), like this:

 

You know what you wrote...

 

Wow I didn't know that before Wesser. biggrin.gif

 

UPDATED CODE

 

{$CLEO .cs}03A4: name_thread 'DRVEVD'// Driving; Wanted Level check every second:STARTwait 1000if andPlayer.Defined($PLAYER_CHAR)Actor.Driving($PLAYER_ACTOR)// $ONMISSION == 0 // Commented outjf @STARTif010F:   player $PLAYER_CHAR wanted_level > 1jf @START03C0: [email protected] = actor $PLAYER_ACTOR car// Car.Wrecked; Out of car check every second:DRIVING_CHECKwait 1000ifnot Car.Wrecked([email protected])jf @SCRIPT_ENDifnot Actor.Driving($PLAYER_ACTOR)jf @DRIVING_CHECK// Cop near Player; Player in car (not own car) check every half second:COPCAR_CHECKwait 500{if874F:   not actor $PLAYER_ACTOR ped_event == 72 // GTAModding: "doesnt work?!"jf @COPCAR_CHECK}080E: get_actor $PLAYER_ACTOR ped_event_to [email protected] [email protected] == 72 // EVENT_SEEN(BY)_COPjf @COPCAR_CHECKif80DB:   not actor $PLAYER_ACTOR in_car [email protected] jf @DRIVING_CHECKif0449:   actor $PLAYER_ACTOR in_a_carjf @COPCAR_CHECK01C0: [email protected] = player $PLAYER_CHAR [email protected] += -1ifnot [email protected] == 0jf @SCRIPT_END010D: set_player $PLAYER_CHAR wanted_level_to [email protected]:SCRIPT_ENDCar.RemoveReferences([email protected])jump @START

 

CHANGES

  • Loop (COPS): Ped_Event 72
  • Some minor changes (Probably not important)
    • :SCRIPT_END :LABEL
    • Separated in_car checks
    • Car.Wrecked check
I also changed -= 1 into += -1. Do these work differently? confused.gif

 

Sorry I can't test it because my computer sucks too bad to run SA (I've been playing on my cousin's computer but I can't anymore). tounge.gif

Edited by Adler
23088_s.gif

Link to comment
Share on other sites

gtaragemachine
CHANGES
  • Loop (COPS): Ped_Event 72
  • Some minor changes (Probably not important)
    • :SCRIPT_END :LABEL
    • Separated in_car checks
    • Car.Wrecked check
I also changed -= 1 into += -1. Do these work differently? confused.gif

 

Sorry I can't test it because my computer sucks too bad to run SA (I've been playing on my cousin's computer but I can't anymore). tounge.gif

 

 

I tried out your revised code and everything works except for the cop check. The "same car" check works though. I'll play around with it later today when I have time. Thanks much for your help so far. If we can get the cop check working, I think this will be a great addition to the game.

Link to comment
Share on other sites

 

The "same car" check works though.

That's good to hear. I think looking for random cop peds near the player constantly in the previous script caused the game to crash. cry.gif

 

 

everything works except for the cop check.

Something to do with the Ped Event opcodes I guess. These are the only opcodes that have to do with Ped Events that don't have unknown uses:

 

074F:   actor <handle> ped_event == <value>080E: get_actor <handle> ped_event_to <handle>

 

 

You can use the following opcodes to do stuff to events.

 

    * 074F – Checks if an event is happening on the actor (doesnt work?!)

    * 080E – Gets the actor's current event

I went with GTAModding's word and used 080E. Try 074F to see if it works for you. rolleyes.gif

 

EDIT - I looked through the list of EXE Functions (1.0) and couldn't figure out how to store a Ped Event to a var. 00A7 should work for this right? I saw a few sections when I searched for "pedevent" but I couldn't decipher the meaning of them.

 

Cookie for anyone who can figure out how to do this! cookie.gif

Edited by Adler
23088_s.gif

Link to comment
Share on other sites

gtaragemachine
...EDIT - I looked through the list of EXE Functions (1.0) and couldn't figure out how to store a Ped Event to a var. 00A7 should work for this right? I saw a few sections when I searched for "pedevent" but I couldn't decipher the meaning of them.

 

Cookie for anyone who can figure out how to do this! cookie.gif

I'll also give a cookie to anyone who can figure out the cop check... cookie.gif

 

Also, does anyone know if there's a way to check if the player has changed clothes or hairstyles? That'd be a great addition to this mod. If CJ changed clothes or hairstyles, his wanted level would go down.

Link to comment
Share on other sites

 

Cookie for anyone who can figure out how to do this! cookie.gif

I'll also give a cookie to anyone who can figure out the cop check... cookie.gif

what do you mean? If cops are in range of player_actor?

look into the CopWeapons script

 

wait 25004C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.008E5: get_actor_in_sphere [email protected] [email protected] [email protected] radius 71.5 handle_as [email protected]([email protected],16i)wait 50if not [email protected]([email protected],16i) == -1jf @COPWEAP_893089F: get_actor [email protected]([email protected],16i) pedtype_to [email protected] @COPWEAP_845:[email protected] == 6jf @COPWEAP_893

 

 

 

 

Also, does anyone know if there's a way to check if the player has changed clothes or hairstyles? That'd be a great addition to this mod. If CJ changed clothes or hairstyles, his wanted level would go down.

 

:INTRO2_482500D6: if or0500:   player $PLAYER_CHAR skin == "TASH" on_bodypart 1 0500:   player $PLAYER_CHAR skin == "GOATEE" on_bodypart 1 0500:   player $PLAYER_CHAR skin == "BEARD" on_bodypart 1 0500:   player $PLAYER_CHAR skin == "PLAYER_FACE" on_bodypart 1 0500:   player $PLAYER_CHAR skin == "HIGHFADE" on_bodypart 1 0500:   player $PLAYER_CHAR skin == "FLATTOP" on_bodypart 1 004D: jump_if_false @INTRO2_5442

 

Link to comment
Share on other sites

UPDATED SCRIPT

 

{$CLEO .cs}thread 'DRVEVD'// Driving, Wanted Level, Interior check every second:STARTwhile truewait 1000   if and       Player.Defined($PLAYER_CHAR)       Actor.Driving($PLAYER_ACTOR)   then       077E: get_active_interior_to [email protected]       01C0: [email protected] = Player.WantedLevel($PLAYER_CHAR)       if and           [email protected] == 0           [email protected] > 1       then           break       end   endend03C0: [email protected] = Actor.Car($PLAYER_ACTOR)// Car.Wrecked, Out-of-car check every second:DRIVING_CHECKrepeatwait 1000   if       not Car.Wrecked([email protected])   jf @SCRIPT_ENDuntil   not Actor.Driving($PLAYER_ACTOR)// Cop-near-Player; In-own-car check every half second:COP_CHECKrepeatwait 500   Actor.RemoveReferences([email protected])   Actor.StorePos($PLAYER_ACTOR [email protected] [email protected] [email protected])   08E5: get_actor_in_sphere [email protected] [email protected] [email protected] radius 20.0 handle_as [email protected]   if       [email protected] == -1   then       jump @CAR_CHECK // Skip Cop Check   else       break   end   089F: get_actor [email protected] pedtype_to [email protected]   not [email protected] == 6:CAR_CHECKwait 500if   not Actor.InCar($PLAYER_ACTOR [email protected])jf @DRIVING_CHECKif   Actor.InCar($PLAYER_ACTOR)jf @[email protected] = Player.WantedLevel($PLAYER_CHAR)[email protected] += -1if   not [email protected] == 0jf @SCRIPT_ENDPlayer.WantedLevel($PLAYER_CHAR) = [email protected]:SCRIPT_ENDCar.RemoveReferences([email protected])jump @START

 

In theory this should work (Going by ZAZ's ped check devil.gif).

 

And aren't the haircuts and changing clothes already suspending wanted level? confused.gif

23088_s.gif

Link to comment
Share on other sites

gtaragemachine

 

UPDATED SCRIPT

...

In theory this should work (Going by ZAZ's ped check devil.gif).

 

And aren't the haircuts and changing clothes already suspending wanted level? confused.gif

This is exciting. I can't wait to try that script out. I'm not a programmer so it may take me some time to figure out how to complete your coding. I have some extra time tomorrow that I can work on it. Thanks so much for your help (you too ZAZ).

Link to comment
Share on other sites

^ lol It's not really programming, just SA Coding (though I'm also trying to learn C++ atm tounge.gif).

 

Also the script isn't tested yet so don't get your hopes up too high. turn.gif

 

And if you want to add a feature where wanted level goes down then I think it'd be better to make a separate script. You can share that script in this topic too if you need any help. wink.gif

Edited by Adler
23088_s.gif

Link to comment
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
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.