on load:
if {groups::Admin} is not set:
set {groups::Admin} to "Admin"
loop all players:
loop-player is op:
if {groups.%loop-player%} is not set:
set {groups.%loop-player%} to "Admin"
command /group <text> <text> [<player>]:
trigger:
if {groups.%player%} is "Admin":
if arg 1 is "create" or "remove" or "set":
if arg 2 is set:
if arg 1 is "create":
if {groups::%arg 2%} is not set:
send "Groupe créer %arg 2%"
set {groups::%arg 2%} to arg-2
else:
send "Groupe existant"
else if arg 1 is "remove":
if arg 3 is not set:
if {groups::%arg 2%} is set:
send "Groupe détruit"
clear {groups::%arg-2%}
else:
send "Groupe inexistant"
else
if arg 2 is {groups.%arg-2%}:
clear {groups.%arg-2%}
else:
send "/groups remove player group"
else if arg 1 is "set":
if arg 3 is set:
if {groups::%arg 3%} is set:
set {groups.%arg-2 parsed as offline player%} to arg-3
send "Groupe %arg-2 parsed as offline player%: %arg-3%"
else:
send "/groups set joueur group"
else:
send "/groups create/remove/set groups/joueur [group]"
else:
send "/groups create/remove/set groups/joueur [group]"
else:
send "Vous n'avez pas la permission"
command /permission <text> <text> <text>:
trigger:
if {groups.%player%} is "Admin":
if arg 1 is "add" or "remove":
if arg 2 is set:
if {groups::%arg-2%} is set:
if arg 3 is set:
if arg 1 is "add":
set {perm.%{groups::%arg 2%}%::%arg-3%} to arg-3
send "Permission ajoutée: %arg-3%"
else:
if {perm.%{groups::%arg 2%}%::%arg-3%} is set:
clear {perm.%{groups::%arg 2%}%::%arg-3%}
send "Permission retirée: %arg 3%"
else:
send "/permission remove group permission"
else:
send "/permission add/remove group permission"
else:
send "/permission add/remove group permission"
else:
send "/permission add/remove group permission"
else:
send "Vous n'avez pas la permission"
# EXEMPLE POUR UNE COMMANDE
#command /test:
# trigger:
# if {groups.%player%} is "Admin": #connaître le groupe du joueur
# if {perm.%{groups.%player%}%::*} contains "la.permission.en.question":
### SUITE DU CODE
else:
#Send "Vous n'avez pas la permission"