SWEG4MER Posted September 14, 2012 Share Posted September 14, 2012 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 More sharing options...
AgentWD40 Posted September 14, 2012 Share Posted September 14, 2012 (edited) 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 September 14, 2012 by hardsty1e Link to comment Share on other sites More sharing options...
SWEG4MER Posted September 14, 2012 Author Share Posted September 14, 2012 (edited) 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 Edited September 14, 2012 by SWEG4MER Link to comment Share on other sites More sharing options...
aacclapd Posted September 14, 2012 Share Posted September 14, 2012 if im not wrong you can copy the text and save the .txt file as a .net.dll file to get it working. Link to comment Share on other sites More sharing options...
SWEG4MER Posted September 14, 2012 Author Share Posted September 14, 2012 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 More sharing options...
aacclapd Posted September 14, 2012 Share Posted September 14, 2012 then the script is wrong so you have to use logic and change the text in there. Link to comment Share on other sites More sharing options...
SWEG4MER Posted September 14, 2012 Author Share Posted September 14, 2012 then the script is wrong so you have to use logic and change the text in there. Oh my bad 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... ... gonna keep tryin... Link to comment Share on other sites More sharing options...
aacclapd Posted September 14, 2012 Share Posted September 14, 2012 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 More sharing options...
SWEG4MER Posted September 14, 2012 Author Share Posted September 14, 2012 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 More sharing options...
aacclapd Posted September 14, 2012 Share Posted September 14, 2012 well, i cant solve that cuz im not so good at coding. any of the folks in here will help you. Link to comment Share on other sites More sharing options...
SWEG4MER Posted September 14, 2012 Author Share Posted September 14, 2012 well, i cant solve that cuz im not so good at coding. any of the folks in here will help you. i sure hope so ... thanks for you help Link to comment Share on other sites More sharing options...
ch3y3zze Posted September 14, 2012 Share Posted September 14, 2012 (edited) 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 Edited September 14, 2012 by ch3y3zze Link to comment Share on other sites More sharing options...
SWEG4MER Posted September 14, 2012 Author Share Posted September 14, 2012 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 EDIT: okay thanks Link to comment Share on other sites More sharing options...
ch3y3zze Posted September 14, 2012 Share Posted September 14, 2012 (edited) delete Edited September 14, 2012 by ch3y3zze Link to comment Share on other sites More sharing options...
SWEG4MER Posted September 14, 2012 Author Share Posted September 14, 2012 (edited) 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 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 September 14, 2012 by SWEG4MER Link to comment Share on other sites More sharing options...
SWEG4MER Posted September 14, 2012 Author Share Posted September 14, 2012 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 More sharing options...
ch3y3zze Posted September 14, 2012 Share Posted September 14, 2012 (edited) FIXED, look above and redownload from dropbox, i updated link http://dl.dropbox.com/u/55310026/NiceCops.cs Edited September 14, 2012 by ch3y3zze Link to comment Share on other sites More sharing options...
ch3y3zze Posted September 14, 2012 Share Posted September 14, 2012 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 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 More sharing options...
SWEG4MER Posted September 14, 2012 Author Share Posted September 14, 2012 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 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 More sharing options...
ch3y3zze Posted September 14, 2012 Share Posted September 14, 2012 YAY!! No problem man ;D Link to comment Share on other sites More sharing options...
aacclapd Posted September 14, 2012 Share Posted September 14, 2012 i hope finally you have it working. Link to comment Share on other sites More sharing options...
SWEG4MER Posted September 14, 2012 Author Share Posted September 14, 2012 YAY!! No problem man ;D Man, they are realistic... if a pull out a gun they all go to cover and let the "gun police" take over Link to comment Share on other sites More sharing options...
ch3y3zze Posted September 14, 2012 Share Posted September 14, 2012 That's awesome, i cant wait to test at home ^_^ good idea! Link to comment Share on other sites More sharing options...
SWEG4MER Posted September 14, 2012 Author Share Posted September 14, 2012 That's awesome, i cant wait to test at home ^_^ good idea! Also tried to use with this mod, it made it even more awesome and realistic D http://www.gtaforums.com/index.php?showtopic=480982 Link to comment Share on other sites More sharing options...
SWEG4MER Posted September 15, 2012 Author Share Posted September 15, 2012 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 More sharing options...
ch3y3zze Posted September 15, 2012 Share Posted September 15, 2012 yeah ok, ill try to fix that Link to comment Share on other sites More sharing options...
SWEG4MER Posted September 15, 2012 Author Share Posted September 15, 2012 yeah ok, ill try to fix that No... it's actually nothing you have to fix... i starts to feel like im sitting here and demanding what you shall do 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 More sharing options...
ch3y3zze Posted September 15, 2012 Share Posted September 15, 2012 no problem i enjoy this ;D Link to comment Share on other sites More sharing options...
SWEG4MER Posted September 15, 2012 Author Share Posted September 15, 2012 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 . Link to comment Share on other sites More sharing options...
ch3y3zze Posted September 15, 2012 Share Posted September 15, 2012 ok cool, yeah i havent started looking into it but thanks ill try to correct some Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now