...Did you just answer your own question?
Try this. I don't know what TEAM_SURVIVOR is though so be sure to define it.
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#define TEAM_SURVIVOR 2 //DeathChaos25
public OnPluginStart() {
RegAdminCmd("sm_warpbots", Command_warpBots, ADMFLAG_SLAY);
}
public Action Command_warpBots(int client, int args) {
if (!client) {
PrintToServer("[SM] Unable to execute this command from the server console!");
return Plugin_Handled;
}
float clientPos[3];
GetEntPropVector(client, Prop_Data, "m_vecOrigin", clientPos);
int farthestBotIndex = getFarthestBot(client);
if (farthestBotIndex < 1) {
ReplyToCommand(client, "[SM] Could not find a bot to teleport.");
return Plugin_Handled;
}
TeleportEntity(farthestBotIndex, clientPos, NULL_VECTOR, NULL_VECTOR);
ReplyToCommand(client, "[SM] Teleported %N to you.", farthestBotIndex);
return Plugin_Handled;
}
int getFarthestBot(client) {
int farthestBotIndex = -1;
float maxDist;
float otherPos[3], clientPos[3];
GetEntPropVector(client, Prop_Data, "m_vecOrigin", clientPos);
for (int i = 1; i <= MaxClients; i++) {
if (!IsClientInGame(i)) continue;
if (!IsPlayerAlive(i)) continue;
if (!IsFakeClient(i)) continue;
if (GetClientTeam(i) != TEAM_SURVIVOR) continue;
GetEntPropVector(i, Prop_Data, "m_vecOrigin", otherPos);
if (GetVectorDistance(clientPos, otherPos, false) > maxDist) {
maxDist = GetVectorDistance(clientPos, otherPos, false);
farthestBotIndex = i;
}
}
return farthestBotIndex;
}