Add command "query" to check if a name is whitelisted
This commit is contained in:
parent
3efef432ac
commit
fb0b02b843
@ -17,6 +17,7 @@ Commands:
|
||||
- Manages the whitelist.
|
||||
- Without parameters: displays all whitelisted names
|
||||
- commands:
|
||||
- *query:* checks if a name is whitelisted
|
||||
- *add:* adds a name to whitelist
|
||||
- *remove:* removes a names from whitelist
|
||||
- *name:* name of player
|
||||
|
1
TODO.txt
1
TODO.txt
@ -1,3 +1,2 @@
|
||||
|
||||
TODO:
|
||||
- add command parameter "query" to check for a whitelisted name
|
||||
|
@ -4,6 +4,7 @@ v1.1
|
||||
- changed license to MIT
|
||||
- added localization support
|
||||
- executing "/whitelist" without parameters displays all whitelisted names
|
||||
- added command "query" to check if a name is whitelisted
|
||||
|
||||
v1.0
|
||||
----
|
||||
|
11
init.lua
11
init.lua
@ -74,7 +74,16 @@ core.register_chatcommand("whitelist", {
|
||||
return false, S("Must supply name parameter.")
|
||||
end
|
||||
|
||||
if action == "add" then
|
||||
if action == "query" then
|
||||
local msg
|
||||
if whitelist[whitename] then
|
||||
msg = S("@1 is already on the whitelist.", whitename)
|
||||
else
|
||||
msg = S("@1 is not on the whitelist.", whitename)
|
||||
end
|
||||
|
||||
return true, msg
|
||||
elseif action == "add" then
|
||||
if whitelist[whitename] then
|
||||
return false, S("@1 is already on the whitelist.", whitename)
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user