Aller au contenu

BanMe - Compatible Bungee (Si relié à une BDD)


Est-ce que tu aimes ce skript ? (Clique sur oui ou j'te tue.)  

11 membres ont voté

  1. 1. Est-ce que tu aimes ce skript ? (Clique sur oui ou j'te tue.)

    • Oui !
      8
    • Non.
      4


Messages recommandés

Posté(e)

Salut Skript-Mc. Aujourd'hui je vous présente BanMe

 

BanMe est un skript de modération qui permet de bannir/débannir (Pour le moment).

 

Il vous permettra de bannir facilement un joueur. Je ferais des mises à jours assez régulièrement !

 

 

Commandes:

/ban <Joueur> <Raison> : Banni un joueur.

/pardon <Joueur> : Dé-banni un joueur.

Permissions:

moderateur.ban: Permet d'utiliser le /ban

moderateur.pardon: Permet d'utiliser le /pardon

Changelogs:

- Déploiement de la 1.0.0

- Fonctionnalité Ban/Déban

 

Toutes modifications et reventes sont interdites. Le skript étant gratuit pour tout le monde.

Tout partage est autorisé si le nom du créateur (P4sh) est cité dans la vidéo ou le post présentant BanMe

 

J'attend actuellement les images de Polymeth donc le poste n'est pas très beau

Posté(e)

Remplace le "command /ban <text> <text>:" par "command /ban <offline player> <text>:" ainsi que "command /pardon <text>:" par "command /pardon <offline player>:" ^^. Ensuite je comprends pas pourquoi tu dis compatible bungee...

Posté(e)

Pas du tout compatible avec bungeecord. Je vais t'expliquer quelque chose. Quand on dit compatible avec Bungeecord c'est pour dire ça se passe sur tous les serveurs. Or là, c'est pas le cas. Si t'es banni sur un serveur A tu n'es pas banni sur un serveur B étant donné que tes variables sont

locales. Autre point ton système de bannissement est vraiment très simple tu aurais du te cassé un peu plus la tête .

 

Voilà deux skript de ban que j'ai commencé mais jamais finis :

[spoiler=Code]

# /sanction joueur text text

# /sanction <player> tempban chiffre raison
# /sanction <player> kick raison
# /sanction <player> ban raison
# /sanction <player> mute chiffre raison
# /sanction <player> warn raison
# |ID|PLAYER|UUID|SANCTION(type)|RAISON|TEMPS|AUTEUR|

script options:
   $ db url jdbc:mysql://localhost:3306/skript
   $ db username root
   $ db password ******

options:
   table: sanction

on script load:
   update "CREATE TABLE IF NOT EXISTS `{@table}` (`ID` varchar(255),`PSEUDO` varchar(255),`UUID` varchar(255),`SANCTION` varchar(255),`RAISON` varchar(255),`TEMPS` varchar(255),`AUTEUR` varchar(255),`DATE` varchar(255))"
   update "CREATE TABLE IF NOT EXISTS `LastBan` (`PSEUDO` varchar(255),`UUID` varchar(255),`TIMELASTBAN` varchar(255),`LASTRAISON` varchar(255),`LASTNOW` varchar(255))"
on join:
   wait 2 ticks
   set {_tempban.maintenant::*} to objects in column "TIMELASTBAN" from result of query "SELECT * FROM `Lastban` WHERE `UUID` = '%UUID of player%'"
   wait 2 ticks
   set {_tempban.raison::*} to objects in column "LASTRAISON" from result of query "SELECT * FROM `Lastban` WHERE `UUID` = '%UUID of player%'"
   wait 2 ticks
   set {_tempban.now::*} to objects in column "LASTNOW" from result of query "SELECT * FROM `Lastban` WHERE `UUID` = '%UUID of player%'"
   wait 2 ticks
   set {_maintenantduban} to "%{_tempban.maintenant::*}%" parsed as timespan
   set {_Count} to "%{_tempban.now::*}%" parsed as timespan
   if difference between {_Count} and now is smaller than {_maintenantduban}:
       send "bla"
       wait 2 ticks
       set {_wait} to difference between now and {_maintenantduban}
       reduce {_Count} by {_wait}
       set {_Count} to "%{_Count}%" parsed as text
       replace "s" with "" in {_Count}
       replace "econd" with "seconde(s)" in {_Count}
       replace "minute" with "minute(s)" in {_Count}
       replace "and" with "et" in {_Count}
       replace "hour" with "heure(s)" in {_Count}
       replace "day" with "jour(s)" in {_Count}
       kick player due to "&fTu as temporairement été banni(e) pour :%nl%&a%{_tempban.raison::*}%%nl%&fIl reste : &a%{_Count}%"
       set join message to ""
       wait 2 ticks
       hide player to all players
   else:
       reveal player to all players
       set {DB_.tempban.%UUID of player%} to false
       clear {DB_.tempban.raison.%UUID of player%}
       clear {DB_.tempban.temps.%UUID of player%}
       clear {DB_.tempban.maintenant.%UUID of player%}

command /sanctiontempban [<player>] [<integer>] [<text>]:
   trigger:
       if arg 1 is set:
           if arg 2 is set:
               if arg 3 is set:
                   if has permission "pala.sanction":                         
                       if {DB_.tempban.%UUID of arg 1%} is false:
                           set {_tempban.nom} to arg 1
                           set {_tempban} to "Tempban" parsed as text                         
                           set {DB_.tempban.raison.%UUID of arg 1%} to arg 3
                           set {_tempban.auteur} to player
                           set {DB_.tempban.temps.%UUID of arg 1%} to "%arg 2% minutes" parsed as timespan
                           set {DB_.tempban.%UUID of arg 1%} to true
                           set {DB_.tempban.maintenant.%UUID of arg 1%} to now 
                           update "INSERT INTO `{@table}` (`ID`, `PSEUDO`, `UUID`, `SANCTION`, `RAISON`, `TEMPS`, `AUTEUR`,`DATE`) VALUES ('%{id.%UUID of player%}%', '%{_tempban.nom}%', '%UUID of {_tempban.nom}%', '%{_tempban}%', '%{DB_.tempban.raison.%UUID of player%}%', '%{DB_.tempban.temps.%UUID of arg 1%}%', '%{_tempban.auteur}%', '%now%')"
                           if {1sttempban.%UUID of arg 1%} is not set:
                               update "INSERT INTO `LastBan` (`PSEUDO`, `UUID`, `TIMELASTBAN`, `LASTRAISON`, `LASTNOW`) VALUES ('%arg 1%', '%UUID of arg 1%', '%{DB_.tempban.temps.%UUID of arg 1%}%', '%{DB_.tempban.raison.%UUID of arg 1%}%', '%{DB_.tempban.maintenant.%UUID of arg 1%}%')"
                               kick arg 1 due to "&fTu as temporairement été banni(e) pour :%nl%&a%{DB_.tempban.raison.%UUID of arg 1%}%%nl%&fIl reste : &a%{DB_.tempban.temps.%UUID of arg 1%}%"
                               set {1sttempban.%UUID of arg 1%} to true
                           else:
                               wait 3 ticks
                               update "UPDATE `LastBan` SET `LastBan`.`PSEUDO` = '%arg 1%' WHERE `LastBan`.`UUID` = '%UUID of player%'"
                               wait 3 ticks
                               update "UPDATE `LastBan` SET `LastBan`.`UUID` = '%UUID of arg 1%' WHERE `LastBan`.`UUID` = '%UUID of player%'"
                               wait 3 ticks
                               update "UPDATE `LastBan` SET `LastBan`.`TIMELASTBAN` = '%{DB_.tempban.temps.%UUID of arg 1%}%' WHERE `LastBan`.`UUID` = '%UUID of arg 1%'"
                               wait 3 ticks
                               update "UPDATE `LastBan` SET `LastBan`.`LASTRAISON` = '%{DB_.tempban.raison.%UUID of arg 1%}%' WHERE `LastBan`.`UUID` = '%UUID of arg 1%'"
                               wait 3 ticks
                         update "UPDATE `LastBan` SET `LastBan`.`LASTNOW` = '%{DB_.tempban.maintenant.%UUID of arg 1%}%' WHERE `LastBan`.`UUID` = '%UUID of arg 1%'"
                               kick arg 1 due to "&fTu as temporairement été banni(e) pour :%nl%&a%{DB_.tempban.raison.%UUID of arg 1%}%%nl%&fIl reste : &a%{DB_.tempban.temps.%UUID of arg 1%}%"
                   else:
                       send "&cTu n'as pas la permission de faire cette commande."
               else:
                   send "&cTu dois préciser une raison !"             
           else:
               send "&cPrécise un temps en minutes"         
       else:
           send "&cPrécise un joueur"

et

#MAX MODERATION

# = Configuration = #
options:
   Already_banned: &cCe joueur est déjà bannis.
   Ban_message: &cTu as été bannis pour %arg 2%.
   ban_message_on_join: &cTu as été bannis pour %{ban.reason.%player%}%.
   Unban_message_to_admin: &cUnban %arg 1% !
   Unban_Fail: &cCe joueur n'est pas bannis !

# = Permission = #

# perm.ban = /ban <player>
# perm.unban = /unban <player>

# = BAN DEF = #

command /ban [<offlineplayer>] [<text>]:
   trigger:
       if player has Permission "perm.ban": 
           if arg 1 is set:
               if {ban.banned.%arg 1%} is true:
                   send "&c{@Already_banned}" to player
           if arg 1 is set:
               if arg 2 is set:
                   set {ban.banned.%arg 1%} to true
                   kick the arg 1 due to "{@Ban_message}"
                   set {ban.reason.%arg 1%} to "%arg 2%"
                   add arg 1 to yaml list "Banned" from file "Banned.yml"
                   set yaml value "Banned.%arg 1%.Raison" from file "MaxModeration/Banned.yml" to "%arg 2%"
                   set yaml value "Banned.%arg 1%.Bannis" from file "MaxModeration/Banned.yml" to "oui"
           if arg 1 is not set:
               send "&c/ban <player> <raison>"


on join:
   if {ban.banned.%player%} is true:
       wait 5 ticks
       kick the player due to "{@ban_message_on_join}"
   else:
       stop

# = UNBAN = #

command /unban [<offlineplayer>]:
   trigger:
       if {ban.banned.%arg 1%} is true:
           if player has Permission "perm.unban":
               if arg 1 is online:
                   set {ban.banned.%arg 1%} to false
                   send "{@Unban_message_to_admin}" to console
                   set yaml value "Banned.%arg 1%.Bannis" from file "MaxModeration/Banned.yml" to "non"
               else:
                   clear {ban.banned.%arg 1%}
                   send "{@Unban_message_to_admin}" to console
                   set yaml value "Banned.%arg 1%.Bannis" from file "MaxModeration/Banned.yml" to "non"
       else:
           send "{@Unban_Fail}" to player  

 

Posté(e)

Mmh, je l'ai testé, il fonctionne sur des variables. Si elles sont connectés à une base de données (SQLibrary & configuration skript), le ban s'applique correctement.

Donc, compatible avec Bungee.

 

Tu sauvegardes les variables dans une sql. Je sais se que j'avance.

 

Kwizzy, on ne peut pas kick un player en bungee si il est sur un autre serveur. Donc le check toute les 10 secondes de mon côté.

Posté(e)
Remplace le "command /ban <text> <text>:" par "command /ban <offline player> <text>:" ainsi que "command /pardon <text>:" par "command /pardon <offline player>:" ^^. Ensuite je comprends pas pourquoi tu dis compatible bungee...

 

Merci du conseil et, pour le compatible en bungee, si tu relies à une BDD, que tu mets le skript sur tout les serveurs, il est compatible en bungee. Tu peux ban du hub, 5 secondes après il sera kick et ban.

Posté(e)
Merci du conseil et, pour le compatible en bungee, si tu relies à une BDD, que tu mets le skript sur tout les serveurs, il est compatible en bungee. Tu peux ban du hub, 5 secondes après il sera kick et ban.

De rien , c'est bien si ça marche avec une bdd mais précise le ^^

Posté(e)
De rien , c'est bien si ça marche avec une bdd mais précise le ^^

C'est bon.

×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.