-
-
Save OnsenManju/e8805b5caba7b44fdb2ba936a1492961 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
acmd_alias_create("trust", "0", 0, "my.command.trust", function(player, args) { | |
var target; | |
var group; | |
if (args.Count == 0) { | |
tshock_msg_colour("#FFFF00", player, "Specify the name of target player."); | |
return; | |
} | |
if ((target = tshock_get_player(args[0])) == undefined) { | |
tshock_msg_colour("#FFFF00", player, "Can't find player by the name of \"" + args[0] + "\"."); | |
return; | |
} | |
if (target.Group.Name != "default") { | |
tshock_msg_colour("#FFFF00", player, target.Name + " doesn't belong to default group. (" + target.Group.Name + ")"); | |
return; | |
} | |
if ((group = tshock_group("trusted")) == undefined) { | |
tshock_msg_colour("#FFFF00", player, "Proper group doesn't exist."); | |
return; | |
} | |
if (tshock_change_group(target, group) != true) { | |
tshock_msg_colour("#FFFF00", player, "Failed to change group."); | |
return; | |
} | |
tshock_msg_colour("#00FF00", player, target.Name + " is changed to " + group.Name + " group."); | |
tshock_msg_colour("#00FF00", target, "You are changed to " + group.Name + " group."); | |
alert("[!] " + player.Name + " used /trust command and " + target.Name + " is changed to " + group.Name + " group."); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment