Markeloff Posted December 21, 2013 Share Posted December 21, 2013 Hello everyone, "The double ammo story" This topic is being repeated many times, I got rid of the howto. I'm stuck, no ways, no solutions. Its really annoying spending hours on figuring it out. Let's start, this topic goes into two larges parts and every part has a question. So, it's all about the save ways in mta. It's not the problem of sqlite or mysql. The problem made me crazy. I want to save the weapons of the player on two bigs events : onPlayerQuit, onPlayerWasted .. Now, loading the data is more harder even.. After finding my bug which was saving weapons and load it onPlayerSpawn. Well, onPlayerLogin is sort of onPlayerSpawn. I have no idea now how to load the data when player wasted. Besides, using onPlayerSpawn for getting the weapons on the event onPlayerWasted makes the bug of double ammo when onPlayerLogin. In this case, I got the weapons and the ammo + onPlayerSpawn ammo bug.. And here we go, getPedTotalAmmo bug comes, the values return to the unwanted values which makes the bug hard to find. To sum up, any solution to load data onPlayerWasted excluding onPlayerSpawn event solution.. Now, the part "why not?" I wanted that MTA Team automatically saves weapons onPlayerWasted and load it onPlayerSpawn. So, we don't need to save it. For players who won't use it, they can use takeWeapon.. Thanks for reading. Link to comment
Castillo Posted December 21, 2013 Share Posted December 21, 2013 I don't see what's the problem of having to save the weapons on wasted and restore them on spawn, it isn't hard to do it. Link to comment
Markeloff Posted December 21, 2013 Author Share Posted December 21, 2013 The problem isn't that, anyway I used toJSON and fromJSON to save weapons. It's working. Link to comment
bandi94 Posted December 21, 2013 Share Posted December 21, 2013 Well , toJSON / fromJSON will work until you hit the MTA account data string lenght limit. It's around 100 char. Link to comment
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