Jump to content

[Help]Ban System


Lorder

Recommended Posts

Just when player joins game do cancelEvent() then set his camera location wherever you want and add that information on screen.

edit: actually nvm, you will have to make completly custom ban system seprate from MTA's built-in.

Edited by Fist
Link to comment

 

5 minutes ago, Fist said:

Just when player joins game do cancelEvent() then set his camera location wherever you want and add that information on screen.

edit: actually nvm, you will have to make completly custom ban system seprate from MTA's built-in.

Code pls 

Link to comment
  • MTA Anti-Cheat Team
On 2017-2-22 at 09:57, Fist said:

you will have to make completly custom ban system seprate from MTA's built-in.

The goal should then be preventing the player from doing anything useful on your server such as playing, giving them nothing to interact with as that matches the purpose of a ban. So then, any resource from A to Z making part of your gamemode should be intercepted if the player is ''banned'' through this system, aka from the chat to spawning should be cancelled/disabled if the ''banned'' player is listed in your script's ban data storage.

So the principle isnt all that complicated, just add a check on all existing scripts that give interactive experience, or spawning as player, if their serial is listed they are 'banned' and you just draw them the screen showing ban details and acknownledgement they are banned. Don't give them anything but that and they can just idle and stare at their fate.

Spawning them inside a jail and taking away any interaction or usage of scripts can be an alternative that comes down to the same, if you're looking for a replacement of the MTA ban system with something like this.

Edited by Dutchman101
  • Like 1
Link to comment

You have no idea of how diffucult can be doing this for a starter, before asking very complex stuff like this I strongly recommend you to get some knowledge about doing very basic scripts and programming, learn basics like using; if conditioning, for loops, tables and variables and you'll snowball to the knowledge of scripting in less time than you think.

Edited by ManeXi
Link to comment
12 hours ago, Dutchman101 said:

The goal should then be preventing the player from doing anything useful on your server such as playing, giving them nothing to interact with as that matches the purpose of a ban. So then, any resource from A to Z making part of your gamemode should be intercepted if the player is ''banned'' through this system, aka from the chat to spawning should be cancelled/disabled if the ''banned'' player is listed in your script's ban data storage.

So the principle isnt all that complicated, just add a check on all existing scripts that give interactive experience, or spawning as player, if their serial is listed they are 'banned' and you just draw them the screen showing ban details and acknownledgement they are banned. Don't give them anything but that and they can just idle and stare at their fate.

Spawning them inside a jail and taking away any interaction or usage of scripts can be an alternative that comes down to the same, if you're looking for a replacement of the MTA ban system with something like this.

yeah, but is it possible to cancel kick on player joins if he's banned? If so then it's not that complicated.

Link to comment
setElementData ( source , "setPlayerBan", true ) 

Use This In Code Ban The Player , Change Source To Definition The Player ,

Save The Data In SQL And Save On Serial ,

The Code For Close Key If His Data , 

buttons = { 
    ['F1'] = true, 
    ['F2'] = true, 
    ['F3'] = true, 
    ['F4'] = true, 
    ['F5'] = true, 
    ['F6'] = true, 
    ['F7'] = true, 
    ['F8'] = true,
    ['F9'] = true,
    ['J'] = true,
    ['T'] = true,   
} 
  
addEventHandler( 'onClientKey', root, 
  function (button , prees) 
    if prees and getElementData(localPlayer,"setPlayerBan") == true then 
        if buttons[button] then 
            cancelEvent() 
        end 
    end 
end) 

 

If Not Bind Key F8 , The Code For Cancel Your Command In F8 , 

local Cmd = { "showchat" , "register" , "login" )

addEventHandler("onPlayerCommand", root, 
function( cmd )
for _,v in iprise ( Cmd ) do
if cmd  == v then 
cancelEvent() 
        end 
    end 
end)

:)

Link to comment
  • MTA Anti-Cheat Team
13 hours ago, Fist said:

yeah, but is it possible to cancel kick on player joins if he's banned?

You're completely on the wrong track, TS is not asking to cancel a ban-''kick'' when the ban system got that player as banned, nor if you meant to cancel-kick joins (I wouldnt be surprised if you mean this as your other comments also make little sense) as he wants the players to persist while drawing that information screen about ban details. I've read your other replies in here and I don't think its really contributing

Edited by Dutchman101
  • 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...