Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > Update (Old ver.: https://pastebin.com/7k3amZQa)
- - Will now check whether player is sending messages to himself/herself.
- - Will now show complete name in format.
- - Feel free to edit the format [line 34].
- # ------ COMPLETE CODE STARTS HERE ------ #
- cmd edit pm 1 # §9PM v3 §9| §aMadCommands v2.1.6 build 1047 §9| §6Nuxeel
- cmd edit pm 2 if varset(%args%[1]) = %true% then goto 5
- cmd edit pm 3 message %p% §aUsage: /pm <player> <message>
- cmd edit pm 4 exit
- cmd edit pm 5 %target% = %args%[1]
- cmd edit pm 6 %list% = onlineplayers()
- cmd edit pm 7 %size% = size(%list%)
- cmd edit pm 8 if %size% > 0 then goto 11
- cmd edit pm 9 message %p% §cPlayer must be online!
- cmd edit pm 10 exit
- cmd edit pm 11 if %target% in %list% then goto 27
- cmd edit pm 12 async
- cmd edit pm 13 # Check again one by one. Start at first index.
- cmd edit pm 14 %target% = lowercase(%target%)
- cmd edit pm 15 %index% = 0
- cmd edit pm 16 %current% = lowercase(%list%[%index%])
- cmd edit pm 17 %pos% = position(%current%, %target%)
- cmd edit pm 18 if %pos% = 0 then goto 24
- cmd edit pm 19 %index% = %index% + 1
- cmd edit pm 20 if %index% < %size% then goto 16
- cmd edit pm 21 sync
- cmd edit pm 22 # Passing here means that player is not online.
- cmd edit pm 23 goto 9
- cmd edit pm 24 sync
- cmd edit pm 25 # Player is online.
- cmd edit pm 26 %target% = %list%[%index%]
- cmd edit pm 27 if lowercase(%p%) != lowercase(%target%) then goto 30
- cmd edit pm 28 message %p% §cYou can't send private message to yourself!
- cmd edit pm 29 exit
- cmd edit pm 30 # Compile message.
- cmd edit pm 31 if varset(%args%[2]) = %false% then goto 3
- cmd edit pm 32 if size(%args%[2]) = 0 then goto 3
- cmd edit pm 33 %msg% = join(%args%[2+], \" \")
- cmd edit pm 34 # Format | Feel free to modify.
- cmd edit pm 35 %receiver% = \"[ \" + %p% + \" to You\" + \" ] : \" + %msg%
- cmd edit pm 36 %sender% = \"[ You to \" + %target% + \" ] : \" + %msg%
- cmd edit pm 37 message %p% %sender%
- cmd edit pm 38 message %target% %receiver%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement