View Single Post
shauli
Member
Join Date: Jun 2018
Old 02-06-2019 , 13:14   Re: motd prints all playing players in rows
Reply With Quote #15

Quote:
Originally Posted by TheBladerX View Post
None of these you all sent worked properly. Unfortunately, I do not use amxmodx 1.9, however I still have 1.8.2.

edit:
sorry, this one worked.

Thanks.
This one has many problems. It's probably works fine when you test it alone but no way it will work when your server is full. It doesn't check all players.

You should use the one eat1k posted. Try this in 1.8.2:
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define MAX_MOTD_LENGTH 1536
#define MAX_PLAYERS 32
#define MAX_NAME_LENGTH 32

public plugin_init()
{
    
register_clcmd("say /hraci""player_skills");
}

public 
player_skills(id)
{
    new 
szMessage[MAX_MOTD_LENGTH], iLen;
    
    
iLen formatex(szMessagecharsmax(szMessage), "<HTML><head></head><body bgcolor=#000000><font color=#FFB000>");
    
    new 
iPlayers[MAX_PLAYERS], iPlayerCountszName[MAX_NAME_LENGTH];
    
get_players(iPlayersiPlayerCount"ch");
    
    for(new 
iiPlayerCounti++)
    {
        
get_user_name(iPlayers[i], szNamecharsmax(szName));
        
iLen += formatex(szMessage[iLen], charsmax(szMessage) - iLen"%s<br>"szName);
    }
    
    
show_motd(idszMessage"Info players");
    return 
PLUGIN_HANDLED;

shauli is offline