Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

[DL][Skript] ChatManager


Rekomendowane odpowiedzi

Opublikowano

Kod:

#
# dCrafters.pl Scripts
# ChatManager
#

# ----------------------------------------- #
#                                           #
#                                           #
#                Permissions                #
#                                           #
#                                           #
# ----------------------------------------- #

    # chat - Chat manager Commands
    # chat.colour - Kolorowy chat
    # chat.ignore - Ignoruje wiadomosci co x sec i wylaczony chat
    # sign - Kolorowanie znakow

# ----------------------------------------- #
#                                           #
#                                           #
#                   Config                  #
#                                           #
#                                           #
# ----------------------------------------- #
options:
#----------------------#
#    General Config    #
#----------------------#
 
    # Tag Wyswietlany przed wiadomosciami skryptu
    tag: &6&l[dCrafters.pl]&r
    
    # Say tag - Wyswietlany prze /say
    say.tag: &6&l[dCrafters.pl]
    
    # Kolor wiadomosci /say
    say.colour: &b
    
    # Nick przed wiadomoscia /say
    #tak-true | nie-false
    say.nick: false

    # Kolor nicku /say
    say.nick.colour: &2
    
#----------------------#
#      Hide Stream     #
#----------------------#
    
    # Wlaczyc wlasne wiadomosci
    hidestream: true

    # Gracz - %player%
    # Przyklad:
    #leave "&6%player% &ewyszedl z serwera!"

    # Wiadomos dojscia gracza "" - brak
    join: ""
    
    # Wiadomos wyjscia gracza "" - brak
    leave: ""

#----------------------#
#     Timer Config     #
#----------------------#

    # Odstepy miedzy kolejnymi wiadomosciami true/false
    timer: true

    # Czas miedzy wiadomosciami (sec)
    czas: 3

#----------------------#
#       Messages       #
#----------------------#

    perm: &cBrak uprawnien!
    cc: &7Chat zostal wyczyszczony przez &6%sender%
    on: &7Chat zostal wlaczony przez &6%sender%
    off: &7Chat zostal wylaczony przez &6%sender%
    off.try: &7Chat jest obecnie wylaczony! Sprobuj ponownie za chwile!
    chat.every: &aWiadomosc na czacie mozesz wyslac raz na &e%{_czas}%&a sekund.

# ----------------------------------------- #
#                                           #
#                                           #
#                   CODE                    #
#                                           #
#                                           #
# ----------------------------------------- #
variables:
    {chat} = true

# ------------- #
#     Config    #
#      Load     #
# ------------- #

on skript load:
    set {chat} to true
    set {chat.say.nick} to {@say.nick}
    set {chat.timer} to {@timer}
    set {hidestream} to {@hidestream}
# ------------- #
#      Hide     #
#     Stream    #
# ------------- #

on join:
    if {hidestream} is true:
        set join message to {@join}

on quit:
    if {hidestream} is true:
        set leave message to {@leave}

# ------------- #
#      Chat     #
#    Manager    #
# ------------- #

on chat:
    cancel event
    set {_czas} to {@czas}
    set {_chat} to "&7%coloured prefix of player% %display name of player%%coloured suffix of player%&r&7:&r "
    set {_chat.timer} to difference between {chat.last.%player%} and now
    if sender has permission "chat" or "chat.colour":
        set message to coloured message
    if {chat} is true:
        if {chat.timer} is true:
            if player has permission "chat" or "chat.ignore":
                send "%{_chat}% %message%" to all players
                stop
            else:
                if {_chat.timer} is less than {@czas} seconds:
                    send "{@chat.every}" to sender
                    stop
                else:
                    send "%{_chat}% %message%" to all players
                    set {chat.last.%player%} to now
                    stop
        else:
            send "%{_chat}% %message%" to all players
            stop
    else:
        if sender has permission "chat" or "chat.ignore":
            send "%{_chat}% %message%" to all players
            stop
        else:
            send "{@off.try}"


# ------------- #
#    Commands   #
# ------------- #

# Clear Chat Command
command /cc:
    aliases: clearchat, cchat
    trigger:
        if sender has permission "chat":
            loop 200 times:
                send "" to all players
            broadcast "{@tag} {@cc}"
        else:
            send "{@perm}"

# Chat manage command
command /chat [<text>]:
    aliases: czat, c
    trigger:
        if sender has permission "chat":
            if arg is not set:
                send "&8-----&6[ CHAT ]&8-----"
                send ""
                send "&6&l/cc&r - &2Czysci chat."
                send "&6&l/chat off/on&r - &2Wylacz/wlacz chat."
                send "&6&l/say <text>&r - &2Wysyla wiadomosc na caly serwer."
 
            if arg is "off" or "wylacz":
                set {chat} to false
                broadcast "{@tag} {@off}"
 
            if arg is "on" or "wlacz":
                set {chat} to true
                broadcast "{@tag} {@on}"
 
            if arg is "clear" or "c" or "wyczysc":
                sender command "cc"

# Say command
command /say <text>:
    permission: chat
    permission message: §cBrak Uprawnien!
    trigger:
        set {_say} to "%arg%"
        set {_say} to coloured {_say}
        if {chat.say.nick} is true:
            if sender is a player:
                broadcast "{@say.tag} {@say.nick.colour}&o(%sender%)&r&8&l: {@say.colour}%{_say}%"
                stop 
            else:
                broadcast "{@say.tag}&8&l: {@say.colour}%{_say}%"
                stop
        else:
            broadcast "{@say.tag}&8&l: {@say.colour}%{_say}%"
            stop

Serwer na ktorym mozna przetestowac skrypt:

dcrafters.pl
Opublikowano

Witaj artur9019,



Twoje skrypty - jak zwykle, są świetne. Proste, ale przydatne. ZŁapiesz like'a? :-)



Pozdrawiam,


xAvaterys.


Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...