The getPlayerDistance native AI script function calculates the distance between a player and a bot in meters.
(distance: f)getPlayerDistance(PlayerEidAsString: s, BotIndex: f) // getPlayerDistance_fs_f
This function returns the distance between the player and the bot in meters, or -1 if there was an error.
($playerEid)getCurrentPlayerEid(); (index)getBotIndexByName("toto"); (distance)getPlayerDistance($playerEid, index);
This example code gets the EntityId of the current player, gets the index of the bot named "toto", and calculates the distance between the player and the bot.