Loui2 Posted July 30, 2017 Share Posted July 30, 2017 (edited) Hello, I'm sort of a noob in programming and was hoping someone can answer this question. I'm trying to use the native function "GAMEPLAY::_HAS_CHEAT_STRING_JUST_BEEN_ENTERED()" (557E43C447E700A8), however it requires a hash to be entered as the parameter. I have no idea what to enter in this situation, I was expecting it to take a string instead. An example of how I would like to use this function in LUA (sorry, extremely unfamiliar with C#): function again.tick() if(GAMEPLAY._HAS_CHEAT_STRING_JUST_BEEN_ENTERED("Reload Lua") then loadAddIns() print("AddIns have been reloaded \n") wait(999) endend Edited July 30, 2017 by Loui2 Link to comment Share on other sites More sharing options...
jedijosh920 Posted July 30, 2017 Share Posted July 30, 2017 Use GET_HASH_KEY(string) Loui2 1 Link to comment Share on other sites More sharing options...
Loui2 Posted July 30, 2017 Author Share Posted July 30, 2017 (edited) Use GET_HASH_KEY(string) Thank you so much! By the way I love your mods, thank you for sharing them with the community. EDIT: I must be doing this horribly wrong. In LUA console I get the error "tick: scripts/addins/reload.lua:10: attempt to call field '_HAS_CHEAT_STRING_BEEN_ENTERED' (a nil value)" function again.tick() if(GAMEPLAY._HAS_CHEAT_STRING_BEEN_ENTERED(GAMEPLAY.GET_HASH_KEY("reload lua"))) then loadAddIns() print("AddIns have been reloaded \n") wait(999) end end EDIT: Switched over to C# ScriptHookDotNet and got it working! if (Function.Call<bool>(Hash._0x557E43C447E700A8, Function.Call<int>(Hash.GET_HASH_KEY, "mycheat"))) { UI.ShowSubtitle("STOP CHEATING :)"); } Edited August 7, 2017 by Loui2 NModds and jedijosh920 2 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