IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Post mod/code requests in the Mod Requests topic

Post mod releases in the Mod Showroom

Read the Modding Rules BEFORE posting!

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


Pages: (3) [1] 2 3   ( Go to first unread post ) Reply to this topicStart new topicStart Poll

 Make police use another weapon?

 As you can see above... is it possible?
 
SWEG4MER  
Posted: Friday, Sep 14 2012, 14:11
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Sep 14, 2012

XXXXX



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

 
hardsty1e  
Posted: Friday, Sep 14 2012, 15:02
Quote Post


Rat
Group Icon
Group: Members
Joined: May 2, 2009

XXXXX



QUOTE (SWEG4MER @ Friday, Sep 14 2012, 14:11)
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...

CODE

       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.

This post has been edited by hardsty1e on Friday, Sep 14 2012, 15:05
PM
  Top
 

 
SWEG4MER  
Posted: Friday, Sep 14 2012, 15:23
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Sep 14, 2012

XXXXX



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

This post has been edited by SWEG4MER on Friday, Sep 14 2012, 15:38
PM
  Top
 

 
aacclapd  
Posted: Friday, Sep 14 2012, 16:08
Quote Post


Map Modder
Group Icon
Group: Members
Joined: Jan 6, 2012

es.gif

XXXXX



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

 
SWEG4MER  
Posted: Friday, Sep 14 2012, 16:25
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Sep 14, 2012

XXXXX



QUOTE (aacclapd @ Friday, Sep 14 2012, 16:08)
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...


PM
  Top
 

 
aacclapd  
Posted: Friday, Sep 14 2012, 16:27
Quote Post


Map Modder
Group Icon
Group: Members
Joined: Jan 6, 2012

es.gif

XXXXX



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

 
SWEG4MER  
Posted: Friday, Sep 14 2012, 16:38
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Sep 14, 2012

XXXXX



QUOTE (aacclapd @ Friday, Sep 14 2012, 16:27)
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...
PM
  Top
 

 
aacclapd  
Posted: Friday, Sep 14 2012, 16:40
Quote Post


Map Modder
Group Icon
Group: Members
Joined: Jan 6, 2012

es.gif

XXXXX



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 )
PM
  Top
 

 
SWEG4MER  
Posted: Friday, Sep 14 2012, 16:48
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Sep 14, 2012

XXXXX



QUOTE (aacclapd @ Friday, Sep 14 2012, 16:40)
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...
PM
  Top
 

 
aacclapd  
Posted: Friday, Sep 14 2012, 16:56
Quote Post


Map Modder
Group Icon
Group: Members
Joined: Jan 6, 2012

es.gif

XXXXX



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

 
SWEG4MER  
Posted: Friday, Sep 14 2012, 16:57
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Sep 14, 2012

XXXXX



QUOTE (aacclapd @ Friday, Sep 14 2012, 16:56)
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
PM
  Top
 

 
ch3y3zze  
Posted: Friday, Sep 14 2012, 17:10
Quote Post


ni**erKILLER
Group Icon
Group: BUSTED!
Joined: Aug 30, 2012

us.gif

XXXXX



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

This post has been edited by ch3y3zze on Friday, Sep 14 2012, 17:13
PM
  Top
 

 
SWEG4MER  
Posted: Friday, Sep 14 2012, 17:18
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Sep 14, 2012

XXXXX



QUOTE (ch3y3zze @ Friday, Sep 14 2012, 17:10)
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
PM
  Top
 

 
ch3y3zze  
Posted: Friday, Sep 14 2012, 17:39
Quote Post


ni**erKILLER
Group Icon
Group: BUSTED!
Joined: Aug 30, 2012

us.gif

XXXXX



delete

This post has been edited by ch3y3zze on Friday, Sep 14 2012, 19:14
PM
  Top
 

 
SWEG4MER  
Posted: Friday, Sep 14 2012, 18:48
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Sep 14, 2012

XXXXX



QUOTE (ch3y3zze @ Friday, Sep 14 2012, 17:39)
CODE
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...

This post has been edited by SWEG4MER on Friday, Sep 14 2012, 18:58
PM
  Top
 

 
SWEG4MER  
Posted: Friday, Sep 14 2012, 19:07
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Sep 14, 2012

XXXXX



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!
PM
  Top
 

 
ch3y3zze  
Posted: Friday, Sep 14 2012, 19:09
Quote Post


ni**erKILLER
Group Icon
Group: BUSTED!
Joined: Aug 30, 2012

us.gif

XXXXX



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

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

This post has been edited by ch3y3zze on Friday, Sep 14 2012, 19:14
PM
  Top
 

 
ch3y3zze  
Posted: Friday, Sep 14 2012, 19:15
Quote Post


ni**erKILLER
Group Icon
Group: BUSTED!
Joined: Aug 30, 2012

us.gif

XXXXX



QUOTE (SWEG4MER @ Friday, Sep 14 2012, 18:48)
QUOTE (ch3y3zze @ Friday, Sep 14 2012, 17:39)
CODE
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
PM
  Top
 

 
SWEG4MER  
Posted: Friday, Sep 14 2012, 19:23
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Sep 14, 2012

XXXXX



QUOTE (ch3y3zze @ Friday, Sep 14 2012, 19:09)
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!
PM
  Top
 

 
ch3y3zze  
Posted: Friday, Sep 14 2012, 19:26
Quote Post


ni**erKILLER
Group Icon
Group: BUSTED!
Joined: Aug 30, 2012

us.gif

XXXXX



YAY!! No problem man ;D
PM
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Pages: (3) [1] 2 3 

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG