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

Doubt, one player from each team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FeehSK
Junior Member
Join Date: Jul 2019
Location: MT - BRAZIL.
Old 07-20-2019 , 17:42   Doubt, one player from each team
Reply With Quote #1

I wanted to know if this code is correct to get a player's name from each team.

if (cs_get_user_team (ibestplayerT) == CS_TEAM_T)
{
get_user_name (ibestplayerT, xPlayerNameT, 31)
}

if (cs_get_user_team (ibestplayerCT) == CS_TEAM_CT)
{
get_user_name (ibestplayerCT, xPlayerNameCT, 31)
}
FeehSK is offline
Send a message via Skype™ to FeehSK
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-20-2019 , 17:45   Re: Doubt, one player from each team
Reply With Quote #2

Why don't you test by yourself.

And also don't post multiple threads with the same topic.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
thEsp
BANNED
Join Date: Aug 2017
Old 07-20-2019 , 17:54   Re: Doubt, one player from each team
Reply With Quote #3

Use get_players native, it's better if you loop throughout a certain team.
https://forums.alliedmods.net/showthread.php?t=129484
thEsp is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-20-2019 , 22:04   Re: Doubt, one player from each team
Reply With Quote #4

That will work fine assuming ibestPlayerT and ibestplayerCT contain valid/connected player ID's on the applicable team. If this is the case, you do not even need to check their team since this has already been established. Another recommendation is to use charsmax( xPlayerNameT/CT ) instead of 31.

Better off showing actual code so we can provide the best method.
__________________

Last edited by Bugsy; 07-20-2019 at 22:05.
Bugsy 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 10:36.


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