1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 23:31:13 -05:00

add set spectator command for game interface

This commit is contained in:
RaidMax
2022-03-01 12:45:39 -06:00
parent 57558f6223
commit cf3c7cf692
2 changed files with 35 additions and 1 deletions

View File

@ -501,7 +501,7 @@ OnExecuteCommand( event )
}
else
{
response = self GotoImpl( event.data );
response = self GotoImpl( data );
}
break;
case "Kill":
@ -510,6 +510,9 @@ OnExecuteCommand( event )
case "NightMode":
NightModeImpl();
break;
case "SetSpectator":
response = event.target SetSpectatorImpl();
break;
}
// send back the response to the origin, but only if they're not the target
@ -712,3 +715,16 @@ ToggleNightMode()
self SetClientDvar( "fx_draw", fxDraw );
self SetClientDvar( "sv_cheats", 0 );
}
SetSpectatorImpl()
{
if ( self.pers["team"] == "spectator" )
{
return self.name + " is already spectating";
}
self [[level.spectator]]();
self IPrintLnBold( "You have been moved to spectator" );
return self.name + " has been moved to spectator";
}