Advertisement
Guest User

Untitled

a guest
Dec 16th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. Those that use MCMA to manage permissions probably know that you need to run two commands, one to add a player to the new group and one to remove them from the old group.
  2.  
  3. I created a new group for my promotions called OldTimers and I wanted to auto-promote from the Regulars group, so first of all I defined two commands in rewards.yml; my commands section looks like this:
  4.  
  5. commands:
  6. - oldtimeradd:'pushcommand addmember OldTimers [player]'
  7. - oldtimerrem:'pushcommand delmember Regulars [player]'
  8.  
  9. Next I created the rewards to trigger from the console and then edited them to modify the tags for my own use.
  10. I wanted to auto-promote at 7 days, exclusive to Regulars, with a custom message, so I ended up with this in rewards.yml
  11.  
  12. rewards:
  13. - S,E,T,P,null,default,6,23,59,0,0,0,-1,C,0,oldtimeradd,CMDoldtimeradd
  14. - S,E,T,P,null,promomessage,7,0,0,0,0,0,-1,C,0,oldtimerrem,CMDoldtimerrem
  15.  
  16. The first reward triggers at 6days 23 hours and 59 minutes and runs the command to add a player to the new group. At this point, MCMA still treats them as though they are at the lower rank.
  17.  
  18. The second reward triggers 1 minute later (I found that running them both at 7 days didn't always have time to write the permissions file successfully).
  19. The second reward removes them from the lower rank, which effectively completes the promotion and sends the player a custom message defined in messages.yml like this:
  20.  
  21. message:
  22. promomessage:
  23. lines: 4
  24. line-1: '&6 Congratulations [player] !'
  25. line-2: '&6 You have been auto-promoted'
  26. line-3: '&6 and can now set 2 homes.'
  27. line-4: '&6 If you do not have your new tag, then contact an Op'
  28.  
  29. Line 4 tells them to contact an Op if it didn't work as there is a potential for them to not be promoted. This is because the delmember command is case sensitive, so if they were in the lower rank but their player name was the wrong case, they can't be removed, so an Op will need to manually go into McMyAdmin and just remove them from that group and the promotion will be complete.
  30.  
  31. Finally, I added permissions for the Regulars group to allow them to receive the rewards
  32. ontime.reward.CMDoldtimeradd
  33. ontime.reward.CMDoldtimerrem
  34.  
  35. I also added deny permissions on Ops and Admins just in case
  36. -ontime.reward.CMDoldtimeradd
  37. -ontime.reward.CMDoldtimerrem
  38.  
  39. McMyadmin Auto-Promote working thanks to OnTime, thanks! :D
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement