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

HUD Team Chat


Post New Thread Reply   
 
Thread Tools Display Modes
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 11-28-2017 , 13:18   Re: HUD Team Chat
Reply With Quote #11

Check for is_user_alive(), right after HUDTeamChat().
Code:
public HUDTeamChat(id){     if (get_pcvar_num(cvar_HTeamChat) && is_user_alive(id)){    }
__________________

Last edited by Relaxing; 12-01-2017 at 11:59.
Relaxing is offline
Koneuka
Junior Member
Join Date: Nov 2017
Old 11-28-2017 , 14:43   Re: HUD Team Chat
Reply With Quote #12

Quote:
Originally Posted by Relaxing View Post
Check for is_user_alive(), right after HUDTeamChat().
It means if plugin will be turned off by cvar it still will do useless check

Last edited by Koneuka; 11-28-2017 at 16:03.
Koneuka is offline
Koneuka
Junior Member
Join Date: Nov 2017
Old 11-28-2017 , 14:46   Re: HUD Team Chat
Reply With Quote #13

Quote:
Originally Posted by OciXCrom View Post
What are you all talking about?

PHP Code:
new SenderAlive is_user_alive(id)
if (
SenderAlive == is_user_alive(tempPlayer)) 
This is correct.

PHP Code:
if (is_user_alive(id) == is_user_alive(tempPlayer)) 
This is incorrect.

Why would you check if the user is alive 32 times instead of checking it only once? How is the variable used only once when it's inside a loop? Don't listen to them and revert back the changes. Caching the value in a variable because it's going to be used more than once is absolutely correct.
First, glad to see you in topic. Second, awkward situation Changing back

Last edited by Koneuka; 11-28-2017 at 16:04.
Koneuka is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 11-29-2017 , 14:50   Re: HUD Team Chat
Reply With Quote #14

Quote:
Originally Posted by Koneuka View Post
It means if plugin will be turned off by cvar it still will do useless check
You are reading all arguments that a client writes and on the final moments (hud message) you check if message sender is alive and return 1/0. -.-
__________________
Relaxing is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 11-30-2017 , 12:25   Re: HUD Team Chat
Reply With Quote #15

i see some crap is going on there.
Quote:
Code:
new SenderAlive = is_user_alive(id) if (SenderAlive == is_user_alive(tempPlayer))
I should have looked at whole plugin rather this small snippet of code. From that piece I thought it gets called only once. Which in false. Keep doing what you were and do the same thing with cs_get_user_team(id)
__________________
retired chump
DjSoftero is offline
Koneuka
Junior Member
Join Date: Nov 2017
Old 12-08-2017 , 08:20   Re: HUD Team Chat
Reply With Quote #16

Quote:
Originally Posted by DjSoftero View Post
i see some crap is going on there.

I should have looked at whole plugin rather this small snippet of code. From that piece I thought it gets called only once. Which in false. Keep doing what you were and do the same thing with cs_get_user_team(id)
Doing exactly same for cs_get_user_team(id) like for is_user_alive(id) and getting tag mismatch

Code:
new SenderTeam = cs_get_user_team(id)
SenderTeam == cs_get_user_team(tempPlayer)
Koneuka is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-08-2017 , 08:22   Re: HUD Team Chat
Reply With Quote #17

new CsTeams:SenderTeam
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
blanko
Senior Member
Join Date: Aug 2008
Old 01-13-2018 , 01:48   Re: HUD Team Chat
Reply With Quote #18

Plugin failed to compile! Please try contacting the author.
__________________
blanko is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-13-2018 , 07:46   Re: HUD Team Chat
Reply With Quote #19

Compile it locally on your computer. Many of the new plugins can't be compiled with the built-in ancient compiler this site has.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-13-2020 , 08:27   Re: HUD Team Chat
Reply With Quote #20

Unapproved: most of the code is made by other people, plugin is too simple.
__________________
HamletEagle is offline
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 04:14.


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