This should be the start to help you it's a method from my plugin to list online VIPs, this is to go directly to a menu but it shouldn't be much harder if you have knowledge to tweak this to go to chat.
Code:
public Action cmdListOnlineVips(int client, int args)
{
if (client)
{
char buffer[MAX_NAME_LENGTH];
Menu vipList = CreateMenu(noMenuHandler);
SetMenuTitle(vipList, ">>> Online VIPs <<<");
for (int i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i))
{
if (CheckCommandAccess(i, "", ADMFLAG_CUSTOM6))
{
Format(buffer, sizeof(buffer), "%N", i);
AddMenuItem(vipList, "", buffer);
}
}
}
if (GetMenuItemCount(vipList) > 0)
{
DisplayMenu(vipList, client, 30);
}
else
{
AddMenuItem(vipList, "", "No vips are currently online.");
DisplayMenu(vipList, client, 30);
}
}
return Plugin_Handled;
}