Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

WHich Mod To Allow Only 1 Team to Play
#2

Code:
#include <sourcemod>
#include <sdktools>
#include <tf2_stocks>
#include <tf2>

new iTeamIndex = 3; // 2

public OnPluginStart()
    HookEvent("player_spawn", OnPlayerSpawn);

public Action:OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new client = GetClientOfUserId(GetEventInt(event, "userid"));

    if(!IsPlayerAlive(client))
        return;

    if(GetClientTeam(client) != iTeamIndex)
    {
        SetEntProp(client, Prop_Send, "m_lifeState", 2);
        ChangeClientTeam(client, iTeamIndex);
        SetEntProp(client, Prop_Send, "m_lifeState", 0);
    }

    if(TF2_GetPlayerClass(client) != TFClass_Soldier)
    {
        TF2_SetPlayerClass(client, TFClass_Soldier, false);
        TF2_RegeneratePlayer(client);
    }
}
Reply


Messages In This Thread
WHich Mod To Allow Only 1 Team to Play - by ScorpionBlues - Mar 11, 2012, 06:19 AM
WHich Mod To Allow Only 1 Team to Play - by 1NHI - Mar 23, 2012, 11:06 AM
WHich Mod To Allow Only 1 Team to Play - by Skyrider - Apr 10, 2012, 10:58 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)