Raised This Month: $12 Target: $400
 3% 

Time info v1.1 [HUD+Narrator]


Post New Thread Reply   
 
Thread Tools Display Modes
thEsp
BANNED
Join Date: Aug 2017
Old 03-12-2019 , 16:16   Re: Time info v1.1 [HUD+Narrator]
Reply With Quote #11

Quote:
Originally Posted by eat1k View Post
new bool:iLag[32]
1) Why "i"? It's a boolean. so bLag. Moreover, it should be MAX_PLAYERS+1 (32+1).
2) Better not to use ResetHUD.
3) get_cvar_num -> get_pcvar_num (if you want to support AMXX 1.8.2. If not, so just use bind_pcvar_*).
4)
PHP Code:
public StartThread(id) if(iLag[id]==false){ 
->
PHP Code:
public StartThread(id)
{
         if(!
iLag[id])
                  
set_task(0.1"ShowTime"id);

I feel better with booleans like that, I meant to use iLag as a shortening to isLagging (Since I find this the only reason to hide hud text ). ResetHUD and get_cvar_num are easier to understand, I'll look forward for any bugs in this case. But dont know why should I use 33 instead of 32 boolean(s)?
thEsp is offline
eat1k
Senior Member
Join Date: Apr 2018
Old 03-12-2019 , 16:38   Re: Time info v1.1 [HUD+Narrator]
Reply With Quote #12

Quote:
Originally Posted by thEsp View Post
I feel better with booleans like that, I meant to use iLag as a shortening to isLagging (Since I find this the only reason to hide hud text ). ResetHUD and get_cvar_num are easier to understand, I'll look forward for any bugs in this case. But dont know why should I use 33 instead of 32 boolean(s)?
So I think it's better to rename it to isLag or g_isLag. As someone said "Opinions don't make code better". So think about it. get_cvar_num is nothing optimized when you can use get_pcvar_num. ResetHUD the same. Regarding the 33, because the maximum number of players is 32 (the constant MAX_PLAYERS, I recommend you to use constants and not magic numbers so MAX_PLAYER+1). The last cell has to be 32 (32 player).
__________________

Last edited by eat1k; 03-12-2019 at 16:39.
eat1k is offline
lantimilan
Senior Member
Join Date: May 2016
Old 03-14-2019 , 15:40   Re: Time info v1.1 [HUD+Narrator]
Reply With Quote #13

Beautiful Plugins
lantimilan is offline
Send a message via MSN to lantimilan
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-07-2020 , 08:14   Re: Time info v1.1 [HUD+Narrator]
Reply With Quote #14

Unapproved per author's request.
__________________
HamletEagle is online now
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode