AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to get the names of the players terrorists? (https://forums.alliedmods.net/showthread.php?t=117775)

lucas_7_94 02-04-2010 14:20

How to get the names of the players terrorists?
 
How to get the names of the players terrorists?

01101101 02-04-2010 14:20

Re: How to get the names of the players terrorists?
 
get_user_name

lucas_7_94 02-04-2010 14:24

Re: How to get the names of the players terrorists?
 
I already know, but I just want to get the names of players who are playing terrorists.

PD:
It's a internal funcion
Code:
gettts() { static iTs, id iTs = 0   for (id = 1; id <= g_maxplayers; id++) { if (is_user_connected(id)) { if (fm_get_user_team(id) == CS_TEAM_T) iTs++ } }   return iTs; }

but this return in number.

01101101 02-04-2010 14:29

Re: How to get the names of the players terrorists?
 
In that loop get the name and store it in an array.

Like get_user_name(id, names[iTs++], 31)

Exolent[jNr] 02-04-2010 15:44

Re: How to get the names of the players terrorists?
 
http://www.amxmodx.org/funcwiki.php?go=func&id=174

Counter-Strike team names:
  1. "UNASSIGNED"
  2. "TERRORIST"
  3. "CT"
  4. "SPECTATOR"

Bugsy 02-04-2010 16:37

Re: How to get the names of the players terrorists?
 
untested
Code:
new szNames[ 32 ][ 33 ]; new iNum = gettts( szNames ); gettts( arrPlayers[][] ) {      static iTs, id      iTs = 0        for (id = 1; id <= g_maxplayers; id++)      {           if (is_user_connected(id))           {                if (fm_get_user_team(id) == CS_TEAM_T)                {                     get_user_name( id , arrPlayers[ iTs++ ] , 32 );                }           }      }      return iTs; }

01101101 02-04-2010 16:56

Re: How to get the names of the players terrorists?
 
(I know you used it because he used it)

But why using fm_get_user_team instead of cs_get_user_team which is much faster?

lucas_7_94 02-04-2010 17:40

Re: How to get the names of the players terrorists?
 
Thanks Exolent & Bugsy !

Now Testing!

Quote:

Originally Posted by 01101101 (Post 1078522)
(I know you used it because he used it)

But why using fm_get_user_team instead of cs_get_user_team which is much faster?

If you say to me, I only copy and paste the function of the Zombie Plague.



PD : Bugsy not found D:


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

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