Re: Top Flags [27/09/2018]
New version released.
Code:
1.2 [29/09/2018] |
Re: Top Flags [27/09/2018]
Quote:
|
Re: Top Flags [27/09/2018]
With the current implementation, stats will only get reset on servers where the map never changes. I understand this may be by design but if you fix this one thing, it can be used on any server. You should then re-check everyone on round start or something, instead of spawn:
PHP Code:
PHP Code:
Code:
Slight change, and you should use HAM_ returns in a HamSandwich event. PHP Code:
|
Re: Top Flags [27/09/2018]
Quote:
Thanks for your notes, but in my tests round start does not have the top updated yet, so I would have to put a Delay in the same way, what would be the real benefit with this change? All the rest I changed as you pointed me out, as for the indentation I do not know why it happened since I wrote it from the beginning in the sublime text, but thank you. |
Re: Top Flags [27/09/2018]
Regarding calling at round start versus spawn, not a noticeable benefit I guess, it would be get_cvar_string() not getting re-called for every person since the values would be re-used for everyone. Plus I think it would be cleaner to check everyone in 1 function call versus having the game call the same function at one time for every player.
|
Re: Top Flags [27/09/2018]
Quote:
|
Re: Top Flags [27/09/2018]
Move all variable declarations and redundant code (get_pcvar_string(), read_flags()) out of the for loop.
|
Re: Top Flags [27/09/2018]
Quote:
Ops sorry, updated. |
Re: Top Flags [27/09/2018]
You need to review the function in entirety when making a change. You should not be exiting the function within the loop based on a condition that affects 1 player, replace the return X with continue.
Code:
|
Re: Top Flags [27/09/2018]
Quote:
Thanks for all the notes Bugsy, I believe I have learned a lot from this, I guarantee that in my next "adventures" I will be better. |
All times are GMT -4. The time now is 13:16. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.