PHP Code:
#include <sourcemod>
#pragma newdecls required
#pragma semicolon 1
bool gB_Allow[MAXPLAYERS + 1];
public void OnPluginStart()
{
HookEvent("player_death", Event_PlayerDeath, EventHookMode_Post);
AddCommandListener(CL_Radio, "coverme");
AddCommandListener(CL_Radio, "takepoint");
AddCommandListener(CL_Radio, "holdpos");
AddCommandListener(CL_Radio, "regroup");
AddCommandListener(CL_Radio, "followme");
AddCommandListener(CL_Radio, "takingfire");
AddCommandListener(CL_Radio, "cheer");
AddCommandListener(CL_Radio, "thanks");
AddCommandListener(CL_Radio, "go");
AddCommandListener(CL_Radio, "fallback");
AddCommandListener(CL_Radio, "sticktog");
AddCommandListener(CL_Radio, "getinpos");
AddCommandListener(CL_Radio, "stormfront");
AddCommandListener(CL_Radio, "report");
AddCommandListener(CL_Radio, "roger");
AddCommandListener(CL_Radio, "enemyspot");
AddCommandListener(CL_Radio, "needbackup");
AddCommandListener(CL_Radio, "sectorclear");
AddCommandListener(CL_Radio, "inposition");
AddCommandListener(CL_Radio, "reportingin");
AddCommandListener(CL_Radio, "getout");
AddCommandListener(CL_Radio, "negative");
AddCommandListener(CL_Radio, "enemydown");
}
public void OnClientPostAdminCheck(int client) {
gB_Allow[client] = false;
}
public Action CL_Radio(int client, const char[] sCmd, int args)
{
if (0 < client <= MaxClients && gB_Allow[client])
{
gB_Allow[client] = false;
return Plugin_Continue;
}
return Plugin_Handled;
}
public void Event_PlayerDeath(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
int attacker = GetClientOfUserId(hEvent.GetInt("attacker"));
if (hEvent.GetInt("userid") != attacker && 0 < attacker <= MaxClients && IsClientInGame(attacker))
{
gB_Allow[attacker] = true;
FakeClientCommandEx(attacker, "enemydown");
}
}
Untested
__________________