public override void OnPlayerIsAlive(string soldierName, bool isAlive)
{
if (!fIsEnabled) return;
DebugWrite("^9^bGot OnPlayerIsAlive^n: " + soldierName + " " + isAlive, 7);
try {
if (fPluginState != PluginState.Active) return;
/*
This may be the return leg of the round-trip to insure that
an admin move event, if any, has been processed. If the player's
name is still in fPendingTeamChange, it's a real player instigated move
*/
if (fPendingTeamChange.ContainsKey(soldierName)) {
int team = fPendingTeamChange[soldierName];
fPendingTeamChange.Remove(soldierName);
// Check if player is allowed to switch teams
// Unswitch is handled in CheckTeamSwitch
// Unswitch is skipped if disabled by remote
if (!fDisableUnswitcherByRemote) {
if (CheckTeamSwitch(soldierName, team)) {
UpdatePlayerTeam(soldierName, team);
UpdateTeams();
IncrementTotal(); // No matching stat, reflects allowed team switches
}
} else {
DebugWrite("^nSkipped check for unswitch for ^b" + soldierName + "^n: ^8another plugin DISABLED the Unswitcher!", 4);
}
}
} catch (Exception e) {
ConsoleException(e);
}
}