Horizons
🔌 API🔧 Skript

🔧 Skript


📑 Table des matières

  1. Expressions

  2. Effets

  3. Conditions

  4. Exemples


📖 Expressions

Équipes

Informations de base

SyntaxeDescription
team of %player%Obtient l'équipe d'un joueur
%player%'s teamAlias
all teamsListe toutes les équipes disponibles
all teams sorted by scoreListe les équipes triées par score (décroissant)

Propriétés d'équipe

SyntaxeDescription
score of team %string%Obtient le score d'une équipe
team %string%'s scoreAlias
display name of team %string%Obtient le nom d'affichage
team %string%'s display nameAlias
prefix of team %string%Obtient le préfixe coloré
team %string%'s prefixAlias
members of team %string%Obtient la liste des membres en ligne
team %string%'s membersAlias

Shops

Note : Les IDs de shop sont au format fichier::npcId (ex: minerals::miner)

SyntaxeDescriptionRetour
items of shop %string%Liste les items d'un shopListe de strings (noms de matériaux)
shop %string%'s itemsAlias
price of %string% in shop %string%Prix d'un item dans un shopNombre décimal
price of %string% in shop %string% for team %string%Prix pour une équipe spécifiqueNombre décimal
price of custom item %string% in shop %string%Prix d'un item customNombre décimal
price of custom item %string% in shop %string% for team %string%Prix custom pour une équipeNombre décimal
price trend of %string% in shop %string%Tendance du prix"up", "down", ou "stable"

Marché Noir

SyntaxeDescriptionRetour
items of black market %string%Liste les items d'un marché noirListe de strings
black market %string%'s itemsAlias
price of %string% in black market %string%Prix d'un item au marché noirNombre entier

Price Scope

Le scope détermine si les prix sont partagés globalement (global) ou par équipe (per_team).

SyntaxeDescriptionRetour
price scope of %string% in shop %string%Scope effectif d'un item"global" ou "per_team"
price scope of shop %string%Scope d'un shop"global" ou "per_team"
shop %string%'s price scopeAlias

Scores Alternatifs

SyntaxeDescription
alt score %string% of %player%Score alternatif d'un joueur
%player%'s alt score %string%Alias
alt score %string% of team %string%Score alternatif d'une équipe
team %string%'s alt score %string%Alias

⚡ Effets

Gestion des équipes

# Attribuer un joueur à une équipe
set team of %player% to %string%

# Retirer un joueur de son équipe
remove %player% from [their] team

# Créer une nouvelle équipe
create team %string% with prefix %string% and display name %string%

# Supprimer une équipe
remove team %string%

# Modifier le préfixe d'une équipe
set prefix of team %string% to %string%

# Modifier le nom d'affichage d'une équipe
set display name of team %string% to %string%

Gestion des scores

# Définir le score
set score of team %string% to %number%

# Ajouter des points
add %number% to score of team %string%

# Retirer des points
remove %number% from score of team %string%

Gestion des price scopes

# Définir le scope d'un item spécifique
set price scope of %string% in shop %string% to %string%
# Exemple: set price scope of "DIAMOND" in shop "minerals::miner" to "per_team"

# Définir le scope d'un shop entier
set price scope of shop %string% to %string%
# Exemple: set price scope of shop "minerals::miner" to "global"

✅ Conditions

Vérifications d'équipes

Existence et appartenance

# Vérifier si une équipe existe
team %string% exists

# Vérifier si un joueur est dans une équipe spécifique
%player% is in team %string%

# Vérifier si un joueur a une équipe
%player% has a team

Comparaisons de score

# Égalité
score of team %string% is %number%
score of team %string% is equal to %number%

# Supériorité
score of team %string% is greater than %number%
score of team %string% is more than %number%

# Infériorité
score of team %string% is less than %number%

# Supérieur ou égal
score of team %string% is greater than or equal to %number%

# Inférieur ou égal
score of team %string% is less than or equal to %number%

# Comparaison entre équipes
score of team %string% is greater than score of team %string%
score of team %string% is less than score of team %string%

Vérifications de shops

# Vérifier si un shop existe
shop %string% exists

# Vérifier si un marché noir existe
black market %string% exists
blackmarket %string% exists

💡 Exemples

Gérer les équipes

command /myteam:
    trigger:
        if player has a team:
            set {_team} to team of player
            set {_score} to score of team {_team}
            send "&aVotre équipe: &e%{_team}%"
            send "&aScore: &e%{_score}% points"
        else:
            send "&cVous n'êtes dans aucune équipe!"

Consulter les prix d'un shop

command /checkprice <text>:
    trigger:
        set {_item} to arg-1
        set {_shop} to "minerals::miner"
        
        if shop {_shop} exists:
            set {_price} to price of {_item} in shop {_shop}
            set {_trend} to price trend of {_item} in shop {_shop}
            
            if {_price} is not -1:
                send "&6Prix de %{_item}%: &e%{_price}% points"
                send "&6Tendance: &e%{_trend}%"
            else:
                send "&cItem non trouvé dans ce shop!"
        else:
            send "&cShop introuvable!"

Gérer les scopes de prix

command /togglescope <text>:
    permission: admin.shop
    trigger:
        set {_shop} to arg-1
        set {_current} to price scope of shop {_shop}
        
        if {_current} is "global":
            set price scope of shop {_shop} to "per_team"
            send "&aScope changé en PER_TEAM"
        else:
            set price scope of shop {_shop} to "global"
            send "&aScope changé en GLOBAL"

Afficher le classement des équipes

command /classement:
    trigger:
        send "&6=== Classement des équipes ==="
        set {_teams::*} to all teams sorted by score
        set {_rank} to 1
        loop {_teams::*}:
            set {_score} to score of team loop-value
            set {_prefix} to prefix of team loop-value
            send "&e#%{_rank}% %{_prefix}%%loop-value% &7- &f%{_score}% points"
            add 1 to {_rank}

On this page