Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Create antichat.lua #12

wants to merge 1 commit into from

Conversation

estorado
Copy link
Contributor

@estorado estorado commented Jun 8, 2021

No description provided.

Copy link
Member

@isRyven isRyven left a 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
Copy link
Member

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
Copy link
Member

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 = {
Copy link
Member

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.

Copy link
Member

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" }
Copy link
Member

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

@morsik morsik mentioned this pull request Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants