Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. DLC
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
      7. The Diamond Casino Heist
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
SWEG4MER

Make police use another weapon?

Recommended Posts

SWEG4MER

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...

Share this post


Link to post
Share on other sites
AgentWD40

 

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

Share this post


Link to post
Share on other sites
SWEG4MER

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

Share this post


Link to post
Share on other sites
aacclapd

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

 

Share this post


Link to post
Share on other sites
SWEG4MER
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...

 

 

 

Share this post


Link to post
Share on other sites
aacclapd

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

Share this post


Link to post
Share on other sites
SWEG4MER
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...

Share this post


Link to post
Share on other sites
aacclapd

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 )

Share this post


Link to post
Share on other sites
SWEG4MER
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...

Share this post


Link to post
Share on other sites
aacclapd

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

Share this post


Link to post
Share on other sites
SWEG4MER
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

Share this post


Link to post
Share on other sites
ch3y3zze

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

Share this post


Link to post
Share on other sites
SWEG4MER

 

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

Share this post


Link to post
Share on other sites
ch3y3zze

delete

Edited by ch3y3zze

Share this post


Link to post
Share on other sites
SWEG4MER

 

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

Share this post


Link to post
Share on other sites
SWEG4MER

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!

Share this post


Link to post
Share on other sites
ch3y3zze
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

Share this post


Link to post
Share on other sites
SWEG4MER
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!

Share this post


Link to post
Share on other sites
ch3y3zze

YAY!! No problem man ;D

Share this post


Link to post
Share on other sites
aacclapd

i hope finally you have it working. smile.gif

Share this post


Link to post
Share on other sites
SWEG4MER
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

Share this post


Link to post
Share on other sites
ch3y3zze

That's awesome, i cant wait to test at home ^_^

 

good idea! icon14.gificon14.gif

Share this post


Link to post
Share on other sites
SWEG4MER

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?

Share this post


Link to post
Share on other sites
ch3y3zze

yeah ok, ill try to fix that wink.gif

Share this post


Link to post
Share on other sites
SWEG4MER
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...

Share this post


Link to post
Share on other sites
ch3y3zze

no problem i enjoy this ;D

Share this post


Link to post
Share on other sites
SWEG4MER
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 .

Share this post


Link to post
Share on other sites
ch3y3zze

ok cool, yeah i havent started looking into it but thanks ill try to correct some

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 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.