Raised This Month: $ Target: $400
 0% 

Get all name from a players.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 03-09-2010 , 09:46   Get all name from a players.
Reply With Quote #1

PHP Code:

public plugin_init()
{
    
g_maxplayers get_maxplayers()
    
set_task1.0"test"___"b" )
}

public 
test()
{
    new 
count
    
    
for( new 1<= g_maxplayersi++ ) 
    {
        if( !
is_user_alive] || !cs_get_user_team] != CS_TEAM_T )
            continue
        
        
count++
        new 
name32 ]
        
get_user_nameiname31 )
        
        
set_hudmessage255000.00.1506.012.0 )
        
show_hudmessage0"Ts players:^n%d. %s^n"countname )
    }

What the problem ?
dFF is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 03-09-2010 , 13:06   Re: Get all name from a players.
Reply With Quote #2

PHP Code:
if ( !is_user_alive ] || !cs_get_user_team ] != CS_TEAM_T 
Change it to:
PHP Code:
if ( !is_user_alive ) || !cs_get_user_team ) != CS_TEAM_T 
You are obtaining the name of all alive CT players and the hudmessage will show
Code:
Ts players: 
[Player ID -1]. [Name of player ID]
If you want to show the ID's and names of TT players change:
[php]
if ( !is_user_alive ( i ) || !cs_get_user_team ( i ) != CS_TEAM_T )
[php]
to:
PHP Code:
if ( !is_user_alive ) || cs_get_user_team ) != CS_TEAM_T 
Mxnn is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 03-09-2010 , 13:37   Re: Get all name from a players.
Reply With Quote #3

untest:

PHP Code:
#include < amxmodx >
#include < cstrike >

#pragma ctrlchar '\'

new g_iMaxPlayers;

public 
plugin_init()
{
    
g_iMaxPlayers get_maxplayers();
    
set_task1.0"test"___"b" );
}

public 
test()
{
    new 
count;
    static 
bigstring[512];
    
    
formatex(bigstring511"Ts Players:\n");
    
    for( new 
1<= g_iMaxPlayersi++ ) 
    {
        if( !
is_user_alive(i) || cs_get_user_team(i) != CS_TEAM_T )
            continue;
        
        
count++
        new 
name32 ];
        
get_user_nameiname31 );
        
        
format(bigstring511"%s%d. %s\n"bigstringcountname);        
    }
    
    
set_hudmessage255000.00.1506.012.0 );
    
show_hudmessage0"%s"bigstring);

__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-09-2010 , 13:51   Re: Get all name from a players.
Reply With Quote #4

Edit: tested and working

PHP Code:
#include < amxmodx >
#include < cstrike >

#pragma ctrlchar '\'

new g_iMaxPlayers;

public 
plugin_init()
{
    
g_iMaxPlayers get_maxplayers();
    
set_task1.0"test"___"b" );
}

public 
test()
{
    new 
count iPos;
    static 
bigstring[512] , name33 ];

    
iPos formatex(bigstring511"Ts Players:\n");
    
    for( new 
1<= g_iMaxPlayersi++ ) 
    {
        if( !
is_user_alive(i) || cs_get_user_team(i) != CS_TEAM_T )
            continue;

        
get_user_nameiname32 );
        
        
iPos += formatex(bigstringiPos ] , 511-iPos"%d. %s\n", ++countname);        
    }
    
    
set_hudmessage255000.00.1506.012.0 );
    
show_hudmessage0bigstring );

__________________

Last edited by Bugsy; 03-09-2010 at 19:58.
Bugsy is offline
Old 03-09-2010, 13:59
worldspawn
This message has been deleted by worldspawn. Reason: joke
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 03-09-2010 , 17:17   Re: Get all name from a players.
Reply With Quote #5

Quote:
Originally Posted by worldspawn View Post
you can type +showscores in console and see the names of all players
he want ahother think, read plis
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 03-10-2010 , 09:00   Re: Get all name from a players.
Reply With Quote #6

Many thanks guys ;)
dFF is offline
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 08:48.


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