Quote:
Originally Posted by Chaosxk
Okay, a little lazy to try and fix what's wrong so here is another one that is less efficient and uses a repeating timer to get the count of alive red players every 0.5 seconds.
Code:
#pragma semicolon 1
#define PLUGIN_AUTHOR "Tak (Chaosxk)"
#define PLUGIN_VERSION "1.0"
#include <sourcemod>
#include <tf2_stocks>
#pragma newdecls required
public Plugin myinfo =
{
name = "[TF2] One man standing ~ Crits",
author = PLUGIN_AUTHOR,
description = "1 man on red = Crits",
version = PLUGIN_VERSION,
url = "https://forums.alliedmods.net/showthread.php?t=290409"
};
public void OnPluginStart()
{
CreateTimer(0.5, Timer_GetCount, _, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
}
public Action Timer_GetCount(Handle hTimer)
{
int count, client;
for (int i = 1; i <= MaxClients; i++)
{
if (!IsClientInGame(i) || !IsPlayerAlive(i) || TF2_GetClientTeam(i) != TFTeam_Red)
continue;
client = i;
count++;
}
if (count == 1)
{
TF2_AddCondition(client, TFCond_Kritzkrieged, TFCondDuration_Infinite);
}
}
|
Tested it, still, doesn't work. I'm using
this plugin. I know it's unapproved, but is the only one that works with other plugins I'm using. Plus it isn't unapproved for a bad reason, just that it doesn't the same thing as another plugin wich doesn't work for me.
__________________