cooldown help

Discussion in 'Plugin Development' started by drillzy, Apr 28, 2017.

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

    drillzy

    Hello guys i need some help with a cooldown. I know this requires hash maps and i have no idea how to handle those so i came here to get help. How would i create those hashmaps for cooldown? How would i add a cooldown to the command "jokesubmit" after the hash maps are complete? Also how would i add cooldown bypass permission to that too?
     
    Last edited: Apr 28, 2017
  2. Offline

    Irantwomiles

    Create a hashmap with the players UUID and Long. Check if the map contains the players UUID, and if it doesn't put the players UUID and the current system * (how many seconds you want). Then when ever the action or command or what ever you are checking happens, check the the current time is greater than the time in the map, and if it is they are no longer on cooldown.
     
Thread Status:
Not open for further replies.

Share This Page