sm-plugins/specchat.sp

34 lines
714 B
SourcePawn

/* Plugin Template generated by Pawn Studio */
#include <sourcemod>
#include <tf2>
public Plugin:myinfo =
{
name = "SpecChat",
author = "Chefe",
description = "<- Description ->",
version = "1.0",
url = "<- URL ->"
}
public OnPluginStart()
{
HookEvent("player_chat", Event_PlayerChat, EventHookMode_Pre);
}
public Action:Event_PlayerChat(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (GetClientTeam(client) == _:TFTeam_Spectator)
{
new String:saidtext[255];
GetEventString(event, "text", saidtext, sizeof(saidtext));
PrintToChatAll("(SPEC) %s", saidtext);
return Plugin_Handled;
}
return Plugin_Continue;
}