Raised This Month: $ Target: $400
 0% 

All players name problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 09-04-2008 , 12:42   All players name problem
Reply With Quote #1

PHP Code:
new 
    
tplayers[32],ctplayers[32],tname[32],ctname[32],
    
tnum,ctnum,tindex,ctindex,i,j;
    new 
tNames[1024],ctNames[1024];
    
get_players(tplayers,tnum,"he","TERRORIST");
    
get_players(ctplayers,ctnum,"he","CT");
    for(
0;tnum;i++)
    {
        
tindex tplayers[i];
        if(!
is_user_connected(tindex))
            continue;
        
get_user_name(tindex,tname,31);    
        if(
strlen(tNames) > 0)
            
format(tNames1023"%s,%s"tNamestname);
        else
            
copy(tNames1023tname);    
    }
    for(
0;ctnum;j++)
    {
        
ctindex ctplayers[j];
        if(!
is_user_connected(tindex))
            continue;
        
get_user_name(ctindex,ctname,31);
        if(
strlen(ctNames) > 0)
            
format(ctNames1023"%s,%s"ctNamesctname);
        else
            
copy(ctNames1023ctname);    
    }
    
console_print(id,"%s ; %s",tNames,ctNames); 
It shows:
Code:
;
__________________

anakin_cstrike is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 09-04-2008 , 16:30   Re: All players name problem
Reply With Quote #2

What are you trying to do? I'm confused.
__________________
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
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 09-04-2008 , 16:47   Re: All players name problem
Reply With Quote #3

Quote:
Originally Posted by v3x View Post
What are you trying to do? I'm confused.
I think his trying to list ts/ct player names -->
Code:
Ct players:
name1,
name2,
name3
...
[X]-RayCat is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-04-2008 , 16:48   Re: All players name problem
Reply With Quote #4

Trying to get all player names and printing to admin's console.

Code:
enum {     TEAM_NONE,     TEAM_T,     TEAM_CT,     TEAM_SPEC,         MAX_TEAMS }; #define OFFSET_TEAM 114 #define fm_get_user_team(%1) get_pdata_int(%1, OFFSET_TEAM) new g_max_clients; public plugin_init() {     // ...     g_max_clients = get_maxplayers(); } // ... new name[32], team, all_names[MAX_TEAMS][sizeof(name) * 32]; // 32 player names for( new i = 1; i <= g_max_clients; i++ ) {     if( !is_user_connected(i) )     {         continue;     }         team = fm_get_user_team(i);     if( team != TEAM_T && team != TEAM_CT )     {         continue;     }         get_user_name(i, name, sizeof(name) - 1);     if( all_names[team][0] )     {         format(all_names[team], sizeof(all_names[]) - 1, "%s, %s", all_names[team], name);     }     else     {         copy(all_names[team], sizeof(all_names[]) - 1, name);     } } console_print(client, "%s ; %s", all_names[TEAM_T], all_names[TEAM_CT]);
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 09-06-2008 at 13:58.
Exolent[jNr] is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 09-06-2008 , 08:55   Re: All players name problem
Reply With Quote #5

Well:
[IMG]http://img169.**************/img169/8122/ssus0.th.jpg[/IMG]
Can you fix it please?
__________________


Last edited by anakin_cstrike; 09-06-2008 at 10:57.
anakin_cstrike is offline
Old 09-06-2008, 12:24
hleV
This message has been deleted by Exolent[jNr]. Reason: Irrelevant to thread
Old 09-06-2008, 12:56
zwfgdlc
This message has been deleted by Exolent[jNr]. Reason: Irrelevant to thread
Old 09-06-2008, 12:56
[X]-RayCat
This message has been deleted by Exolent[jNr]. Reason: Irrelevant to thread
Old 09-06-2008, 13:24
hleV
This message has been deleted by Exolent[jNr]. Reason: Irrelevant to thread
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 09-06-2008 , 13:24   Re: All players name problem
Reply With Quote #6

Lol...hleV..you've said that twice...however...forget my videocard...and yes, it doesn't suport opengl...happy ?
Now,, can anybody help me please ?
__________________

anakin_cstrike is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-06-2008 , 13:53   Re: All players name problem
Reply With Quote #7

Show me your full code.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 09-06-2008 , 13:54   Re: All players name problem
Reply With Quote #8

If i'm blind, sorry.
PHP Code:
enum
{
    
TEAM_NONE,
    
TEAM_T,
    
TEAM_CT,
    
TEAM_SPEC,
    
MAX_TEAMS
};
new 
g_max_clients;
// ...
register_concmd("amx_teams","teams_cmd");
g_max_clients get_maxplayers();
// etc..

public teams_cmd(id)
{
    new 
name[32], teamall_names[MAX_TEAMS][sizeof(name) * 32];
    for(new 
1;<= g_max_clients;i++)
    {
        if(!
is_user_connected(i))
            continue;
    
        
team fm_get_user_team(i);
        if(
team != TEAM_T && team != TEAM_CT)
            continue;
    
        
get_user_name(i,name,sizeof(name) - 1);
        if(
all_names[team][0])
            
format(all_names[team], sizeof(all_names[]) - 1"%s, %s"all_namesname);
        else
            
copy(all_names[team], sizeof(all_names[]) - 1name);
    }

    
console_print(id"TS: %s ; CT: %s"all_names[TEAM_T], all_names[TEAM_CT]);
    
client_print(id,print_chat,"TS: %s ; CT: %s"all_names[TEAM_T], all_names[TEAM_CT]);
    return 
PLUGIN_HANDLED;

__________________

anakin_cstrike is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-06-2008 , 13:59   Re: All players name problem
Reply With Quote #9

The problem was with my code. Look at my post and you will see what I did wrong.
But, you won't see it with my code, cause I already fixed it.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 09-06-2008 , 14:24   Re: All players name problem
Reply With Quote #10

Oh....so that was the only problem ?
__________________

anakin_cstrike 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 03:15.


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