add set spectator command for game interface
This commit is contained in:
@ -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";
|
||||
}
|
||||
|
Reference in New Issue
Block a user