mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-06 10:44:08 +00:00
feat: spectate command
This commit is contained in:
@@ -322,4 +322,12 @@ namespace GMGreaterThanZeroCommands {
|
||||
request.Serialize(bitStream);
|
||||
Game::chatServer->Send(&bitStream, SYSTEM_PRIORITY, RELIABLE, 0, Game::chatSysAddr, false);
|
||||
}
|
||||
|
||||
void Spectate(Entity* entity, const SystemAddress& sysAddr, const std::string args) {
|
||||
if (args.length() <= 0) GameMessages::SendSlashCommandFeedbackText(entity, u"No player Given");
|
||||
auto player = PlayerManager::GetPlayer(args);
|
||||
if (!player) GameMessages::SendSlashCommandFeedbackText(entity, u"Player not found");
|
||||
GameMessages::SendSlashCommandFeedbackText(entity, u"Spectating Player");
|
||||
GameMessages::SendForceCameraTargetCycle(entity, false, eCameraTargetCyclingMode::DISALLOW_CYCLING, player->GetObjectID());
|
||||
}
|
||||
}
|
||||
|
@@ -15,6 +15,7 @@ namespace GMGreaterThanZeroCommands {
|
||||
void Title(Entity* entity, const SystemAddress& sysAddr, const std::string args);
|
||||
void ShowAll(Entity* entity, const SystemAddress& sysAddr, const std::string args);
|
||||
void FindPlayer(Entity* entity, const SystemAddress& sysAddr, const std::string args);
|
||||
void Spectate(Entity* entity, const SystemAddress& sysAddr, const std::string args);
|
||||
}
|
||||
|
||||
#endif //!GMGREATERTHANZEROCOMMANDS_H
|
||||
|
Reference in New Issue
Block a user