• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

if name contains

Xagul

deathzot.net
Joined
Jun 30, 2008
Messages
1,294
Solutions
3
Reaction score
1,037
Hello, I was wondering if there would be a way to make a script to determine if a players name contains certain character strings for example:

Code:
if getCreatureName(cid) == "Administrator" then
//code
end


Now that works if you want to sit and think of 1000 possibility's but what about using wildcards? Maybe sumthing like this:

Code:
prohibited = "Admin~"

if getCreatureName(cid) == prohibited then
//code
end

I know this is not how you would have to do it however I have no idea how to go about using wildcards in this way, if anyone knows how it would be nice.

In the end really what matters is that if a player logs into a server with a name containing "GM, Admin, SGM" they should automatically be kicked (however I can handle that stuff I just need a script to determine if a name contains those words)
 
Code:
if(string.find(getCreatureName(cid), "admin") ~= nil) then
	action()
end
or not
Code:
local name = "Adminstrator"
if getCreatureName(cid) == name:gsub("(%d)(%d)(%d)", name:len() or string.upper or string.lower) then
	print("Fuck no.")
end
 
Yea the aac blocks some of them but you know how noobs are... they see like CON and think its a position... lol or anything related to a staff position that they might have seen in the past. Also people find stupid ways around it like for example GM is blocked but you can put Gmr and such
 
Code:
local blocked = {"admin", "gm", "con", "cm"}
function onLogin(cid)
	for _, block in ipairs(blocked) do
		if(string.find(getCreatureName(cid):lower(), block) ~= nil) then
			doPlayerPopupFYI(cid, "Asta la vista!")
			return false
		end
	end
	return true
end
 
if ur using an AAC post the .php file that forbidds these "some names" u said or just add some names yourself
 
Ah I am not using a website for account creation, just usin the ingame :p I could check out the source for the filters but I am going to make it auto ban them ingame to set an example for other people (because its annoying)


Edit:

@Diath: will test that now :D
 
Back
Top