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 Sporos, 13 December, 2008, 18:59:59

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Sporos

hi , is my first request in here so will say it simple :=)
Wonder if its possible to have this feature, Set some Prefix users must have infront their nick so can join hub (multi-option maybe)
Would be nice to see it in some release :=) ;D

ATAG

#1
--[[ 

	Prefix checker Lua5.1 API2 by ATAG

	Messages are from "NICK CHECKING STUFF" by bastya_elvtars

]]

--// Setup start

-- Define what prefixes can be used.
-- Use just uppercase letters !!!
PrefixesNeeded = {
	"[HUN]",
	"(HUN)",
}

-- Values: 1 to disconnect, 2 to redirect
BadPrefixToDo = 1

-- redirect address ( see above )
RedirectAddress = "example.com:411"

--// Setup end

function OnStartup()
		sBot = SetMan.GetString(21)
	 	PrefixList = [[
	 	
====================
]] .. table.concat(PrefixesNeeded, " \r\n") .. [[
====================

Note that the check is _NOT_ case sensitive, a.k.a. [prefix] and [PREFIX] are equal.]]
end
	
function MyINFOArrival( user, data )
 	if user.iProfile > -1 or Core.GetUserValue( user, 9 ) then return end
 	
 	local nick = user.sNick:upper()
 	
 	if nick:find("PINGER") or nick:find("HUBLIST") then return end
 	
	for i, prefix in ipairs(PrefixesNeeded) do
 			if nick:sub( 1, #prefix ) == prefix then return end
	end
 	
 	if BadPrefixToDo ~= 2 then
		Core.SendToUser(user,"<"..sBot.."> Bad/missing prefix, use one of these: "..PrefixList)
		Core.Disconnect(user)
	else
		Core.Redirect(user, RedirectAddress, "Bad/missing prefix, use one of these: "..PrefixList)
	end
end

Sporos

i have set the prefix i want unreg users must have to login , but no result users can still connect without the prefix, any idea ATAG ( Yours i use ) ??

Sporos

i get this error : Syntax error C:\Ptokax\scripts\Prefix.lua:43 attempt to call global 'ipirs' (a nil value)


ATAG


Sporos

i fix it , thanks for the script :D
Will test it for ops and vips join without tag hope it works :D

Zlobomir

Also, please include option for 2+ prefixes, if not done already. In my hub, f. ex. boys have one prefix, girls have another one.

SMF spam blocked by CleanTalk