-MUTATOR_HOOKFUNCTION(superspec_PlayerPreThink)
+float _spectate(entity _player)
{
- return FALSE;
+ if(SpectateNext(_player) == 1)
+ {
+ PutObserverInServer();
+ self.classname = "spectator";
+ }
+ return TRUE;
}
MUTATOR_HOOKFUNCTION(superspec_SV_ParseClientCommand)
return FALSE;
if(self.classname == "player")
- {
- centerprint(self, "GTFO\n");
return TRUE;
- }
-
+
if(cmd_name == "followpowerup")
{
entity _player;
FOR_EACH_PLAYER(_player)
{
if(_player.strength_finished > time || _player.invincible_finished > time)
- {
- SpectateNext(_player);
- //centerprint(self, "Active powerup found\n");
- return TRUE;
- }
+ return _spectate(_player);
}
- //centerprint(self, "No active powerups\n");
- return TRUE;
+ centerprint(self, "No active powerups\n");
+ return TRUE;
}
-
+
if(cmd_name == "followstrength")
{
entity _player;
FOR_EACH_PLAYER(_player)
{
if(_player.strength_finished > time)
- {
- SpectateNext(_player);
- //centerprint(self, "Active powerup found\n");
- return TRUE;
- }
+ return _spectate(_player);
}
- //centerprint(self, "No active powerups\n");
- return TRUE;
+ centerprint(self, "No active Strength\n");
+ return TRUE;
}
-
+
if(cmd_name == "followstshield")
{
entity _player;
FOR_EACH_PLAYER(_player)
{
if(_player.invincible_finished > time)
- {
- SpectateNext(_player);
- //centerprint(self, "Active powerup found\n");
- return TRUE;
- }
+ return _spectate(_player);
}
- //centerprint(self, "No active powerups\n");
- return TRUE;
+ centerprint(self, "No active Shield\n");
+ return TRUE;
}
-
- /*
+
+ if(cmd_name == "followfc")
{
+ if(!g_ctf)
+ return TRUE;
+
+ entity _player;
+ float _team;
+
if(cmd_argc == 2)
- {
- if(argv(1) == "bar")
-
- else if(argv(1) == "baz")
-
+ {
+ if(argv(1) == "red")
+ _team = COLOR_TEAM1;
else
- {
- float _idx = stof(argv(1));
-
- }
+ _team = COLOR_TEAM2;
}
+ FOR_EACH_PLAYER(_player)
+ {
+ if(_player.flagcarried && (_player.team == _team || _team == 0))
+ return _spectate(_player);
+ }
+
+ centerprint(self, "No active FC\n");
return TRUE;
- }
- */
-
+ }
+
return FALSE;
}
return 0;
}
+/*
MUTATOR_HOOKFUNCTION(superspec_PlayerSpawn)
-{
-
+{
+
return FALSE;
}
MUTATOR_HOOKFUNCTION(superspec_ClientDisconnect)
{
-
+
+ return FALSE;
+}
+MUTATOR_HOOKFUNCTION(superspec_PlayerPreThink)
+{
return FALSE;
}
+*/
MUTATOR_DEFINITION(mutator_superspec)
{