autoassign_team 1.0.0

This commit is contained in:
Resxt 2023-02-15 16:11:18 +01:00
parent c994eb4756
commit 6096379e3e
2 changed files with 35 additions and 0 deletions

View File

@ -6,6 +6,10 @@ Simple drag and drop scripts
Prevent players from hardscoping
## autoassign_team.gsc
Whenever a player connects directly autoassign him to a team, skipping the team selection menu
## change_team_names.gsc
Change the team names to custom names depending on the game mode

View File

@ -0,0 +1,31 @@
Init()
{
InitTest();
}
InitTest()
{
replacefunc(maps\mp\_utility::allowTeamChoice, ::ReplaceAllowTeamChoice);
level thread OnPlayerConnect();
}
OnPlayerConnect()
{
for(;;)
{
level waittill("connected", player);
if (!IsDefined(player.pers["autoassign_connected"]) || !player.pers["autoassign_connected"])
{
player.pers["autoassign_connected"] = true;
player [[level.autoassign]]();
}
}
}
ReplaceAllowTeamChoice()
{
return false;
}