AmmoPacks per map (like Lgk)
PHP Code:
Thanks to @LearninG for saving each player using command. |
Re: AmmoPacks per map (like Lgk)
this plugin looks like get ap plugin but give random ammo packs.
nice plugin |
Re: AmmoPacks per map (like Lgk)
Not sure if that's how it's supposed to be, but consider resetting used_command[id] when id disconnects.
|
Re: AmmoPacks per map (like Lgk)
Quote:
only when map restart/change you can use it again. |
Re: AmmoPacks per map (like Lgk)
Quote:
Another player joins, he hasn't used that command yet. He writes the command but plugin tells him "you've already used", because his id will be the same as previous player's. You should reset "used_command" when player disconnects ( or joins the server ) and check whether a player has used command by steamid or name. You should use tries for that. |
Re: AmmoPacks per map (like Lgk)
If using tries , bool is not necessary , create trie on plugin_init() , on ApCommand get user authid , check if it matches with what we have in trie , after giving ammo packs save user authid in trie so we know this authid has used command ( we will block him to access the command later by checking trie value ) and at last destroy trie on plugin_end() to free up memory.
example code : Code:
|
Re: AmmoPacks per map (like Lgk)
Edited the code, Thanks to LearninG
|
All times are GMT -4. The time now is 08:55. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.