h3adshotzz Posted January 2, 2016 Share Posted January 2, 2016 ive been making my own mod menu/trainer for pc single player with native ui ive managed to get a notification to display above the mini map but the actual thing the button is meant to do does not work eg: private void OnItemSelect(UIMenu sender, UIMenuItem selectedItem, int index) //buttons go here { if (sender == Sub1) { switch (index) { case 0: Ped player = Game.Player.Character; UI.Notify("TEST FUNCTION"); GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_INVINCIBLE, player, true); break; case 1: Ped player2 = Game.Player.Character; GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_INVINCIBLE, player2, true); break; case 2: Ped player3 = Game.Player.Character; GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_WANTED_LEVEL, player3, 5, true); break; case 3: Ped player4 = Game.Player.Character; GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_WANTED_LEVEL, player4, 0, true); break; } } ive tried a few things like putting Ped player = Game.Player.Character outside of the the switch case and tried just using Ped player = Game.Player; but that didnt work either. btw Im new to C but ive done a lot of java Link to comment Share on other sites More sharing options...
aimless Posted January 2, 2016 Share Posted January 2, 2016 (edited) you can use the hash and use player.handle Function.Call((Hash)0x3882114BDE571AD4, player.Handle, true); Edited January 2, 2016 by aimless Link to comment Share on other sites More sharing options...
h3adshotzz Posted January 2, 2016 Author Share Posted January 2, 2016 you can use the hash and use player.handle Function.Call((Hash)0x3882114BDE571AD4, player.Handle, true); still no luck Link to comment Share on other sites More sharing options...
jedijosh920 Posted January 2, 2016 Share Posted January 2, 2016 LOL, you can't be serious. alloc8or 1 Link to comment Share on other sites More sharing options...
AHK1221 Posted January 3, 2016 Share Posted January 3, 2016 (edited) ive been making my own mod menu/trainer for pc single player with native ui ive managed to get a notification to display above the mini map but the actual thing the button is meant to do does not work eg: private void OnItemSelect(UIMenu sender, UIMenuItem selectedItem, int index) //buttons go here { if (sender == Sub1) { switch (index) { case 0: Ped player = Game.Player.Character; UI.Notify("TEST FUNCTION"); GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_INVINCIBLE, player, true); break; case 1: Ped player2 = Game.Player.Character; GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_INVINCIBLE, player2, true); break; case 2: Ped player3 = Game.Player.Character; GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_WANTED_LEVEL, player3, 5, true); break; case 3: Ped player4 = Game.Player.Character; GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_WANTED_LEVEL, player4, 0, true); break; } } ive tried a few things like putting Ped player = Game.Player.Character outside of the the switch case and tried just using Ped player = Game.Player; but that didnt work either. btw Im new to C but ive done a lot of java The code should be something like this: private void OnItemSelect(UIMenu sender, UIMenuItem selectedItem, int index) //buttons go here { if (sender == Sub1) { switch (index) { case 0: Player player = Game.Player; UI.Notify("TEST FUNCTION"); GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_INVINCIBLE, player, true); break; case 1: Player player2 = Game.Player; GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_INVINCIBLE, player2, true); break; case 2: Player player3 = Game.Player; GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_WANTED_LEVEL, player3, 5, false); break; case 3: Player player4 = Game.Player; GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_WANTED_LEVEL, player4, 0, false); break; } } I changed Ped to Player and Game.Player.Character to just Game.Player. Also, instead of the last parameter of SET_PLAYER_WANTED_LEVEL being true, I changed it to false because in NativeDB, its said to be always false. Hope it works! Edited January 3, 2016 by AHK1221 h3adshotzz 1 Link to comment Share on other sites More sharing options...
ISOFX Posted January 3, 2016 Share Posted January 3, 2016 LOL, you can't be serious. Everyone starts somewhere. Don't they? Comments like yours don't help anyone who is asking for help. h3adshotzz 1 Link to comment Share on other sites More sharing options...
AHK1221 Posted January 3, 2016 Share Posted January 3, 2016 LOL, you can't be serious. I bet you were there too when you were starting. Who knows, he may make the next blockbuster mod maybe 6 months or 2 years later. Don't underestimate others. h3adshotzz and motorsport71 2 Link to comment Share on other sites More sharing options...
h3adshotzz Posted January 3, 2016 Author Share Posted January 3, 2016 LOL, you can't be serious. I bet you were there too when you were starting. Who knows, he may make the next blockbuster mod maybe 6 months or 2 years later. Don't underestimate others. Link to comment Share on other sites More sharing options...
h3adshotzz Posted January 3, 2016 Author Share Posted January 3, 2016 ive been making my own mod menu/trainer for pc single player with native ui ive managed to get a notification to display above the mini map but the actual thing the button is meant to do does not work eg: private void OnItemSelect(UIMenu sender, UIMenuItem selectedItem, int index) //buttons go here { if (sender == Sub1) { switch (index) { case 0: Ped player = Game.Player.Character; UI.Notify("TEST FUNCTION"); GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_INVINCIBLE, player, true); break; case 1: Ped player2 = Game.Player.Character; GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_INVINCIBLE, player2, true); break; case 2: Ped player3 = Game.Player.Character; GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_WANTED_LEVEL, player3, 5, true); break; case 3: Ped player4 = Game.Player.Character; GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_WANTED_LEVEL, player4, 0, true); break; } } ive tried a few things like putting Ped player = Game.Player.Character outside of the the switch case and tried just using Ped player = Game.Player; but that didnt work either. btw Im new to C but ive done a lot of java The code should be something like this: private void OnItemSelect(UIMenu sender, UIMenuItem selectedItem, int index) //buttons go here { if (sender == Sub1) { switch (index) { case 0: Player player = Game.Player; UI.Notify("TEST FUNCTION"); GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_INVINCIBLE, player, true); break; case 1: Player player2 = Game.Player; GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_INVINCIBLE, player2, true); break; case 2: Player player3 = Game.Player; GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_WANTED_LEVEL, player3, 5, false); break; case 3: Player player4 = Game.Player; GTA.Native.Function.Call(GTA.Native.Hash.SET_PLAYER_WANTED_LEVEL, player4, 0, false); break; } } I changed Ped to Player and Game.Player.Character to just Game.Player. Also, instead of the last parameter of SET_PLAYER_WANTED_LEVEL being true, I changed it to false because in NativeDB, its said to be always false. Hope it works! nope still didnt work im going to leave that part out for now. is there anyway for the trainer to check what game version and if it is different to a set one it displays a popup? Link to comment Share on other sites More sharing options...
Saltyq Posted January 4, 2016 Share Posted January 4, 2016 (edited) Use player.WantedLevel instead of all those functions Edited January 4, 2016 by ZyDevs Link to comment Share on other sites More sharing options...
jedijosh920 Posted January 4, 2016 Share Posted January 4, 2016 Dude, why don't you just use Game.Player.WantedLevel??? I laughed because you added Player1, Player2, Player3, Player4 when you could've just used Game.Player or Game.Player.Character as an input argument, sorry about that! Link to comment Share on other sites More sharing options...
AHK1221 Posted January 4, 2016 Share Posted January 4, 2016 Use player.WantedLevel instead of all those functions He's right, use that. Dude, why don't you just use Game.Player.WantedLevel??? I laughed because you added Player1, Player2, Player3, Player4 when you could've just used Game.Player or Game.Player.Character as an input argument, sorry about that! First of all, we know hes a beginner so he may not know about the input and output argument classes. So instead of LOL-ing, try to help others. 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