Castillo Posted July 30, 2012 Posted July 30, 2012 Add this to your save system: addEventHandler ( "onPlayerWasted", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then setAccountData ( account, "zmgm.weaponID0", 0 ) setAccountData ( account, "zmgm.weaponID1", 0 ) setAccountData ( account, "zmgm.weaponID2", 0 ) setAccountData ( account, "zmgm.weaponID3", 0 ) setAccountData ( account, "zmgm.weaponID4", 0 ) setAccountData ( account, "zmgm.weaponID5", 0 ) setAccountData ( account, "zmgm.weaponID6", 0 ) setAccountData ( account, "zmgm.weaponID7", 0 ) setAccountData ( account, "zmgm.weaponID8", 0 ) setAccountData ( account, "zmgm.weaponID9", 0 ) setAccountData ( account, "zmgm.weaponID10", 0 ) setAccountData ( account, "zmgm.weaponID11", 0 ) setAccountData ( account, "zmgm.weaponID12", 0 ) end end )
Drakath Posted July 30, 2012 Author Posted July 30, 2012 I replaced: setAccountData ( account, "zmgm.weaponID0", 0 ) setAccountData ( account, "zmgm.weaponID1", 0 ) setAccountData ( account, "zmgm.weaponID2", 0 ) setAccountData ( account, "zmgm.weaponID3", 0 ) setAccountData ( account, "zmgm.weaponID4", 0 ) setAccountData ( account, "zmgm.weaponID5", 0 ) setAccountData ( account, "zmgm.weaponID6", 0 ) setAccountData ( account, "zmgm.weaponID7", 0 ) setAccountData ( account, "zmgm.weaponID8", 0 ) setAccountData ( account, "zmgm.weaponID9", 0 ) setAccountData ( account, "zmgm.weaponID10", 0 ) setAccountData ( account, "zmgm.weaponID11", 0 ) setAccountData ( account, "zmgm.weaponID12", 0 ) To this, but it did not work. Maybe I did replace it wrong?
Castillo Posted July 30, 2012 Posted July 30, 2012 I don't understand what do you mean, the script I posted should reset all saved weapons when get killed, no need to edit it.
Drakath Posted July 31, 2012 Author Posted July 31, 2012 This is part of the script right? I replaced that part to this part and I did not edit anything.
Castillo Posted July 31, 2012 Posted July 31, 2012 Did I said replace something? no, I said add it on your save system script.
Castillo Posted July 31, 2012 Posted July 31, 2012 You posted a script earlier, just copy my code and paste it down of that script.
Drakath Posted July 31, 2012 Author Posted July 31, 2012 Well 90 % of problem is fixed. Now when player reconnects after death he only gets back weapon he used last.
Castillo Posted July 31, 2012 Posted July 31, 2012 What do you mean? when he dies he won't have any weapon, and all the saved ones are reseted.
Drakath Posted July 31, 2012 Author Posted July 31, 2012 I'm using spawnmanager that takes weapon after death
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