Raised This Month: $32 Target: $400
 8% 

Q about get_players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Guest
Old 07-14-2005 , 19:51   Q about get_players
Reply With Quote #1

Quote:
Originally Posted by http://www.amxmodx.org/doc/
Syntax
get_players ( players[32], &num, const flags = "", const team = "" )

Notes
If specified, you can constrain which players are returned by flags:
"a" - Don't return dead players
"b" - Don't return alive players
"c" - Skip bots
"d" - Skip real players
"e" - Match with passed team
"f" - Match with part of name
"g" - Ignore case sensitivity
If i would want to get only team 3 (spectators) members that are not bots, it would look something like this:
Code:
get_players(<name of the variable where the id's go [index number/variable]>, <variable name for number of players>, "be", "3")
...right?
VanillA Ice
Senior Member
Join Date: Apr 2005
Old 07-14-2005 , 20:21  
Reply With Quote #2

no..... you would use a for statement to randomly choose 3 players...

i have it somewhere...let me look
__________________
I can no longer help here......school has started... :/ goodbye everybody :'(
VanillA Ice is offline
Send a message via MSN to VanillA Ice Send a message via Yahoo to VanillA Ice
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 07-14-2005 , 20:24  
Reply With Quote #3

Try this ( command: amx_specs ):
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> public plugin_init() {     register_plugin("Count Specs","0.1","v3x")     register_clcmd("amx_specs","CountSpecs",ADMIN_KICK) } new g_iSpecs public CountSpecs(id,level,cid) {     if ( !cmd_access(id,level,cid,1) )     {         return PLUGIN_HANDLED     }     g_iSpecs = 0     new aPlayers[32],iNum,i     get_players(aPlayers,iNum,"bc")     for( i = 0; i <= iNum; i++)     {         if ( !is_user_connected( aPlayers[i] ) ) continue         new CsTeams:szTeam = cs_get_user_team( aPlayers[i] )         if ( szTeam == CS_TEAM_SPECTATOR )         {             g_iSpecs++         }     }     client_print( id,print_chat,"[AMXX] %i spectators in server",g_iSpecs )     set_task(1.0,"SayNames")     return PLUGIN_HANDLED } public SayNames() {     new aPlayers[32],szUsername[32],iNum,i     get_players(aPlayers,iNum,"bc")     for( i = 0; i <= iNum; i++)     {         if ( !is_user_connected( aPlayers[i] ) ) continue         new CsTeams:szTeam = cs_get_user_team( aPlayers[i] )         if ( szTeam == CS_TEAM_SPECTATOR )         {             get_user_name( aPlayers[i],szUsername,31)             client_print(0,print_chat,"%s is a spec",szUsername)         }     }     return PLUGIN_HANDLED }
Just something I pulled out of the top of my head..
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
VanillA Ice
Senior Member
Join Date: Apr 2005
Old 07-14-2005 , 20:37  
Reply With Quote #4

cuz your head is any empty hole only jk
__________________
I can no longer help here......school has started... :/ goodbye everybody :'(
VanillA Ice is offline
Send a message via MSN to VanillA Ice Send a message via Yahoo to VanillA Ice
Guest
Old 07-15-2005 , 04:15  
Reply With Quote #5

well what does the const team = " " & "e" - Match with passed team , mean then?

It just looks like to me that with get_players(Players, 32, "be", "3") my player variable would be filled with non-bots that are in team 3 (=spectators)


If not, then i go with
Code:
if (cs_get_user_team(aPlayers[i]) == CS_TEAM_SPECTATOR)     {     /* DO EVIL THINGYS */     }
Reply



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:02.


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