--Allow Nicks 1.02
--by Mutor The Ugly 9/18/04
--Denies login to users without nick prefix
--
--
--User Settings-------------------------------------------------------------------------------------
-- Set accepted prefixes here
prefix = {
"[MBR]",
"[SP]",
"[MOD]",
}
--End User Settings----------------------------------------------------------------------------------
function NewUserConnected(user)
SetTimer(2000)
UserPrefix = 0
for i=1, getn(prefix) do
if (strsub(strlower(user.sName),1,strlen(prefix[i])) == strlower(prefix[i])) then
UserPrefix = 1
break
end
end
if UserPrefix ~= 1 then
local which = ""
for i, v in prefix do
which = which..v.." , "
end
user:SendData("\r\n\r\n\tThis hub requires a username prefix\r\n\tAcceptable pefixes are: "..which.."\r\n")
StartTimer() --Pause a moment before disconnect
user:Disconnect()
StopTimer()
end
end
OpConnected = NewUserConnected -- Check Ops for prefix, comment to disable
Could anyone change to LUA5 please
Thanks in advance
for i=1, getn(prefix) do
Change that to this
for i=1, table.getn(prefix) do
And this
if (strsub(strlower(user.sName),1,strlen(prefix[i])) == strlower(prefix[i])) then
for this
if (string.sub(string.lower(user.sName),1,string.len(prefix[i])) == string.lower(prefix[i])) then
Thanks mate :D
np ;)