Skip to content

is_player_alived

Ryzom Core Wiki edited this page Jul 8, 2024 · 3 revisions

title: Is Player Alived description: published: true date: 2023-03-16T23:08:30.014Z tags: editor: markdown dateCreated: 2023-03-16T22:25:31.255Z

isPlayerAlived

The isPlayerAlived native AI script function tests whether a player with the given entity ID is alive.

Syntax

(success: f)isPlayerAlived(playerId: s)

Arguments

  • playerId (string): The entity ID of the player to check.

Return Value

  • 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.

Example

($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.

Clone this wiki locally