mirror of
https://github.com/XLabsProject/s1x-client.git
synced 2023-08-02 15:02:12 +02:00
fix(gsc): team balance (#515)
This commit is contained in:
parent
ad371d351a
commit
15c31e6cec
23
data/scripts/_team_balance.gsc
Normal file
23
data/scripts/_team_balance.gsc
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
init()
|
||||||
|
{
|
||||||
|
// define onteamselection callback function used in balanceteams()
|
||||||
|
level.onteamselection = ::set_team;
|
||||||
|
}
|
||||||
|
|
||||||
|
set_team(team)
|
||||||
|
{
|
||||||
|
if (team != self.pers["team"])
|
||||||
|
{
|
||||||
|
self.switching_teams = true;
|
||||||
|
self.joining_team = team;
|
||||||
|
self.leaving_team = self.pers["team"];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (self.sessionstate == "playing")
|
||||||
|
{
|
||||||
|
self suicide();
|
||||||
|
}
|
||||||
|
|
||||||
|
maps\mp\gametypes\_menus::addtoteam(team);
|
||||||
|
maps\mp\gametypes\_menus::endrespawnnotify();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user