Gommeh
Veteran Member
dammit ryan and rylie
Posts: 2,744
| Likes: 778
|
Post by Gommeh on Aug 19, 2018 3:27:45 GMT
I'm trying to make my own TFM server and want to make a /gtfo-type command that only I can use. If anyone else tries to use it it will humiliate them in chat. However, I have almost no coding experience whatsoever and need help.
(also, btw, need people to help me with setting up the server in general. DM me if interested)
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Aug 19, 2018 6:01:07 GMT
I'd be happy to help. My discord is Model 3#7854
As for the /gtfo command, I assume you know how to make the new command. Inside the command, surround everything (inside of the onCommand) with an if statement that looks something like this:
UUID uuid = playerSender.getUniqueId();
if (uuid.toString().equals("{your full UUID goes here}") && plugin.al.isAdmin(playerSender) { // GTFO code goes in here } else { msg("You do not have permission to use this command!", ChatColor.RED); }
You want to be sure that you include a checkRank (or a plugin.al.isAdmin()) check so no one can just login as you and use the command)
|
|
StevenNL2000
Forum Admin
Posts: 6,415
| Likes: 6,936
IGN: StevenNL2000
Timezone: UTC+01:00
Member is Staff. Need immediate assistance? Send a PM
|
Post by StevenNL2000 on Aug 19, 2018 10:06:52 GMT
I'd be happy to help. My discord is Model 3#7854 As for the /gtfo command, I assume you know how to make the new command. Inside the command, surround everything (inside of the onCommand) with an if statement that looks something like this: UUID uuid = playerSender.getUniqueId();
if (uuid.toString().equals("{your full UUID goes here}") && plugin.al.isAdmin(playerSender) { // GTFO code goes in here } else { msg("You do not have permission to use this command!", ChatColor.RED); }
You want to be sure that you include a checkRank (or a plugin.al.isAdmin()) check so no one can just login as you and use the command) The rank check is useless here because the UUID check only works when the server is in onlinemode.
|
|
Lemon
Veteran Member
Insert status here.
Posts: 2,491
| Likes: 2,165
|
Post by Lemon on Aug 19, 2018 11:14:54 GMT
I'd be happy to help. My discord is Model 3#7854 As for the /gtfo command, I assume you know how to make the new command. Inside the command, surround everything (inside of the onCommand) with an if statement that looks something like this: UUID uuid = playerSender.getUniqueId();
if (uuid.toString().equals("{your full UUID goes here}") && plugin.al.isAdmin(playerSender) { // GTFO code goes in here } else { msg("You do not have permission to use this command!", ChatColor.RED); }
You want to be sure that you include a checkRank (or a plugin.al.isAdmin()) check so no one can just login as you and use the command) The rank check is useless here because the UUID check only works when the server is in onlinemode. Yeah, use usernames instead
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Aug 19, 2018 17:01:05 GMT
I'd be happy to help. My discord is Model 3#7854 As for the /gtfo command, I assume you know how to make the new command. Inside the command, surround everything (inside of the onCommand) with an if statement that looks something like this: UUID uuid = playerSender.getUniqueId();
if (uuid.toString().equals("{your full UUID goes here}") && plugin.al.isAdmin(playerSender) { // GTFO code goes in here } else { msg("You do not have permission to use this command!", ChatColor.RED); }
You want to be sure that you include a checkRank (or a plugin.al.isAdmin()) check so no one can just login as you and use the command) The rank check is useless here because the UUID check only works when the server is in onlinemode. Oh didn't know that...
|
|
StevenNL2000
Forum Admin
Posts: 6,415
| Likes: 6,936
IGN: StevenNL2000
Timezone: UTC+01:00
Member is Staff. Need immediate assistance? Send a PM
|
Post by StevenNL2000 on Aug 19, 2018 18:04:21 GMT
The rank check is useless here because the UUID check only works when the server is in onlinemode. Oh didn't know that... When a server is cracked, a random UUID is generated for every username that joins the server, even if the name already has one because it's premium, and you'll get a completely new one if your player data is deleted, so it's not even stable. If you remember the time Prozza tried to use UUIDs in TFM, that's a major reason that failed horribly.
|
|
Gommeh
Veteran Member
dammit ryan and rylie
Posts: 2,744
| Likes: 778
|
Post by Gommeh on Aug 19, 2018 22:15:15 GMT
When a server is cracked, a random UUID is generated for every username that joins the server, even if the name already has one because it's premium, and you'll get a completely new one if your player data is deleted, so it's not even stable. If you remember the time Prozza tried to use UUIDs in TFM, that's a major reason that failed horribly. so if an impostor logs in as me then their UUID will be the same as mine? Or will that be a way to tell the difference?
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Aug 19, 2018 22:19:56 GMT
When a server is cracked, a random UUID is generated for every username that joins the server, even if the name already has one because it's premium, and you'll get a completely new one if your player data is deleted, so it's not even stable. If you remember the time Prozza tried to use UUIDs in TFM, that's a major reason that failed horribly. so if an impostor logs in as me then their UUID will be the same as mine? Or will that be a way to tell the difference? No, when in offline mode UUIDs are randomly generated as Steven said above. Use: sender.getName().equals instead
|
|
Gommeh
Veteran Member
dammit ryan and rylie
Posts: 2,744
| Likes: 778
|
Post by Gommeh on Aug 19, 2018 23:35:24 GMT
so if an impostor logs in as me then their UUID will be the same as mine? Or will that be a way to tell the difference? No, when in offline mode UUIDs are randomly generated as Steven said above. Use: sender.getName().equals instead Forget about the UUID altogether and just use sender.getName().equals? Also, I want to broadcast a message and have the command wait a specific amount of time after execution before actually banning the person. Google didn't help, so how do I do this?
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Aug 20, 2018 0:12:56 GMT
No, when in offline mode UUIDs are randomly generated as Steven said above. Use: sender.getName().equals instead Forget about the UUID altogether and just use sender.getName().equals? Also, I want to broadcast a message and have the command wait a specific amount of time after execution before actually banning the person. Google didn't help, so how do I do this? Yes, forget UUIDs. Here's a tutorial on BukkitRunnables which should help you: bukkit.gamepedia.com/Scheduler_Programming
|
|