AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved [TF2] Force team to win (https://forums.alliedmods.net/showthread.php?t=332866)

infinixius 06-05-2021 11:44

[TF2] Force team to win
 
hey!

is it possible to force a specific team to win with sourcemod? the console command mp_forcewin seems to be client-side and requires sv_cheats.

thanks!

StrikeR14 06-05-2021 12:13

Re: [TF2] Force team to win
 
PHP Code:

stock void ForceTeamWin(int team)
{
    
int ent CreateEntityByName("game_round_win");
    
DispatchKeyValue(ent"force_map_reset""1");
    
DispatchSpawn(ent);
    
    if (
ent == -1)
    {
        
LogError("[SZF] Can't create 'game_round_win', can't end round!");
    }
    else
    {
        
SetVariantInt(team);
        
AcceptEntityInput(ent"SetTeam");
        
AcceptEntityInput(ent"RoundWin");
    }




All times are GMT -4. The time now is 09:21.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.