-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create antichat.lua #12
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well that's some weird script! Not sure if it's in the interest of the collection!
function et_InitGame() | ||
et.RegisterModname(modname.." "..version) | ||
end | ||
-- Antichat by Ryven |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait what? I have no memory of this script D:
function et_ClientCommand(clientNum, command) | ||
if contains(blackList, command) then | ||
local arg = et.trap_Argv(1) | ||
if not contains(whitelist, arg) then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work in case shrub command will have arguments. Argv 1 will return full text string passed to say
or other command, not just the first word of it, instead you would have to partially match the sub string.
-- Allow only wolfadmin commands to be passed | ||
|
||
local blackList = { "say", "say_team", "say_buddy", "say_teamnl", "m", "pm" } | ||
local whitelist = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the point in hardcoding wolfadmin stuff, like why being responsible for maintaining the list? Instead you could just suggest people to put wofladmin first to load in the lua modules list, then it will be able to parse its own stuff first, then passing control further here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, there is blackList
with uppercase L
and also whitelist
with lowercase l
. This should be standarized to lowercase probably ;)
-- Antichat by Ryven | ||
-- Allow only wolfadmin commands to be passed | ||
|
||
local blackList = { "say", "say_team", "say_buddy", "say_teamnl", "m", "pm" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this mod could be effectively called vsay fest :D
No description provided.