LoginCommand
LoginCommand allows you to execute commands when players join your server.
Concept
The plugin uses command groups. Each group can have a number of commands. If a player has the corresponding permission node for a command group, those commands will be executed when he/she joins the server.
The commands are executed from the console. You can also execute player commands by adding the "sudo %name_of_player%" prefix to a command.
You can set a delay.
You can set a cooldown.
If you want some players to be ignored (regardless of other permissions), you can do that by giving them a permission node.
Setup instructions
1. Download the plugin.
2. Copy the plugin into your server's plugin folder.
3. Start the server.
4. Create a command group and add commands to it.
Let's say that we want to give Helpers a diamond pickaxe as an award when they join the server. We come up with a group name, "helpergifts" to store these commands.
The generalized command to add a command is:
/logincommand add <new group name> <command>
In this case:
/logincommand add helpergifts give %name_of_player% diamond_pickaxe
5. Give somebody the permission of the command group.
Now we have to give the permission group "Helpers" a certain permission node.
In case you use PermissionEx, the command might look like this:
/pex group Helper add logincommand.group.helpergifts
6. Further configuration:
You can find some more settings (command delay, cooldown, whether op's are exempt) in the configuration file. After making changes, issue the /logincommand reload command.
Troubleshooting
If the plugin doesn't work:
- Make sure that the player doesn't have the exempt permission node. See the Permissions section.
- On default settings, operators are exempt. If you want the plugin to affect them, set the value of "ops exempt" to "false" in the configuration file, then issue the /logincommand reload command.
Commands
Root command and aliases:
/logincommand
/lic
/lc
Reload the configuration file:
/lc reload
Add a command to a command group; (also auto-creates the group):
/lc add <group> <command>
Remove a command from a command group:
/lc remove <group> <command>
Placeholders
When you add a command and specify a placeholder, the placeholder will be replaced on every execution with its corresponding value.
Valid placeholders are:
The name of the player who joins the server:
%name_of_player%
Permissions
logincommand.admin
description: Allows you to edit and reload the config.
default: operators
logincommand.exempt
description: The plugin will ignore your login.
default: Nobody, but if you have the * permission node (for example, your Admin group has it), Bukkit will report that you have this permission as well. Use negative permission nodes to counteract this.
logincommand.group.<group>
description: Group specific permission for command execution.
default: nobody
Example config
execution delay (sec): 1
login cooldown (min): 60
configversion (don't change): 2
ops exempt: true
# when the above is true, operators will be ignored
config:
group1:
- sudo <name> warp woods
helper:
- eco give <name> 10
timestamps (auto generated): []
The effects:
Players who have the logincommand.group.group1 permission will be teleported to warp woods after 1 second of their joining, if their last login was more than 60 minutes ago.
Players with the logincommand.group.helper permission will be given 10 units of money (the same delay and cooldown applies).
I will fix it in the next release
@adventuretc
I don't think you get it? Permissions is not the issue. If I use /deop ( The Vanilla Operators ) on my Admins, they are all good. With or without the Permission. But if they are the Vanilla Operators, they get spawned like if they had the logincommand.group.quiz permission.
@adventuretc
We also added that permission, but now it is respawning us again. Group Admin is inheriting Operator. Operator is given to any OP normally.
@2Andri
Add this permission to the admin group:
logincommand.exempt
@2Andri
I think i have fixed that with - -groupmanager.noofflineperms
People with /op seems to be getting all the commands no matter what.
We have a Quiz on our server, and wanted all the people in our Quiz group (starter group) to teleport to the Quiz spawn on join. However, as an /op we are also teleported to our spawnpoint. This is quite annoying as it isn't supposed to be that way.
I made the permission: logincommand.group.quiz And added it to the Quiz group. I then used /logincmd add quiz spawn <name>
It works very well for all in the Quiz group, and the regular players aren't effected either. Only us Admins/Operators with the Vanilla OP setting.
Exactly what I need! Thanks so much! :)
@iTzBernz
option 1
If you have essentials you can set a "first spawn" in the config that has to be one of the spawns defined in spawn.yml.
option 2
If you want them to spawn to the rule room every time until they get promoted I don't recommend logincommand yet. (I will add a cooldown toggle option so it could be used for this as well, please write if you wish them to spawn there more than once until the promotion)
Hello, I want my new members to be able to spawn in a rule room, and when they are promoted they can spawn into the real spawn, is this the plugin I would use for it? (I think it is, Not 100% sure) Thanks!
For people who need more than that: CommandHelper is a macro command plugin, and you can also run commands on login with that (and much more):
http://wiki.sk89q.com/wiki/CommandHelper/
It was made by the maker of WorldEdit :)
@Marium0505
An update will be out in a few days, I will feature it, thanks :)
Can you add support for cooldowm? So a command won't be done if the players re-joins within a certain amount of time since the last time (s)he logged on.
It would be great if this was possible to decide as an option under each command.
thanks dude u are awesme!! Keep up the good work!!
Currently there is a kind of bug, that it only works well if the player has only 1 permission. I will fix it and try to add more customizable options in terms of permissions.
hurry up cant wait!
Very cool can't wait :)