Sign in to follow this  
LT.Steiner

How can disable actions???

Recommended Posts

Posted (edited)

Hello every body,

I set up some actions on "K",  "L",  "C" and some keys that I want to set them for future, when I'm chatting, these actions will work, how can i disable actions when chatting?

Edited by LT.Steiner

Share this post


Link to post
Share on other sites

you can make a variable that will be assigned when you open a chat and then add a check on that variable to your actions

Share this post


Link to post
Share on other sites

when somebody press T check if deafult variable that you made is false then set the variable as true  and then when he press ENTER set that variable to false

and check if chat is close then let those key work. 

Share this post


Link to post
Share on other sites

@attacking

can you give me a sample code?

i wrote cursor visible code in client that lock camera moves, now i want to disable key binds when chatting, I'm beginner, can you give me something? :)

Share this post


Link to post
Share on other sites
Posted (edited)

this example is for js client-side @LT.Steiner

 

global.chatopened = false;


mp.keys.bind(0x54, true, (player) => { /// T Key
    if (chatopened === true) return;
  	chatopened = true;
});

mp.keys.bind(0x0D, true, (player) => { /// ENTER Key
    if (chatopened === false) return;
     chatopened = false;
});

mp.keys.bind(0x4B, true, (player) => { /// a random key
    if (chatopened === true) return;  // add this to all of your keys code
  
     mp.events.callRemote('Lock_Vehicle_Key'); 
});

i'm gonna send some tutorial video to you check your pv.

Edited by attacking
  • Mask 1

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.