Jump to content

[Help]Auto Ban


Lorder

Recommended Posts

Why does not work ? I authorized

Server.lua

seriale =  
{ 
    [ 'Podszywka Mitnicka' ] = 'EC625053E762093C4DA83FC51E74425F' 
} 
  
addEventHandler ( 'onPlayerJoin', getRootElement ( ), 
    function ( _, theCurrentPlayers ) 
    local Serial = seriale[getPlayerName(theCurrentPlayers)] 
        if ( Serial ) then 
            if Serial ~= getPlayerSerial ( source ) then 
                banPlayer ( source, false, false, true, getRootElement ( ), 'Wypierdalaj kurwo !' ) 
            end 
        end 
    end 
) 

meta.xml

<meta>
    <info author="Lorder" type="script" name="AutoBan" version="1.0.0" />

	<script src="server.lua" type="client" />
</meta>

 

Edited by Lorder
Link to comment
<meta>
    <info author="Lorder" type="script" name="AutoBan" version="1.0.0" />

	<script src="server.lua" type="server" />
</meta>

 

And replace your function.

addEventHandler ( 'onPlayerJoin', getRootElement ( ), 
    function () 
    local Serial = seriale[getPlayerName(source)] 
        if ( Serial ) then 
            if Serial ~= getPlayerSerial ( source ) then 
                banPlayer ( source, false, false, true, getRootElement ( ), 'Wypierdalaj kurwo !' ) 
            end 
        end 
    end 
) 

 

Edited by NeXuS™
  • Like 1
Link to comment
6 minutes ago, NeXuS™ said:

<meta>
    <info author="Lorder" type="script" name="AutoBan" version="1.0.0" />

	<script src="server.lua" type="server" />
</meta>

 

And replace your function.


addEventHandler ( 'onPlayerJoin', getRootElement ( ), 
    function () 
    local Serial = seriale[getPlayerName(source)] 
        if ( Serial ) then 
            if Serial ~= getPlayerSerial ( source ) then 
                banPlayer ( source, false, false, true, getRootElement ( ), 'Wypierdalaj kurwo !' ) 
            end 
        end 
    end 
) 

 

Add serial ?

Link to comment

Can you write down your name copied from the settings and your serial? (F8 -> serial)

serialList =  
{ 
    ["#NeXuS"] = "73B520027203B67334A182ED91E6CD54" 
} 

addEventHandler("onPlayerJoin", getRootElement(), function()
	local selectedSerial = serialList[getPlayerName(source)] 
	if (selectedSerial) then 
		if selectedSerial ~= getPlayerSerial(source) then 
			banPlayer ( source, false, false, true, getRootElement ( ), 'Wypierdalaj kurwo !' ) 
		end 
	end 
end) 

This one works totally fine for me.

Edited by NeXuS™
  • Like 1
Link to comment
3 minutes ago, NeXuS™ said:

Can you write down your name copied from the settings and your serial? (F8 -> serial)

seriale =  
{ 
    [ 'Podszywka Mitnicka' ] = 'EC625053E762093C4DA83FC51E74425F' 
} 
  
addEventHandler ( 'onPlayerJoin', getRootElement ( ), 
    function () 
    local Serial = seriale[getPlayerName(source)] 
        if ( Serial ) then 
            if Serial ~= getPlayerSerial ( source ) then 
                banPlayer ( source, false, false, true, getRootElement ( ), 'Wypierdalaj kurwo !' ) 
            end 
        end 
    end 
) 

I did so

Link to comment
2 minutes ago, NeXuS™ said:

Jees, I dont understand you dude. If someone else comes up with your name with a different serial, then ban them?

I forbid someone to remove the ban from someone admin wants to be automatically banned when they enter the server

Link to comment
6 minutes ago, NeXuS™ said:

Try this one:
 


serialList = 
{ 
	["enteryourserialhere"] = true,
	["anotherserialhere"] = true
} 

addEventHandler("onPlayerJoin", getRootElement(), function()
	local selectedSerial = serialList[getPlayerSerial(source)] 
	if (autoBan) then 
		banPlayer ( source, false, false, true, getRootElement ( ), 'Wypierdalaj kurwo!' ) 
	end 
end) 

Not working

Link to comment

My bad.

serialList = 
{ 
	["yourserailhere"] = true,
	["anotherserialhere"] = true
} 

addEventHandler("onPlayerJoin", getRootElement(), function()
	local autoBan = serialList[getPlayerSerial(source)] 
	if (autoBan) then
		banPlayer ( source, false, false, true, getRootElement ( ), 'Wypierdalaj kurwo!' ) 
	end 
end) 

This one works totally fine.

  • Like 1
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...