Simple ban system

Started by husnainaligee, May 26, 2021, 02:19 PM

Previous topic - Next topic

husnainaligee

Post this script in Main.nut
If you have Commands.nut paste it in commands .nut

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

#1
nmm your script is not right bruh you should fix your script
@mR_Sk@

husnainaligee

#2
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

#3
Quote from: husnainaligee on May 26, 2021, 02:32 PMbro 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

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 ) ;
   }
  }
 }
@mR_Sk@

husnainaligee

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

Quote from: husnainaligee on May 26, 2021, 02:43 PMGood 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)
@mR_Sk@

cowboy

you need to add the function Ban ( plr, player, reason ) ;  without it your command won't work

Gito Baloch

Programming is the language I speak, the world I shape, and the future I code