Here you go,
I did not tested it yet, but it should be working.
PHP Code:
#include <sourcemod>
#pragma semicolon 1
#pragma newdecls required
public Plugin myinfo = {
name = "Simple Report",
author = "Tair",
description = "Simple plugin that enable you to report on other players in the server",
version = "1.0",
url = ""
};
public void OnPluginStart()
{
RegConsoleCmd("sm_report" , Cmd_Report);
}
public Action Cmd_Report(int client, int args)
{
Handle menu = CreateMenu(ReportMenuHandler);
SetMenuTitle(menu, "Choose a player:");
for (int i = 1; i <= MaxClients; i++)
{
if (!IsValidClient(i)) continue;
char sID[4], sName[16];
GetClientName(i, sName, sizeof(sName));
Format(sID, sizeof(sID), "%d", i);
AddMenuItem(menu, sID, sName);
}
SetMenuExitButton(menu, true);
if (GetMenuItemCount(menu) > 0)
{
DisplayMenu(menu, client, 60);
}
else
{
AddMenuItem(menu, "", "No players are currently online.");
DisplayMenu(menu, client, 30);
}
return Plugin_Handled;
}
public int ReportMenuHandler(Handle menu, MenuAction action, int client, int itemNum)
{
if (action == MenuAction_Select)
{
char sInfo[32];
GetMenuItem(menu, itemNum, sInfo, sizeof(sInfo));
for (int i = 1; i <= MaxClients; i++)
{
if (!IsValidClient(i) && (StringToInt(sInfo) != i)) continue;
for (int j = 1; j <= MaxClients; j++)
{
if (IsValidClient(j))
{
if (CheckCommandAccess(j, "", ADMFLAG_GENERIC))
{
PrintToChat(j, " \x04[SM] \x01The player \x04%N \x01reported on the player \x04%N\x01.", client, i);
}
}
}
PrintToChat(client, " \x04[SM] \x01Your report about (\x04%N\x01) was sent to admin staff.", i);
return;
}
}
if (action == MenuAction_End)
{
CloseHandle(menu);
}
}
stock bool IsValidClient(int client)
{
if (client <= 0 || client > MaxClients || !IsClientConnected(client) || (IsFakeClient(client)))
{
return false;
}
return IsClientInGame(client);
}