forked from Franc1sco/sm-zombiereloaded-3-Franug-Edition
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zr_forceteams.sp
42 lines (33 loc) · 925 Bytes
/
zr_forceteams.sp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <zombiereloaded>
#include <cstrike>
new bool:started;
public Plugin:myinfo =
{
name = "SM ZR Force Teams",
author = "Franc1sco franug",
description = "",
version = "1.1",
url = "http://steamcommunity.com/id/franug"
};
public OnPluginStart()
{
HookEvent("player_spawn", OnSpawn);
HookEvent("round_start", EventRoundStart, EventHookMode_Pre);
}
public Action:OnSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
if(started) return;
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(GetClientTeam(client) == CS_TEAM_T) CS_SwitchTeam(client, CS_TEAM_CT);
}
public Action:EventRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
started = false;
}
public Action:ZR_OnClientInfect(&client, &attacker, &bool:motherInfect, &bool:respawnOverride, &bool:respawn)
{
if(!started) started = true;
}