is_player_alived - ryzom/ryzomcore GitHub Wiki
title: Is Player Alived description: published: true date: 2023-03-16T23:08:30.014Z tags: editor: markdown dateCreated: 2023-03-16T22:25:31.255Z
The isPlayerAlived native AI script function tests whether a player with the given entity ID is alive.
(success: f)isPlayerAlived(playerId: s)
- playerId (string): The entity ID of the player to check.
- success (float): A flag indicating whether the player is alive. If the player is alive, the function returns 1. If the player is not connected, not in the same continent as the NPC group, or dead, 0 is returned.
($botIndex)getBotIndexByName("boss_3");
($playerId)getCurrentPlayerAggroListTarget($botIndex):
(alived)isPlayerAlived($playerId);
if (alived == 1.0f) {
// do something
}
This example code checks whether the player targeted by the bot named "boss_3" is alive, and executes code if they are.