AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Doubt, one player from each team (https://forums.alliedmods.net/showthread.php?t=317593)

FeehSK 07-20-2019 17:42

Doubt, one player from each team
 
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)
}

Natsheh 07-20-2019 17:45

Re: Doubt, one player from each team
 
Why don't you test by yourself.

And also don't post multiple threads with the same topic.

thEsp 07-20-2019 17:54

Re: Doubt, one player from each team
 
Use get_players native, it's better if you loop throughout a certain team.
https://forums.alliedmods.net/showthread.php?t=129484

Bugsy 07-20-2019 22:04

Re: Doubt, one player from each team
 
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.


All times are GMT -4. The time now is 19:41.

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