Hi i need a script to do the following :
Do not allow a user to connect if he doesn't have before his nick a tag like this
[Fxx]Nick ...where xx is the second group of digits from his ip ...
For example .... if Harold wanna connect to my hub and his ip is 79.20.255.255 he will not be able to connect to my hub until he doesn't have this nick [F20]Harold...and a message will appear to him ... "You're nick must be like this :[Fxx]nick.
I'll be more then happy if you will help me ::)
NewUserConnected = function(User)
local _,_,sReqPref = User.sIP:find("%d+%.(%d+)%.%d+%.%d+")
local UserNick = tAPI.GetNick(User)
if UserNick:find("^%[%F"..sReqPref.."%]") == nil then
tAPI.RemoveUser(User, "Your nickname must start with [F"..sReqPref.."] . Please fix this and return")
end
end
UserConnected = NewUserConnected
tAPI = {
["GetNick"] = function(User)
if Core then
return User.sNick
else
return User.sName
end
end,
["RemoveUser"] = function(User,sMessage)
if Core then
Core.SendToUser(User, "<"..SetMan.GetString(21).."> "..sMessage.."|")
Core.Disconnect(User)
else
User:SendData(frmHub:GetHubBotName(),sMessage)
User:Disconnect()
end
end,
}
Hi CrazyGuy ... I just tried to use the script and it's not working ... users can still connect without prefix.
I'm getting this message in ptokax script console :
[05:50] Syntax ...s and Settings\user\D:\Ptokax\scripts\Prefix.lua:2: attempt to index field `sIP' (a string value)
I'm using Ptokax 0.3.5.0 !
Quote from: moo on 06 December, 2007, 16:58:03
Hi CrazyGuy ... I just tried to use the script and it's not working ... users can still connect without prefix.
I'm getting this message in ptokax script console :
[05:50] Syntax ...s and Settings\user\D:\Ptokax\scripts\Prefix.lua:2: attempt to index field `sIP' (a string value)
I'm using Ptokax 0.3.5.0 !
Please upgrade to 0.3.6.0
thank you a lot guys ....you really helped me !!!
;D ;D ;D
I have just one more problem: Can you adjust the script to allow users with [Fxx] and [fxx]...because it's not working with [fxx]
tx a lot mutor ;)
Can you pls make one more change ! Only master and operators are allowed to connect to the hub without a tag ! And i want 3 more profiles to be able to do that : Vip's and lets say : Profile 1 and Profile 2 ...i'll change the name of it later !