Hello,
I would need to edit this code (plugin for TF2) and add to code critical hits only for the red team. And farther so that the plugin (command sm_crits) worked for all players.
Thank you very much for your help.
PHP Code:
#include <tf2>
#include <tf2_stocks>
new bool:CritsEnabled[MAXPLAYERS+1] = false;
public OnPluginStart()
{
RegAdminCmd("sm_crits",Command_Crits, ADMFLAG_GENERIC);
HookEvent("player_spawn", Event_PlayerSpawn);
}
public OnClientPutInServer(client) CritsEnabled[client] = false;
public Action:Command_Crits(client,args)
{
if(CritsEnabled[client])
{
CritsEnabled[client] = false;
if(IsPlayerAlive(client)) TF2_RemoveCondition(client, TFCond_CritOnWin);
PrintToChat(client, "\x04Crits Disabled");
return Plugin_Handled;
}
else
{
CritsEnabled[client] = true;
if(IsPlayerAlive(client)) TF2_AddCondition(client, TFCond_CritOnWin, -1.0);
PrintToChat(client, "\x04Crits Enabled");
return Plugin_Handled;
}
}
public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(CritsEnabled[client]) TF2_AddCondition(client, TFCond_CritOnWin, -1.0);
}