Quote:
Originally Posted by malec321
Hello!
Is there anyone that can either point me in the right direction or maybe help me out?
I'm looking for a plugin that does the following:
When CT's win, swap teams completely (everyone in CT gets swapped to T, and everyone that's in T gets swapped to CT)
When T's win, do nothing and leave teams as is.
I've tried to search and was unable to find anything that does this
|
Try this...
PHP Code:
#pragma semicolon 1
#define DEBUG
#define PLUGIN_AUTHOR "Rowdy"
#define PLUGIN_VERSION "1.00"
#include <sourcemod>
#include <sdktools>
#pragma newdecls required
public Plugin myinfo =
{
name = "SwapTeams?",
author = PLUGIN_AUTHOR,
description = "...",
version = PLUGIN_VERSION,
url = "https://steamcommunity.com/profiles/76561198307962930"
};
public void OnPluginStart()
{
HookEvent("round_end", OnRoundEnd);
}
public void OnRoundEnd(Handle event, char[] name, bool dontBroadcast) {
int winner = GetEventInt(event, "winner");
if (winner == 3) {
for (int i = 1; i <= MaxClients; i++) {
if (GetClientTeam(i) == 2) {
ChangeClientTeam(i, 3);
} else if (GetClientTeam(i) == 3) {
ChangeClientTeam(i, 2);
}
}
}
}