⚔️ fight_GetChallengeFromList(challenges, index)
Récupère un challenge spécifique depuis une liste de challenges en utilisant son index.
fight_GetChallengeFromList(challenges, index)
FightRécupère un challenge spécifique depuis une liste de challenges en utilisant son index.
Paramètres
| Paramètre | Type | Description |
|---|---|---|
challenges |
table | La liste de challenges |
index |
int | L'index du challenge (commence à 0) |
Valeur de retour
table - Le challenge à l'index spécifié (nil si non trouvé)
Exemple
function example_fightgetchallengefromlist()
-- Obtenir un challenge par index
local challenges = fight_GetChallenges()
local firstChallenge = fight_GetChallengeFromList(challenges, 0)
if firstChallenge then
local name = fight_GetChallengeProperty(firstChallenge, "name")
fight_SendLogs("Premier challenge: " .. name, "Cyan")
end
end
-- Appeler la fonction
example_fightgetchallengefromlist()