Nick Prefix
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Nick Prefix

Started by moo, 05 December, 2007, 22:23:55

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

moo

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  ::)

CrazyGuy

#1
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,
}

moo

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 !

CrazyGuy

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

moo

thank you  a lot guys ....you really helped me !!!
  ;D  ;D  ;D

moo

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]

moo


moo

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 !

SMF spam blocked by CleanTalk