Raised This Month: $ Target: $400
 0% 

[SOLVED]Enum players


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-24-2007 , 13:19   Re: Enum players
Reply With Quote #4

Because 'static' on lstUserName is using, I think.

Try to put : lstUserName[0] = '^0'; to reset this array.

Code:
#include <amxmodx> #define PLUGIN  "Steam players" #define VERSION "1.0" #define AUTHOR  "Alka" new showsteamplayers; public plugin_init() {     register_plugin( PLUGIN, VERSION, AUTHOR );     register_clcmd( "say /steamppl", "Cmd_Steamppl" );         showsteamplayers = register_cvar( "amx_showsteamplayers", "1" ); } public Cmd_Steamppl( id ) {     if( !get_pcvar_num( showsteamplayers ) )         return PLUGIN_HANDLED;         new pid, iNum, count;     static iPlayers[32], userName[32], authid[12], lstUserName[192];         lstUserName[0] = '^0';         get_players( iPlayers, iNum );         for( new i = 0; i < iNum; i++ )     {         pid = iPlayers[i];                 get_user_authid( pid, authid, 11 );                 if( authid[8] == '1' || authid[8] == '0' /*||  authid[6] == 'N'*/)  // "STEAM_0:1" or "STEAM_0:0"         {             get_user_name( pid, userName, 31 );                         // -- 'Myname'  become  'Myname, ' or 'Myname.' if end.             format( userName, 31, "%s%s", userName, i < iNum - 1 ? ", " : "" );                         // -- Concatenates string. Ie : 'Myname1, Myname2'             strcat( lstUserName, userName, 191 );                         count++;         }     }         client_print( id, print_chat, "On server %s %d player%s with STEAM!", count == 1 ? "is" : "are", count, count == 1 ? "" : "s");         if( count > 0 )         client_print( id, print_chat, "Full list: %s", lstUserName );         return PLUGIN_HANDLED; }
__________________
Arkshine is offline
 



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 06:37.


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