gangrenn 626 Posted August 19, 2012 Share Posted August 19, 2012 Hi I got an error with this line, how can i fix it or what should i use to do something, when we press alt+b for example. if (Keys.b == b.Alt) { .... } Error 1 The name 'Keys' does not exist in the current context Error 2 The name 'b' does not exist in the current context Thanks. Quote My youtube channel: https://www.youtube.com/user/gangrenn Seagrave & pierce engine / ladder for GTA5: https://www.facebook.com/3DEmergencyVehicleModdingStudio/ Link to comment Share on other sites More sharing options...
Sniper296 1,712 Posted August 19, 2012 Share Posted August 19, 2012 public MyScript() { this.KeyDown += new GTA.KeyEventHandler(KeyHandler); } private void KeyHandler(object sender, GTA.KeyEventArgs e) { if (e.KeyWithModifiers == (Keys.Alt | Keys.B)) { GtaGamerCop 1 Quote You are using the WRONG right theme! [ WIPs | Donate | Join Mod Multiverse!] Link to comment Share on other sites More sharing options...
gangrenn 626 Posted August 19, 2012 Author Share Posted August 19, 2012 i still get the same error with your code: The name 'Keys' does not exist in the current context Quote My youtube channel: https://www.youtube.com/user/gangrenn Seagrave & pierce engine / ladder for GTA5: https://www.facebook.com/3DEmergencyVehicleModdingStudio/ Link to comment Share on other sites More sharing options...
Sniper296 1,712 Posted August 19, 2012 Share Posted August 19, 2012 Make sure that you have System.Windows.Forms referenced and have using System.Windows.Forms; Quote You are using the WRONG right theme! [ WIPs | Donate | Join Mod Multiverse!] Link to comment Share on other sites More sharing options...
Influenza 48 Posted August 19, 2012 Share Posted August 19, 2012 As Sniper said most probably a problem with a missing reference. Also, the e.Key value may be masked (the Alt key = System key try e.SystemKey) Quote Link to comment Share on other sites More sharing options...
gangrenn 626 Posted August 30, 2012 Author Share Posted August 30, 2012 here, is my entire code, references: Quote My youtube channel: https://www.youtube.com/user/gangrenn Seagrave & pierce engine / ladder for GTA5: https://www.facebook.com/3DEmergencyVehicleModdingStudio/ Link to comment Share on other sites More sharing options...
dingo2031 24 Posted August 30, 2012 Share Posted August 30, 2012 I dont see anything wrong Quote Link to comment Share on other sites More sharing options...
gangrenn 626 Posted August 30, 2012 Author Share Posted August 30, 2012 Alright, i fixed the error. But my script don't work: i press alt+b but nothing happen (but i don't get any error in game, the scripthook log says that the script started successfully) is it the good code to play a sound ? Quote My youtube channel: https://www.youtube.com/user/gangrenn Seagrave & pierce engine / ladder for GTA5: https://www.facebook.com/3DEmergencyVehicleModdingStudio/ Link to comment Share on other sites More sharing options...
gangrenn 626 Posted August 31, 2012 Author Share Posted August 31, 2012 up. Quote My youtube channel: https://www.youtube.com/user/gangrenn Seagrave & pierce engine / ladder for GTA5: https://www.facebook.com/3DEmergencyVehicleModdingStudio/ Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.