/* This plugin just gives you some playerinfo, hopefully nicely formatted. */
 
/* $Id: plugin_playerinfo.sma,v 1.0 2001/20/04 yensid $ */
 
/* Made steam compatible [WING] Black Knight */
 
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
 
new STRING_VERSION[MAX_DATA_LENGTH] = "2.50.0";
 
public admin_playerinfo(HLCommand,HLData,HLUserName,UserIndex) {
	new Command[MAX_COMMAND_LENGTH];
	new Data[MAX_DATA_LENGTH];
	new User[MAX_NAME_LENGTH];
	new i;
	new MaxPlayers;
	new Name[MAX_NAME_LENGTH];
	new Result;
	new SessionID;
	new Team;
	new Dead;
	new Text[MAX_TEXT_LENGTH];
	new WONID;
	new sAuthID[MAX_AUTHID_LENGTH];
 
	convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
	convert_string(HLData,Data,MAX_DATA_LENGTH);
	convert_string(HLUserName,User,MAX_NAME_LENGTH);
 
	MaxPlayers = maxplayercount();
	selfmessage("--- Player Info ---");
	selfmessage("PlayerID: Name SessionID AuthID Team Dead");
	for(i = 1; i <= MaxPlayers; i++) {
		Result = playerinfo(i,Name,MAX_NAME_LENGTH,SessionID,WONID,Team,Dead,sAuthID);
		if (Result==1) {
			snprintf(Text, MAX_TEXT_LENGTH, "Player #%i: %s %i %s %i %i",i,Name,SessionID,sAuthID,Team, Dead);
			selfmessage(Text);
		}
	}
	selfmessage("-------------------");
}
 
public plugin_init() {
	plugin_registerinfo("playerinfo plugin","Gives player info.",STRING_VERSION);
	plugin_registercmd("admin_playerinfo","admin_playerinfo",ACCESS_USERLIST,"admin_playerinfo : Returns a list of players and info about them.");
 
	return PLUGIN_CONTINUE;
}