Jump to content

Why not working antitag script?


Turbe$Z

Recommended Posts

local blockedTags = { "[VIP]", "[UltraVIP]", "[A]", "[M]", "[SM]" };

addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource() ),
	function ()
		for i, p in ipairs ( getElementsByType ( "player" ) ) do
			local tempName = getPlayerName ( p );

			for x = 1, #blockedTags do
				if ( string.find ( tempName, blockedTags [ i ], 1, true ) ~= nil ) then
					kickPlayer ( source, "Rang tag nem lehet a nevedben! Szedd le! Köszikee :D" );
				end
			end
		end
	end
);

addEventHandler ( "onPlayerJoin", root,
	function ()
		local name = getPlayerName ( source );

		for i = 1, #blockedTags do
			if ( string.find ( name, blockedTags [ i ], 1, true ) ~= nil ) then
				kickPlayer ( source, "Rang tag nem lehet a nevedben! Szedd le! Köszikee :D" );
			end
		end
	end
);

addEventHandler ( "onPlayerChangeNick", root,
	function ( _, newNick )
		for i = 1, #blockedTags do
			if ( string.find ( newNick, blockedTags [ i ], 1, true ) ~= nil ) then
				kickPlayer ( source, "Rang tag nem lehet a nevedben! Szedd le! Köszikee :D" );
			end
		end
	end
);

server.lua:9: bad argument #2 to 'find' (string expected, got nil) why??

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...