mcoocr Posted February 11, 2013 Share Posted February 11, 2013 I'm trying to make a .net script that prevents player from getting wanted if activated with a hotkey, thats what ive got so far (from example ): public class DisableWanted : Script{ bool bNoPolice; public DisableWanted() { Interval = 100; this.Tick += new EventHandler(this.tickHandler); this.KeyDown += new GTA.KeyEventHandler(this.keyHandler); } private void tickHandler(object sender, EventArgs e) { if ((bNoPolice) && (Player.WantedLevel > 0)) Player.WantedLevel = 0; } private void keyHandler(object sender, GTA.KeyEventArgs e) { if (e.Key != Keys.F5) return; bNoPolice = !bNoPolice; if (bNoPolice) { Player.WantedLevel = 0; Game.WantedMultiplier = 0.0F; } else { Game.WantedMultiplier = 1.0F; } }} The problem is if i am driving with a vehicle at the airport field (or maybe across city bridges, didnt checked early savegame) i keep getting 4 wanted starts, they will dissapear immediately but some police units are still spawning, and the police serach area appears/dissapears on the radar. I also tried to hook drawevents and change wantedlevel there, but still the same result. So my question is, is there a way to hook wanted-level changes directly and prevent them, or set an flag to prevent changes? Link to comment Share on other sites More sharing options...
pedro2555 Posted February 11, 2013 Share Posted February 11, 2013 (edited) use this instead http://www.gtamodding.com/index.php?title=...E_IGNORE_PLAYER also the value of bNoPolice is not explicitly set on script start, and it is better to use BindKey method instead of keydown Edited February 11, 2013 by pedro2555 Link to comment Share on other sites More sharing options...
mcoocr Posted February 11, 2013 Author Share Posted February 11, 2013 use this instead http://www.gtamodding.com/index.php?title=...E_IGNORE_PLAYER also the value of bNoPolice is not explicitly set on script start, and it is better to use BindKey method instead of keydown thanks for help, my first script Link to comment Share on other sites More sharing options...
pedro2555 Posted February 11, 2013 Share Posted February 11, 2013 use this instead http://www.gtamodding.com/index.php?title=...E_IGNORE_PLAYER also the value of bNoPolice is not explicitly set on script start, and it is better to use BindKey method instead of keydown thanks for help, my first script Good luck on that then. 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