Saving player weapons and ammo
Hey!
I wish to save players' weapons and ammo when they disconnect and give the weapons and ammo back correctly when they come online again. I've found a very useful post, which saves the weapons and gives them back later, I managed to implement it in my script properly and it works flawlessly, but I don't know how can I save the weapons' ammo in the backpack AND in the clip of the weapons. A small note: My script enables having multiple primary and secondary weapons, if this changes anything. Any help would be appreciated! Edit: I forgot to quote the post about weapon saving (if this provides any help): Quote:
|
Re: Saving player weapons and ammo
I think you won't be able to do this with bitsums, which means you would have to create a more dimensional variable, like:
PHP Code:
PHP Code:
|
Re: Saving player weapons and ammo
Thank you for your reply!
I guess I understand how can I get the ammo in the backpack with a loop, but the clip ammo is not really clear! Also, get_user_weapon returns the id of the weapon currently being held by the player, isn't it? Can you please write an example how should it be used? Thank you! |
Re: Saving player weapons and ammo
Bitsums can be useful for storing what weapons a player has, if you want to store clip\bp-ammo or any other info then it will take some more coding, as backstabnoob said.
This will save\restore all primary\secondary weapons as well as grenades. Let me know if you have any problems. PHP Code:
|
Re: Saving player weapons and ammo
It works flawlessly! Thank you very much, Bugsy!
I have got a last request, if you can make it. I'd like to enable people to have "multiple accounts" on my server for their different characters, therefore it would be awesome if you could edit it to save by name instead of Steam ID. Thank you! |
Re: Saving player weapons and ammo
just change get_user_authid to get_user_name
|
Re: Saving player weapons and ammo
I tried it already, and for some reason, it gives me the same weapons with different names. :(
Edit: I'm completely retarded. :P It DOES work! Don't know what was the problem before... Thank you, both of you! ^^ |
| All times are GMT -4. The time now is 06:14. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.