[NOT RECOMMENDED] No Level Admin Commands

Started by Jutt, Oct 02, 2021, 12:00 PM

Previous topic - Next topic

Jutt

else if (cmd == "settime")
{
MessagePlayer("you have set the time", player);
SetHour( text.tointeger() );
}

else if (cmd == "asetweather")
{
MessagePlayer("you have set the weather", player);
SetWeather( text.tointeger() );
}

else if ( cmd == "warn" )
{
if(!text) MessagePlayer("/awarn <Player> <Reason>",player);
// else if Your Admin System
else {
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "Error: Unknow Player.", player );
{
local reason = GetTok( text, " ", 2 NumTok( text, " " ) );
if ( !reason ) MessagePlayer( "Error: Make Reason.", player );
else if ( plr.Name==player.Name ) MessagePlayer( "Error: You Can't Warn yourself.", player );
else {
local now = date();
QuerySQL( warn, "INSERT INTO warn ( Name, Reason, Admin, Day, Month, Year, Hour, Min ) VALUES ( '" + plr.Name + "', '" + reason + "', '" + player.Name + "', '" + now.day + "', '" + now.month + "', '" + now.year + "', '" + now.hour + "', '" + now.min + "' )" );
Message("Admin "+ player.Name +" Has Warned " +plr.Name+ " Reason: " +reason+ "");
}
}
}
}

else if ( cmd == "aunwarn" )
{
local q = QuerySQL( warn,  "SELECT * FROM warn WHERE Name='" + text + "'" );
if(!text) MessagePlayer("/aunwarn <Full-Nick>",player);
// else if Your Admin System
else if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer( "Error: " + text + " is not Warned.", player );
else {
QuerySQL( warn, "DELETE FROM warn WHERE Name='" + text + "'" );
Message("Admin "+ player.Name +" Has Unwarned " +text+ "");
}
}

else if ( cmd == "acheckwarn" )
{
if(!text) MessagePlayer("/acheckwarn <Full-Nick>",player);
// else if Your Admin System
else {
local q = QuerySQL( warn,  "SELECT * FROM warn WHERE Name='" + text + "'" );
if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer( "Error: " + text + " is not Warned.", player );
else
{
MessagePlayer( "Player Name Found!", player );
MessagePlayer( "Player : " + text, player );
MessagePlayer( "Warned by : " + GetSQLColumnData( q, 2 ), player );
MessagePlayer( "Reason : " + GetSQLColumnData( q, 1 ), player );
MessagePlayer( "Time Warned: Day: " + GetSQLColumnData( q, 3 ) + " Month: " + GetSQLColumnData( q, 6 ) + " Year: " + GetSQLColumnData( q, 5 ) + " Hour: " + GetSQLColumnData( q, 6 ) + " Min: " + GetSQLColumnData( q, 7 ) + "", player );
}
}
}

if ( cmd == "aban" )
        {
     if ( !text ) MessagePlayer( "[Syntax] - /" + cmd + " <Nick/ID> <Reason>", player );
else {
 local plr = GetPlayer( GetTok( text, " ", 1 ) );
    if ( !plr ) MessagePlayer( "[Error] - Unknown Player..", player );
    else {
            local reason = GetTok( text, " ", 2 NumTok( text, " " ) );
            local ip = plr.IP;
            local sub = split( ip, "." );
             if ( reason == null ) reason = "None";
             QuerySQL( db, "INSERT INTO SubBans ( Name, IP, Admin, Reason ) VALUES ( '" + plr.Name + "', '" + sub[0].tofloat() + "." + sub[1].tofloat() + "', '" + player.Name + "', '" + reason + "' )" );
            Message( "[#EE82EE]** Admin " + player.Name + " Banned " + plr.Name + " Reason: " + reason );
    KickPlayer( plr );
    }
    }
 }

else if ( cmd == "aunban" )
 {
 local q = QuerySQL( db,  "SELECT * FROM SubBans WHERE Name='" + text + "'" );
     if ( !text ) MessagePlayer( "[Syntax] - /" + cmd + " <Nick Full>", player );
    else if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer( "[Error] - " + text + " is not Banned.", player );
    else {
    QuerySQL( db, "DELETE FROM SubBans WHERE Name='" + text + "'" );
    Message( "[#EE82EE]** Admin " + player.Name + " UnBanned Player [ [#FFA500]" + text + " [#EE82EE]]." );
 }
 }
}

else if ( cmd == "kick" )
{
if (!text) MessagePlayer("/kick <Name> <Reason>")
else
{
local plr = GetPlayer(GetTok(text, " ", 1 ) )
local reason = GetTok( text, " ", 2 NumTok( text, " " ) );
if (!plr) print("Player was not found.")
if (!reason) print("No reason was put in.")
else
{
Message("[#00ff00]Kick : [#ffffff]admin has kicked "+plr.Name+" from the server. Reason : "+reason)
plr.Kick()
EchoMessage("Console admin has kicked "+plr.Name+" from the server. Reason : "+reason)//You may remove it if you don't have an echo.
}
}
}

   else if(cmd == "get") {
      if(!text) MessagePlayer( "Error - Correct syntax - /aget <Name/ID>' !",player );
      else {
         local plr = FindPlayer(text);
         if(!plr) MessagePlayer( "Error - Unknown player !",player);
         else {
            plr.Pos = player.Pos;
            MessagePlayer( "[admin] " + plr.Name + " was sent to " + player.Name, player );
         }
      }
   }

if ( cmd == "reload" )
{
 ReloadScripts();
   
}

else if ( cmd == "getcar" )
    {   
            if ( text )
          {
          local veh = FindVehicle( text.tointeger() );
          veh.Pos = Vector( ( player.Pos.x + 2 ), player.Pos.y, ( player.Pos.z ) );
           MessagePlayer( "[#ffffff][INFO][#00ff00]---> You have spawned car ID : [ " + veh.ID + " ).", player );
          }
          else MessagePlayer( "[#ffffff][INFO][#00ff00] Type /getcar <car id >.", player );
           return 1;
    }
Jutt

DizzasTeR