PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: BBD on 26 June, 2005, 21:00:10

Title: Conversion Request
Post by: BBD on 26 June, 2005, 21:00:10
--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
Title:
Post by: Madman on 26 June, 2005, 21:23:14
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
Title:
Post by: BBD on 26 June, 2005, 21:33:42
Thanks mate :D
Title:
Post by: Madman on 26 June, 2005, 23:09:22
np ;)