Messaging Commands (Essentials Remake)


Author: OzOwnz
Created: 2014-07-15T21:19:13-0400
Edited: 2014-07-15T21:19:13-0400
Denizen Version: 0.9.4-SNAPSHOT
Views: 4
Downloads: 847
Likes: 1


WGET
Description: Simple /msg <player> & /r <player commands, like in Essentials.



Messaging Commands:
    type: world
    events:
        on msg command:
        - ^inject messagesend
        on tell command:
        - ^inject messagesend
        on m command:
        - ^inject messagesend
        on reply command:
        - ^if <c.args.get[1]> == null {
          - ^narrate '<&f>Message not sent, no message.'
          - determine fulfilled
          - queue clear
          }
        - ^narrate '<&e><player.name><&r> > <&6>Me <&r><&co> <context.args.get[1].to[<context.args.size>].as_string>' t:<player.flag[lastplayermessaged].as_player>
        - ^narrate '<&e>Me<&r> > <&6><player.flag[lastplayermessaged].as_player.name> <&r><&co> <context.args.get[1].to[<context.args.size>].as_string>' t:<player>
        - ^determine fulfilled
        on r command:
        - ^if <c.args.get[1]> == null {
          - ^narrate '<&f>Message not sent, no message.'
          - determine fulfilled
          - queue clear
          }
        - ^narrate '<&e><player.name><&r> > <&6>Me <&r><&co> <context.args.get[1].to[<context.args.size>].as_string>' t:<player.flag[lastplayermessaged].as_player>
        - ^narrate '<&e>Me<&r> > <&6><player.flag[lastplayermessaged].as_player.name> <&r><&co> <context.args.get[1].to[<context.args.size>].as_string>' t:<player>
        - ^determine fulfilled
 
        
'messagesend':
    type: task
    script:
        - ^if <server.match_player[<c.args.get[1]>]> == null {
          - ^narrate '<&f>Player<&co> <c.args.get[1]> not found.'
          - determine fulfilled
          - queue clear
          }
        - ^if <context.args.get[2].to[<context.args.size>].as_string> == null {
          - ^narrate '<&f>Message not sent, no message.'
          - determine fulfilled
          - queue clear
          }
          else {
            - ^flag player lastplayermessaged:<server.match_player[<c.args.get[1]>]>
            - ^narrate '<&e><player.name><&r> > <&6>Me <&r><&co> <context.args.get[2].to[<context.args.size>].as_string>' t:<server.match_player[<c.args.get[1]>]>
            - ^narrate '<&e>Me<&r> > <&6><server.match_player[<c.args.get[1]>].as_player.name> <&r><&co> <context.args.get[2].to[<context.args.size>].as_string>' t:<player>
            - ^determine fulfilled
            }




Comments
No one has posted a comment! Post one below: