Miep3r Posted January 5, 2019 Share Posted January 5, 2019 I am currently working on a roleplay gamemode which uses a database for datastorage and I stumbled upon a problem while trying to save the players weapons and ammunition. I know there have already been threads discussing the topic of saving ammunition but every solution returned 0 for me. I have tried: player.getWeaponAmmo(weaponHash) [Server-Side] mp.game.invoke("0x015A522136D7F951", mp.players.local.handle, weaponHash); [Client-Side] Both of these have returned 0 for me, also by using different Weapons (Pistol, Carbine-Rifle). I hope that someone has a solution to this problem or could fix the player.getWeaponAmmo(weaponHash) command. Regards, Miep3r Link to comment Share on other sites More sharing options...
Pilatus Posted January 5, 2019 Share Posted January 5, 2019 (edited) Are you passing the weaponHash or the weaponName? Because if in your code weaponHash equals to the name of the weapon, than it would not work. Try this way with a pistol: let pistolAmmo = mp.game.invoke("0x015A522136D7F951", mp.players.local.handle, mp.joaat('weapon_pistol')); Basicaly mp.joaat() convert an entity name to hash, exactly what the function expects. Good luck! Edited January 5, 2019 by Pilatus Link to comment Share on other sites More sharing options...
Miep3r Posted January 5, 2019 Author Share Posted January 5, 2019 Thanks for the quick answer, That is exactly the way I did it but it just doesn't seem to work. I even set the weaponHash to something static like mp.game.joaat("weapon_carbinerifle"), still didn't work. 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