I'm wondering if there's an efficient way of getting the coordinates of where in the Saferoom survivors are teleported to when "warp_all_survivors_to_checkpoint" is used.
I want to get those coordinates at the start of each map. This is the only method I can think of but I fear that it may cause the round to end.
PHP Code:
float g_flPosition[3];
...
public Action eRoundStart(Event event, const char[] name, bool dontBroadcast)
{
g_flPosition[0] = 0.0;
g_flPosition[1] = 0.0;
g_flPosition[2] = 0.0;
// As long as it's not a finale map
if (!bIsFinaleMap())
{
ServerCommand("warp_all_survivors_to_checkpoint"); // Teleport to saferoom
for (int iSurvivor = 1; iSurvivor <= MaxClients; iSurvivor++)
{
// Get position of the 1st survivor
if (bIsSurvivor(iSurvivor))
{
GetClientAbsOrigin(iSurvivor, g_flPosition);
break;
}
// Teleport all survivors back to starting saferoom
TeleportEntity(iSurvivor, g_flOrigin, NULL_VECTOR, NULL_VECTOR); // g_flOrigin would be set on "player_activate" event
}
}
}
...
void Blah(int target, int client)
{
TeleportEntity(target, g_flPosition, NULL_VECTOR, NULL_VECTOR);
PrintToChat(client, "%N was teleported to the Saferoom.", target);
}
__________________