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

Make police use another weapon?


SWEG4MER
 Share

Recommended Posts

Okay... the title basically explains it self... is it possible to change the default gun the police uses?

 

I want to change the glock (which the police uses) to a baseball bat (re skinned to a police baton) so that the police gets a little bit less aggressive and a bit more realistic...

Link to comment
Share on other sites

 

Okay... the title basically explains it self... is it possible to change the default gun the police uses?

 

I want to change the glock (which the police uses) to a baseball bat (re skinned to a police baton) so that the police gets a little bit less aggressive and a bit more realistic...

 

       Ped[] pedArray = World.GetAllPeds();       foreach (Ped cop in pedArray)       {                     if (cop.RelationshipGroup == RelationshipGroup.Cop && cop.Weapons.AssaultRifle_M4.Ammo < 1)           {               if (Exists(cop) && cop.isAlive)                                  cop.Weapons.RemoveAll();               cop.Weapons.AssaultRifle_M4.Ammo = 500;

 

 

300 views in half a day wow..

 

Ch3y3zze wrote this example some time back. Don't know if your a coder or not, so here ya go.

Edited by hardsty1e
Link to comment
Share on other sites

yeah 300 views and still not so many replies... sadly i dont know how to use it... but maybe you can give me a link to a tutorial or explain how to use it smile.gif

Edited by SWEG4MER
Link to comment
Share on other sites

if im not wrong you can copy the text and save the .txt file as a .net.dll file to get it working.

No... its not really working... but maybe i put the file in the wrong place... remember that i am a noob to this ...

 

When i put the files in Gta folder (also tried script folder) as a dll it almost worked... but i have no guns when spawn.. and i cant get new one ... not even

with a trainer... the gun gets deleted... the same thing for the cops... no gun...

 

 

 

Link to comment
Share on other sites

then the script is wrong so you have to use logic and change the text in there.

Oh my bad biggrin.gif i had sparkiv opened when i tried gta iv ... it makes all the guns disappear... now the guns are there at least... but the police is not using the right ones... confused.gif

 

 

... gonna keep tryin...

Link to comment
Share on other sites

yes thats cuz it says cop.Weapons.AssaultRifle_M4.Ammo < 1) and he uses assault rifle m4 so you have to put the type of weapon of the bat. and then the model name.Ammo < 1 )

Link to comment
Share on other sites

yes thats cuz it says cop.Weapons.AssaultRifle_M4.Ammo < 1) and he uses assault rifle m4 so you have to put the type of weapon of the bat. and then the model name.Ammo < 1 )

Yes but that's not really the problem... you see the cops do wear guns now... but its the default guns... they do not have the m4 as in the script...

Link to comment
Share on other sites

well, i cant solve that cuz im not so good at coding. any of the folks in here will help you. smile.gif

i sure hope so ... thanks for you help smile.gif

Link to comment
Share on other sites

the code hardstyle posted is not the entire script, i thought i put in my modpack but it's not there, i will post it here later converted for bats wink.gif

Edited by ch3y3zze
Link to comment
Share on other sites

 

the code hardstyle posted is not the entire script, i thought i put in my modpack but it's not there, i will post it here later converted for bats wink.gif

EDIT: okay thanks smile.gif

Link to comment
Share on other sites

 

namespace NiceCops{   using System;   using GTA;   public class Main : Script   {       Tick += new EventHandler(Main_Tick);   }      private void Main_Tick(object sender, EventArgs e)   {       //if u have more than 1 star script will deactivate and cops with bats deleted       //so game can replace with normal cops              if (Game.LocalPlayer.WantedLevel > 1)//change wanted level here if u like       {           Ped[] pedArray = World.GetAllPeds();           foreach (Ped cop in pedArray)           {               //finds cops with bats and deletes               if (Game.Exists(cop) && cop.RelationshipGroup == RelationshipGroup.Cop && cop.Weapons.BaseballBat.Ammo == 1)               {                   if (!cop.isOnScreen)                       cop.Delete();               }           }       }       else//here u onnly have 0 or 1 star so all cops will have bats only;D       {           Ped[] pedArray = World.GetAllPeds();           foreach (Ped cop in pedArray)           {               if (Game.Exists(cop) && cop.RelationshipGroup == RelationshipGroup.Cop && cop.Weapons.BaseballBat.Ammo < 1)               {                   if (cop.isAliveAndWell)                   {                       cop.Weapons.RemoveAll();                       cop.Weapons.BaseballBat.Ammo = 1;                   }               }           }       }   }}

 

 

I rewrote at work so if it crashes tell me error and ill fix it

 

http://dl.dropbox.com/u/55310026/NiceCops.cs

wow really thank you... im sure this gonna work if i get it right... at the moment i have xlive.dll and scripthook.dll installed... do i miss something? i have putted the nicecops.cs in scripts but still no change...

 

Here's a cookie for your hard work :3 cookie.gif

 

EDIT:

 

I downloaded you nicecop.cs file and putted it in the script folder...

I have scripthook and xlive dll installed

The cops still have the glocks and no kind of baseball bat is seen...

I think i am missing something ... and i really respect your hard work to help me but i'm a bit stuping when it comes to modding...

Edited by SWEG4MER
Link to comment
Share on other sites

Okay i found a error log ... because im a swede the error log is in swedish so i tried to translate it ...

 

 

2012-09-14 21:02:06 - Initializing Script Hook Dotnet v1.7.1.7 BETA (on GTA IV version 1.0.7.0 with C + + Hook version 0.5.1)

2012-09-14 21:02:53 - Direct3D device created!

 

2012-09-14 21:02:53 - SEARCHING FOR SCRIPTS ...

2012-09-14 21:02:53 - Loading dynamic script file 'scripts \ NiceCops.cs' ...

2012-09-14 21:02:53 - 10 Errors in script 'C: \ Program Files (x86) \ Rockstar Games \ Grand Theft Auto IV \ scripts \ NiceCops.cs':

