Jump to content

c# script error


Recommended Posts

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.

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

public MyScript() {

this.KeyDown += new GTA.KeyEventHandler(KeyHandler);

}

private void KeyHandler(object sender, GTA.KeyEventArgs e) {

if (e.KeyWithModifiers == (Keys.Alt | Keys.B)) {

You are using the WRONG right theme!

[ WIPs | Donate | 🌌 Join Mod Multiverse!]
Flashing LED lightbar in British configuration

Link to comment
Share on other sites

  • 2 weeks later...

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 ?

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.



×
×
  • Create New...