Jump to content

change from kickPlayer to BanPlayer


Quited

Recommended Posts

Posted

Hi , i have code

but i don't know how to change the punish from kick to ban

and i want the ban "serial is banned"

code :

Command = { 
    ['aexec']   = true; 
    ['delaccount']      = true; 
    ['chgpass']     = true; 
    ['shutdown']    = true; 
    ['stopall']     = true; 
    ['stopmode']    = true; 
    ['stopmap']     = true; 
    ['loadmodule']      = true; 
    ['crun']    = true; 
    ['run']     = true; 
    ['srun']    = true; 
    ['execute']     = true; 
    ['install']     = true; 
    ['speed']   = true; 
    ['cv']      = true; 
    ['car']     = true; 
    ['giveweapon']      = true; 
    ['give']    = true; 
    ['wp']      = true; 
    ['ap']      = true; 
    ['grav']    = true; 
    ['votekick']    = true; 
    ['voteban']     = true; 
    ['votekill']    = true; 
    ['votemode']    = true; 
    ['votemap']     = true; 
    ['logout']      = true; 
    ['msg']     = true; 
    ['freeze']      = true; 
    ['shout']   = true; 
    ['setmoney']    = true; 
    ['setskin']     = true; 
    ['sethealth']   = true; 
    ['setarmour']   = true; 
    ['warp']    = true; 
    ['givevehicle']     = true; 
    ['setinterior']     = true; 
    ['setdimension']    = true; 
    ['setpassword']     = true; 
    ['setgamespeed']    = true; 
    ['setgravity']      = true; 
    ['nick']    = true; 
    ['delete']      = true; 
    ['destroyteam']     = true; 
    ['createteam']      = true; 
    ['setweather']      = true; 
    ['setgame']     = true; 
    ['chgmypass']   = true; 
    ['giveadmin']   = true; 
    ['runcode']     = true; 
    ['giveconsole']     = true; 
    ['webadmin']    = true; 
    ['set']     = true; 
    ['setTimer']    = true; 
    ['setGameType']     = true; 
    ['setgroup']    = true; 
    ['stop']    = true; 
    ['deleteall']   = true; 
    ['ss']      = true; 
    ['wt']      = true; 
    ['warpto']      = true; 
    ['sp']      = true; 
    ['setpos']      = true; 
    ['st']      = true; 
    ['sw']      = true; 
} 
  
addEventHandler ( 'onPlayerCommand',getRootElement ( ), 
    function ( cmd ) 
        if Command [ cmd ] then 
            cancelEvent (   ); 
            kickPlayer ( source, "Don't Hack Server !" ); 
        end; 
    end 
); 

  • Moderators
Posted

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

  • Moderators
Posted
banPlayer ( source, false,false,true, nil,"Don't Hack the Server !", 0 ) 

Just put this in place of the kickPlayer and add admin rights for the resource.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted
banPlayer ( source, false,false,true, nil,"Don't Hack Server !", 0 ) 

Just put this in place of the kickPlayer and add admin rights for the resource.

are you sure that ban serial ? , anyway thanks

  • Moderators
Posted

yes,

banPlayer ( player,IP, Username, Serial,

4 argument is true.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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...