husnainaligee

  • Newbie
  • Posts: 16
Simple ban system
«  »Last edited
Post this script in Main.nut
If you have Commands.nut paste it in commands .nut

Code: [Select]
else if ( cmd == "ban" )
    {
    if ( stats[ player.ID ].Reg == false ) return MessagePlayer( "[#95fcff]WARN > [#E0E0E0]You're not registered.", player );
else if ( stats[ player.ID ].Log == false ) return MessagePlayer( "[#95fcff]WARN > [#E0E0E0]You're not Logged-In", player );
     if (status[player.ID].AdminLevel >= 1)
  if ( !text) MessagePlayer ( " [#95fcff]WARn > [#E0E0E0}Code, "/" + cmd + " <Name> <Reson>", player );
 else
 {
      local plr = GetPlayer( GetTok( text, " ", 1 ) );
  if ( !plr ) MessagePlayer ("[#95fcff]WARN > [#E0E0E0]Unkown ID/Name.", player )
  else
  {
         local reson = GetTok( text, " ", 2 NumTok( text, " " ) );
   if ( reson == null ) reson = "NO_Reson";
   Ban ( plr, player, reson ) ;
  }
  }
 }

MRSK143

  • Jr. Member
  • Posts: 65
Re: Simple ban system
« Reply #1,  »Last edited
nmm your script is not right bruh you should fix your script

husnainaligee

  • Newbie
  • Posts: 16
Re: Simple ban system
« Reply #2,  »Last edited
bro its simple ban cmd you can put your name in
If ( Player.Name == "Put your name here" )
and try this cmd into your server its works and for admin level some one server don't have admin level so what he do its a simple ban system for simple peoples only u can use this command not all.

MRSK143

  • Jr. Member
  • Posts: 65
Re: Simple ban system
« Reply #3,  »Last edited
Quote from husnainaligee on May 26th, 2021, 03:32 PM
bro its simple ban cmd you can put your name in
If ( Player.Name == "Put your name here" )
and try this cmd into your server its works and for admin level some one server don't have admin level so what he do its a simple ban system for simple peoples only u can use this command not all.
This is right code bro you can also try

Code: [Select]
else if ( cmd == "ban" )
    {
    if ( stats[ player.ID ].Reg == false ) return MessagePlayer( "[#95fcff]WARN > [#E0E0E0]You're not registered.", player );
else if ( stats[ player.ID ].Log == false ) return MessagePlayer( "[#95fcff]WARN > [#E0E0E0]You're not Logged-In", player );
     if(status[player.ID].AdminLevel >= 1)
  if ( !text ) MessagePlayer( "Syntax, /" + cmd + " <Nick/ID> <Reason>", player );
 else
 {
      local plr = GetPlayer( GetTok( text, " ", 1 ) );
   if ( !plr ) MessagePlayer ("[#E0E0E0]Unkown ID/Name.", player )
   else
   {
          local reson = GetTok( text, " ", 2 NumTok( text, " " ) );
     if ( reason == null ) reason = "None";
     Ban ( plr, player, reason ) ;
   }
  }
 }

husnainaligee

  • Newbie
  • Posts: 16
Re: Simple ban system
« Reply #4,  »
Good man You is right i see And i put Admin level okay Now i check its worked but you do mistake in
if(status[player.ID].AdminLevel >= 1)
if (status[player.ID].AdminLevel >= 1)
now see cmd is worked

MRSK143

  • Jr. Member
  • Posts: 65
Re: Simple ban system
« Reply #5,  »
Quote from husnainaligee on May 26th, 2021, 03:43 PM
Good man You is right i see And i put Admin level okay Now i check its worked but you do mistake in
if(status[player.ID].AdminLevel >= 1)
if (status[player.ID].AdminLevel >= 1)
now see cmd is worked
No Problem Buddy 8)

cowboy

  • Newbie
  • Posts: 7
Re: Simple ban system
« Reply #6,  »
you need to add the function Ban ( plr, player, reason ) ;  without it your command won't work

Gito Baloch

  • Full Member
  • Posts: 145