                        In Line 8: Token + = is invalid in a declaration for a class, structure, or interface member

                        In Line 8: The method must have a return type

                        in Line 8: An identifier expected

                        in Line 11: A class, delegate, enumeration, an interface or a structure is expected

                        in Line 18: An identifier expected

                        in Line 18: A class, delegate, enumeration, an interface or a structure is expected

                        in Line 30: A namespace can not contain direct members as fields or methods

                        In Line 32: An identifier expected

                        in Line 32: A class, delegate, enumeration, an interface or a structure is expected

                        in Line 45: A type or namespace definition or end of file expected

                      

2012-09-14 21:02:53 - DONE! No. DotNet script found!

2012-09-14 21:02:53 - INFO: Phone number checks are not available!

2012-09-14 21:04:36 - Direct3D device lost!

Link to comment
Share on other sites

namespace NiceCops{   using System;   using GTA;   public class Main : Script   {       public Main()       {           Tick += new EventHandler(Main_Tick);       }       private void Main_Tick(object sender, EventArgs e)       {           //if u have more than 1 star script will deactivate and cops with bats deleted           //so game can replace with normal cops           if (Game.LocalPlayer.WantedLevel > 1)//change wanted level here if u like           {               Ped[] pedArray = World.GetAllPeds();               foreach (Ped cop in pedArray)               {                   //finds cops with bats and deletes                   if (Game.Exists(cop) && cop.RelationshipGroup == RelationshipGroup.Cop && cop.Weapons.BaseballBat.Ammo == 1)                   {                       if (!cop.isOnScreen)                           cop.Delete();                   }               }           }           else//here u onnly have 0 or 1 star so all cops will have bats only;D           {               Ped[] pedArray = World.GetAllPeds();               foreach (Ped cop in pedArray)               {                   if (Game.Exists(cop) && cop.RelationshipGroup == RelationshipGroup.Cop && cop.Weapons.BaseballBat.Ammo < 1)                   {                       if (cop.isAliveAndWell)                       {                           cop.Weapons.RemoveAll();                           cop.Weapons.BaseballBat.Ammo = 1;                       }                   }               }           }       }   }}

 

 

I rewrote at work so if it crashes tell me error and ill fix it

 

http://dl.dropbox.com/u/55310026/NiceCops.cs

wow really thank you... im sure this gonna work if i get it right... at the moment i have xlive.dll and scripthook.dll installed... do i miss something? i have putted the nicecops.cs in scripts but still no change...

 

Here's a cookie for your hard work :3 cookie.gif

 

EDIT:

 

I downloaded you nicecop.cs file and putted it in the script folder...

I have scripthook and xlive dll installed

The cops still have the glocks and no kind of baseball bat is seen...

I think i am missing something ... and i really respect your hard work to help me but i'm a bit stuping when it comes to modding...

fixed quoted code

Link to comment
Share on other sites

FIXED, look above and redownload from dropbox, i updated link

 

http://dl.dropbox.com/u/55310026/NiceCops.cs

Sweet jesus! :3 i dont know how i ever will be able to thank you enough biggrin.gif at first when i pulled out a cop from a car he just ran away like he was scared... but it was only the first time... then they started to act like they were suppose to do ... many thanks to you!

Link to comment
Share on other sites

YAY!! No problem man ;D

Man, they are realistic... biggrin.gif if a pull out a gun they all go to cover and let the "gun police" take over biggrin.gif

Link to comment
Share on other sites

Hm. After testing this out a bit i can see that there are some annoying bugs...

For example... when a pedestrian go mad and start shooting ... the police act like scared little girls and run away...

Maybe there is some way that if a player / pedestrian is pointing a gun at the police, the police will use a gun instead?

I am not an expert in scripting but i can understand it. So when a gun get's pointed at the police... some kind of a trigger will get activated and the police get's a gun ... what do you think?

Link to comment
Share on other sites

yeah ok, ill try to fix that wink.gif

No... it's actually nothing you have to fix... i starts to feel like im sitting here and demanding what you shall do bored.gif but of course it would be awesome to see this kind of mod... as i know there is no other mod which make the police more realistic... at least not like this...

Link to comment
Share on other sites

no problem i enjoy this ;D

Okay... i've been testing this for about 3 hours now. (Yeah i have nothing else to do) XD

 

These are the bugs/glitches i've found so far:

 

1. When having a gun i the hand the police will get scared and run away

2. When arrested, the police will point the bat like it was a gun. (Just looks fun)

3. When a pedestrian is goin mad and start shooting at someone or something the police will run away.

4. Sometimes i find cops with guns (often M4 or a glock). They are often at the subways or at the police buildings.

 

If you want some more info please let me know and i can test it wink.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.