PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: Ubikk on 07 August, 2005, 17:31:15

Title: very simple script :)
Post by: Ubikk on 07 August, 2005, 17:31:15
All I need is a simple script that forces users to have a decent  nickaname. The script should 2 things :)

1. the first char of a user's nickname must always be a letter (lowercare or uppercase it doesn't matter)
2. The only exception to the above rule is this char "["

I really need this script because lots of users enter my hub with nicknames like "..John" or "!#Marie" only to see themself at the top of the userlist.. it's really frustrating :)

I hope you guys understood my request.. if not, feel free to ask me any questions u like ;)
Title: bad nick
Post by: ?Tr??T_???? on 07 August, 2005, 19:19:30
why u dont put these symbols in bad nicknames list?
Title:
Post by: Madman on 07 August, 2005, 21:07:15
-- Bad 1st Letter
-- Made by Madman
-- Request by Ubikk

function NewUserConnected(curUser)
Passed = 0 -- Passed is 0
local FirstLetter = string.sub(curUser.sName,1,1) -- Get first letter
for I=1, table.getn(Good) do -- Read the table
if string.lower(FirstLetter) == string.lower(Good[I]) then -- Try 2 find user's first letter in table
Passed = 1 -- We did
break -- Stop read table
end
end
-- We didnt find first letter in table, so Passed is still 0
if Passed == 0 then
curUser:SendData(frmHub:GetHubBotName(), "Your nick start with an invaild char, please only use a-z as first letter")
curUser:Disconnect() -- Disconnect
end
end

Good = { "[", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", }

This should work...
Title:
Post by: Ubikk on 08 August, 2005, 13:18:57
The script works excellent !  :D
Thank you so much  :rolleyes: