Permission & ranks plugin

Discussion in 'Plugin Development' started by daniel_a19, May 26, 2020.

Thread Status:
Not open for further replies.
  1. Offline

    daniel_a19

    i'm writing a plugin where I can give the users a rank (admin, mod etc..) with these ranks come permissions so I've been stuck on implementing a way that would update the players permissions when i give them a different rank without them needing to leave and re join the server.

    So far setting ranks works and permissions also work but the permissions are only relevant to the rank when they join the server or rejoin the server after I have given them a different rank or if the new rank has more permissions than their current rank (higher rank).

    for example:
    if I set their rank from default to admin they gain the right permissions without needing to rejoin, but if I set them from admin to default they still have the permissions from admin and don't loose admin permissions without leaving and joining the server again.

    what I've got now is all working code but any ideas on how I could implement this?

    here is the relevant code:
    where player and their permission is attached to / rank string for using to compare in permissionsetter()
    2.PNG
    Main section from the class for the permissions
    1.PNG
    section for refreshing users rank to new one / reset permissions to new ones (if i can make it work):
    (inside a event listener class that would trigger this when i set a new rank)
    3.PNG

    Thanks!
     
  2. Offline

    caderapee

Thread Status:
Not open for further replies.

Share This Page