Advertisement
Nuxeel

Private Message v3.0 | Nuxeel

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