Castillo Posted July 30, 2012 Share 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 ) Link to comment
Drakath Posted July 30, 2012 Author Share 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? Link to comment
Castillo Posted July 30, 2012 Share 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. Link to comment
Drakath Posted July 31, 2012 Author Share Posted July 31, 2012 This is part of the script right? I replaced that part to this part and I did not edit anything. Link to comment
Castillo Posted July 31, 2012 Share Posted July 31, 2012 Did I said replace something? no, I said add it on your save system script. Link to comment
Castillo Posted July 31, 2012 Share Posted July 31, 2012 You posted a script earlier, just copy my code and paste it down of that script. Link to comment
Drakath Posted July 31, 2012 Author Share Posted July 31, 2012 Well 90 % of problem is fixed. Now when player reconnects after death he only gets back weapon he used last. Link to comment
Castillo Posted July 31, 2012 Share Posted July 31, 2012 What do you mean? when he dies he won't have any weapon, and all the saved ones are reseted. Link to comment
Drakath Posted July 31, 2012 Author Share Posted July 31, 2012 I'm using spawnmanager that takes weapon after death 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