ProudDesk Posted December 22, 2020 Share Posted December 22, 2020 How would I show a box where you could enter text? Link to comment Share on other sites More sharing options...
mcal Posted December 22, 2020 Share Posted December 22, 2020 (edited) There are a couple of ways to do this, depending on what you want to do with the text. One way is to use the Cheat entry box (opens with the grave key), You can compare what is entered into this box with text you have hashed. You can not get this output as plain text in a string format. uint lsDebug = Function.Call<uint>(Hash.GET_HASH_KEY, "lsdebug"); if (Function.Call<bool>(Hash._0x557E43C447E700A8, lsDebug)) DoThing(); The other method is to use the onscreen keyboard native. This will return a string. bool InputWidowOpen = false; string enteredText = ""; void OpenInputWindow() { if(!InputWidowOpen) { Function.Call(Hash.DISPLAY_ONSCREEN_KEYBOARD, false, "FMMC_KEY_TIP", "", "", "", "", "", 40); InputWidowOpen = true; } } void GetInput() { switch (Function.Call<int>(Hash.UPDATE_ONSCREEN_KEYBOARD)) { default: // nothing happening break; case 1: //input detected enteredText = Function.Call<string>(Hash.GET_ONSCREEN_KEYBOARD_RESULT); InputWidowOpen = false; break; case 2: //enter or escape was pushed with no input detected InputWidowOpen = false; break; } } Edited December 22, 2020 by mcal typos Link to comment Share on other sites More sharing options...
LeeC22 Posted December 22, 2020 Share Posted December 22, 2020 (edited) If you are using ScriptHookVDotNet: string inputString = Game.GetUserInput(30); This is the simplest overload and will accept any string up to the number of characters specified in the brackets, so in this case 30 characters. Note: This is how it is called in SHVDN v2, it might have changed slightly if you are using SHVDN 3. One other thing to note is that any letter entered can pass that keypress back to the game as a control input if something matches that letter, so I disable the controls just before the input call to prevent that from happening. Game.DisableAllControlsThisFrame(0); string inputString = Game.GetUserInput(30); Edited December 22, 2020 by LeeC22 Link to comment Share on other sites More sharing options...
ProudDesk Posted December 22, 2020 Author Share Posted December 22, 2020 5 hours ago, LeeC22 said: If you are using ScriptHookVDotNet: string inputString = Game.GetUserInput(30); This is the simplest overload and will accept any string up to the number of characters specified in the brackets, so in this case 30 characters. Note: This is how it is called in SHVDN v2, it might have changed slightly if you are using SHVDN 3. One other thing to note is that any letter entered can pass that keypress back to the game as a control input if something matches that letter, so I disable the controls just before the input call to prevent that from happening. Game.DisableAllControlsThisFrame(0); string inputString = Game.GetUserInput(30); Thank you! i know that there is a WindowTitle property but is it possible to make a Custom title? Or can you do that with any of the other ways to make an input? Link to comment Share on other sites More sharing options...
LeeC22 Posted December 22, 2020 Share Posted December 22, 2020 (edited) 49 minutes ago, ProudDesk said: Thank you! i know that there is a WindowTitle property but is it possible to make a Custom title? Or can you do that with any of the other ways to make an input? I have never seen a way to use a custom window title. You just have to try and find one that is as vague as possible. When I used to use it, I used to show a subtitle with a really long time on it (10000 or more), so they had instructions on screen telling them what they should be entering. When the box is closed, just show an empty subtitle for a really short time to clear it. Edited December 22, 2020 by LeeC22 Link to comment Share on other sites More sharing options...
ProudDesk Posted December 22, 2020 Author Share Posted December 22, 2020 3 hours ago, LeeC22 said: I have never seen a way to use a custom window title. You just have to try and find one that is as vague as possible. When I used to use it, I used to show a subtitle with a really long time on it (10000 or more), so they had instructions on screen telling them what they should be entering. When the box is closed, just show an empty subtitle for a really short time to clear it. Aight Thank you :)) LeeC22 1 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