elchoky10 3 Posted December 5, 2019 Posted December 5, 2019 For example i want to add a input to the screen and player type the model name, and then spawn. I just want know if any native to input on screen or similar? Quote
LMS 676 Posted December 5, 2019 Posted December 5, 2019 6 hours ago, elchoky10 said: For example i want to add a input to the screen and player type the model name, and then spawn. I just want know if any native to input on screen or similar? There is a basic input screen in the game, it can be called using https://www.mod-rdr.com/nativedb/index/misc/display_onscreen_keyboard-r2456/. You can then use GET_ONSCREEN_KEYBOARD_RESULT to get the result of the input. While the input box is being drawn, use UPDATE_ONSCREEN_KEYBOARD to get the current state of the input: 0 - is being shown 1 - input just confirmed 2 - editing cancelled 3 - not showing Hope this helps! Quote
elchoky10 3 Posted December 5, 2019 Author Posted December 5, 2019 3 hours ago, LMS said: There is a basic input screen in the game, it can be called using https://www.mod-rdr.com/nativedb/index/misc/display_onscreen_keyboard-r2456/. You can then use GET_ONSCREEN_KEYBOARD_RESULT to get the result of the input. While the input box is being drawn, use UPDATE_ONSCREEN_KEYBOARD to get the current state of the input: 0 - is being shown 1 - input just confirmed 2 - editing cancelled 3 - not showing Hope this helps! Thanks for all the help, i learn now how make scripts i try with RDR2 because is new, after i think i know how modd, i want to go to LSPDFR, i was there from years. Just one time more, i know i shoulbe use the AB'S script to mod, but my other post i dont get to work the CREATE_PED, i investigate and i get to the result in diferents NativeDB we have same method but with differents parametters. Heres is the natives i found to create ped: static Ped CREATE_PED(uint32_t p0, float p1, float p2, float p3, float p4, bool p5, bool p6, bool p7, bool p8, bool p9, bool p10) { return invoke<Ped>(0xD49F9B0955C367DE, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); } // 0xD49F9B0955C367DE b1207 static Ped CREATE_PED_A(Hash modelHash, float x, float y, float z, float heading, BOOL isNetwork, BOOL thisScriptCheck, BOOL p8, BOOL p9) { return invoke<Ped>(0xD49F9B0955C367DE, modelHash, x, y, z, heading, isNetwork, thisScriptCheck, p8, p9); } • Ped CREATE_PED(Hash modelHash, float x, float y, float z, float heading, BOOL p5, BOOL p6, BOOL p7, BOOL p8) // 0xD49F9B0955C367DE b1207 What native is the correct 😞 Quote
LMS 676 Posted December 5, 2019 Posted December 5, 2019 20 minutes ago, elchoky10 said: Thanks for all the help, i learn now how make scripts i try with RDR2 because is new, after i think i know how modd, i want to go to LSPDFR, i was there from years. Just one time more, i know i shoulbe use the AB'S script to mod, but my other post i dont get to work the CREATE_PED, i investigate and i get to the result in diferents NativeDB we have same method but with differents parametters. Heres is the natives i found to create ped: What native is the correct 😞 Generally you should use the declarations provided by the hook you use. What is not working with the native? Quote
elchoky10 3 Posted December 5, 2019 Author Posted December 5, 2019 4 minutes ago, LMS said: Generally you should use the declarations provided by the hook you use. What is not working with the native? I have the create_ped and continues invicible peds. I just use the native in my hook was no declare with name native, just _0x283978A15512B2FE _SET_PED_DEFAULT_OUTFIT I So i add the native like with this name: static void SET_PED_VISIBLE(Any p0, BOOL p1) { invoke<Void>(0x283978A15512B2FE, p0, p1); } in the native file, inside namespace PED. I try and continues dont working i get ped spawned but invisible. Quote
LMS 676 Posted December 5, 2019 Posted December 5, 2019 In Alexander's ScriptHook, that native is called PED::SET_PED_VISIBLE(ped, TRUE); You can try using that. Quote
elchoky10 3 Posted December 6, 2019 Author Posted December 6, 2019 5 hours ago, LMS said: In Alexander's ScriptHook, that native is called PED::SET_PED_VISIBLE(ped, TRUE); You can try using that. I use a gta5 code to draw a box in a NPC. And this code: Hash ped = MISC::GET_HASH_KEY("A_C_Horse_TennesseeWalker_Chestnut"); Entity player = PLAYER::PLAYER_PED_ID(); Vector3 playerCor = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, 0, 5, 0); Entity spawn = PED::CREATE_PED_ALWAYS(ped, playerCor.x, playerCor.y, playerCor.z, 0.f, false, false, false, false, true, true); ENTITY::SET_ENTITY_VISIBLE(spawn, TRUE); ENTITY::SET_ENTITY_ALPHA(spawn, 255, FALSE); PED::SET_PED_VISIBLE(spawn, TRUE); STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(ped); Spawn the ped, but never go visible: SET_PED_VISIBLE IS THE _OUTFIT CHANGER AND ALSO I ADD THE ENTITY BUT nothink Quote
JoewAlabel 0 Posted December 11, 2019 Posted December 11, 2019 (edited) Alexander's ScriptHook: char* hmodel = "A_C_Horse_TennesseeWalker_Chestnut"; DWORD model = GAMEPLAY::GET_HASH_KEY(hmodel); if (STREAMING::IS_MODEL_IN_CDIMAGE(model) && STREAMING::IS_MODEL_VALID(model)) { STREAMING::REQUEST_MODEL(model, FALSE); while (!STREAMING::HAS_MODEL_LOADED(model)) WaitAndDraw(0); // WAIT(0); Vector3 coords = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER::PLAYER_PED_ID(), 0.0, 3.0, -0.3); Ped ped = PED::CREATE_PED(model, coords.x, coords.y, coords.z, static_cast<float>(rand() % 360), 0, 0, 0, 0); PED::SET_PED_VISIBLE(ped, TRUE); ENTITY::SET_PED_AS_NO_LONGER_NEEDED(&ped); STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(model); } @LMS how use DISPLAY_ONSCREEN_KEYBOARD and GET_ONSCREEN_KEYBOARD_RESULT to set the char* hmodel, please? I can't find a way to make it work. Ty!!!! Edited December 11, 2019 by JoewAlabel Quote
JoewAlabel 0 Posted December 11, 2019 Posted December 11, 2019 (edited) this works for me 😉 Edited December 11, 2019 by JoewAlabel Quote
elchoky10 3 Posted December 11, 2019 Author Posted December 11, 2019 57 minutes ago, JoewAlabel said: this works for me 😉 The ped spawn? I have problem with natives now i have the natives of AB'S and work Quote
LMS 676 Posted December 11, 2019 Posted December 11, 2019 12 hours ago, JoewAlabel said: @LMS how use DISPLAY_ONSCREEN_KEYBOARD and GET_ONSCREEN_KEYBOARD_RESULT to set the char* hmodel, please? I can't find a way to make it work. Ty!!!! What is not working for you? Do you get the keyboard to show at least? Quote
JoewAlabel 0 Posted December 18, 2019 Posted December 18, 2019 (edited) On 12/11/2019 at 1:32 PM, LMS said: What is not working for you? Do you get the keyboard to show at least? I can using it creating one function: char* GetKeyboardInput(char* defaultText = "", int length = 64) { GAMEPLAY::DISPLAY_ONSCREEN_KEYBOARD(1, "", "", defaultText, "", "", "", length); while (GAMEPLAY::UPDATE_ONSCREEN_KEYBOARD() == 0) { scriptWait(0); } if (GAMEPLAY::UPDATE_ONSCREEN_KEYBOARD() != 1) { return ""; } return GAMEPLAY::GET_ONSCREEN_KEYBOARD_RESULT(); } And using: char* hmodel = GetKeyboardInput("", 64); I'm using AB Hook and Native Trainer source... I can't figure out how put one text to shows up above the input, like as: "Write the Ped Model".... or anything else. And the BIG problem is that I can't use ctrl + v on the input. No idea why i can't ... I pressed the key and it don't paste -.- Do u knew how fix it, please? ty!!!! Edited December 18, 2019 by JoewAlabel Quote
LMS 676 Posted December 18, 2019 Posted December 18, 2019 One of the parameters is the text to show. You could probably try using CREATE_VAR_STRING and then pass the resulting string there. No idea if Ctrl+C and Ctrl+V are supposed to work. Quote
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.