Basic Admin System

Retard

  • Full Member
  • Why so rude,be more rude
  • Posts: 104
Basic Admin System
« on December 14th, 2017, 02:32 PM »Last edited on December 16th, 2017, 02:26 AM
This basic admin system contains everything.You can use /admin <password> to login as admin.
This code is tested and works.It is made for a blank server.
Credits : @[VF]4L14HM3D ( it was extracted by me ) from  HERE
Place this at the top of your Script
Code: [Select]
const AdminPassword = "password" //You can edit this password
Now add this after that on the top of your Script
Code: [Select]
class PlayerInfo
{
admin = false;
}
Now add this in  function onScriptLoad( )
Code: [Select]
pinfo <- array(GetMaxPlayers(), null);
Now add this in functions.nut  ( If you dont have this add this at the last of your script )
Code: [Select]
function PlayerIsAdmin(player)
{
if(pinfo[player.ID].admin == true) return 1;
else return 0;
}
Add this in Function onPlayerJoin
Code: [Select]
pinfo[player.ID] = PlayerInfo();
Add This in function onPlayerCommand
Code: [Select]
else if (cmd == "admin")
{
if(!text) ClientMessage( "-> Error: [#ffd700]Please type /admin <admin password>", player,255,0,102);
else if ( text != AdminPassword ) ClientMessage( "-> Error: [#ffd700]Invalid PASSWORD.", player,255,0,102);
else { ClientMessage( "-> [#00ffff]Welcome admin :). You are logged as admin server.", player,255,0,102); pinfo[player.ID].admin = true; }
}
Now the commands you want to make admin commands simply add
Code: [Select]
if (!PlayerIsAdmin(player))
Example
Code: [Select]
else if ( cmd == "kick" )
    {
       if (!PlayerIsAdmin(player)) ClientMessage("-> [#ccff00]You must be an admin to use this command.", player, 255,0,102);
        else if ( !text ) ClientMessage("-> Error - Invalid Format.[#ccff00] /kick <player> <reason>", player, 255,0,102);
        else
         {
            if ( i < 2 ) ClientMessage("-> Error - Invalid Format.[#ccff00] /kick <player> <reason>", player, 255,0,102);
            else
            {
                local plrr = GetPlayer( GetTok( text, " ", 1 ) ), reason = GetTok( text, " ", 2, i );
                if ( !plrr ) PrivMessage( player,"Error - Invalid Nick/ID.");
                else if ( plrr.ID == player.ID ) PrivMessage( player,"Error - You can't /kick yourself.");
                else
                {
ClientMessageToAll( "-> [#ccff00]Admin " + player + " kicked:[ " + plr + " ] Reason:[ " + reason + " ]" ,255,0,102);                   
                    KickPlayer( plrr ); Announce( "Bye bye", plrr, 3 );
                    }
                }
            }
        }       



Just another retard roaming around.

umar4911

  • Hero Member
  • Creating own server!
  • Posts: 511
Re: Basic Admin System
« Reply #1, on December 14th, 2017, 02:46 PM »
Good effort but a little basic. I prefer using database to store player names who are admin
I am gamer, programmer and hacker. Try to find me!
xD

!

  • Sr. Member
  • Don't feel shy while zooming on h*r... >>zeus#5155
  • Posts: 380
Re: Basic Admin System
« Reply #2, on December 14th, 2017, 05:35 PM »Last edited on December 15th, 2017, 10:32 AM
At least showed some of your effort good keep it up.It's is much for a newbie in starting.

Discord: zeus#5155

Mohamed

  • Full Member
  • Regards, We3da
  • Posts: 246
Re: Basic Admin System
« Reply #3, on December 14th, 2017, 06:04 PM »
Nice, But Like DataBase To Store Level in It, Every Player join Will get He's Level.
Anyways Niice Work.
Feel Free To PM Me For Any Support, I'm Care.
Anyway u can Contact Me Ingame!
Ingame Name: [AFt]We3da^
My Own Server: ViceEvil Server

=RK=MarineForce

  • Sr. Member
  • WAR IS HELL!
  • Posts: 475
Try to UnderStand ME!

Xmair

  • Wiki Contributor
  • Posts: 909
Re: Basic Admin System
« Reply #5, on December 15th, 2017, 09:40 AM »
So, will you please elaborate why is this stolen from here with no credits or mentions at all?
VU Full Member | VCCNR Developer | KTB Developer | EAD Ex-Scripter

Retard

  • Full Member
  • Why so rude,be more rude
  • Posts: 104
Just another retard roaming around.

Xmair

  • Wiki Contributor
  • Posts: 909
Re: Basic Admin System
« Reply #7, on December 15th, 2017, 10:35 AM »
Quote from [VF]4L14HM3D on December 15th, 2017, 10:22 AM
Quote from Xmair on December 15th, 2017, 09:40 AM
So, will you please elaborate why is this stolen from here with no credits or mentions at all?
It is not Stolen from there.I made it my self for your information.
Each line matches exactly like used in that script. Even the messages, you didn't even bother to modify them at least lol.
VU Full Member | VCCNR Developer | KTB Developer | EAD Ex-Scripter

Retard

  • Full Member
  • Why so rude,be more rude
  • Posts: 104
Re: Basic Admin System
« Reply #8, on December 15th, 2017, 11:22 AM »
Quote from Xmair on December 15th, 2017, 10:35 AM
Quote from [VF]4L14HM3D on December 15th, 2017, 10:22 AM
Quote from Xmair on December 15th, 2017, 09:40 AM
So, will you please elaborate why is this stolen from here with no credits or mentions at all?
It is not Stolen from there.I made it my self for your information.
Each line matches exactly like used in that script. Even the messages, you didn't even bother to modify them at least lol.
Updated Credits Given
Just another retard roaming around.

=RK=MarineForce

  • Sr. Member
  • WAR IS HELL!
  • Posts: 475
Re: Basic Admin System
« Reply #9, on December 15th, 2017, 08:20 PM »
You can Give me all admin commands

with level set level

if player cmd " games "

 /games

you need to high levele like manager id 6
Try to UnderStand ME!

DarkRaZoR^

  • Full Member
  • VC:MP Battlefield Head Developer/KF Leader
  • Posts: 227
Re: Basic Admin System
« Reply #10, on December 15th, 2017, 11:25 PM »
Quote from [VF]4L14HM3D on December 15th, 2017, 11:22 AM
Quote from Xmair on December 15th, 2017, 10:35 AM
Quote from [VF]4L14HM3D on December 15th, 2017, 10:22 AM
Quote from Xmair on December 15th, 2017, 09:40 AM
So, will you please elaborate why is this stolen from here with no credits or mentions at all?
It is not Stolen from there.I made it my self for your information.
Each line matches exactly like used in that script. Even the messages, you didn't even bother to modify them at least lol.
Updated Credits Given
Remove your nick off the credits.

Retard

  • Full Member
  • Why so rude,be more rude
  • Posts: 104
Re: Basic Admin System
« Reply #11, on December 22nd, 2017, 06:17 AM »
Quote from KuRiMi on December 15th, 2017, 11:25 PM
Quote from [VF]4L14HM3D on December 15th, 2017, 11:22 AM
Quote from Xmair on December 15th, 2017, 10:35 AM
Quote from [VF]4L14HM3D on December 15th, 2017, 10:22 AM
Quote from Xmair on December 15th, 2017, 09:40 AM
So, will you please elaborate why is this stolen from here with no credits or mentions at all?
It is not Stolen from there.I made it my self for your information.
Each line matches exactly like used in that script. Even the messages, you didn't even bother to modify them at least lol.
Updated Credits Given
Remove your nick off the credits.
I extracted it
Just another retard roaming around.

Xmair

  • Wiki Contributor
  • Posts: 909
Re: Basic Admin System
« Reply #12, on December 23rd, 2017, 05:33 AM »
Quote from [VF]4L14HM3D on December 22nd, 2017, 06:17 AM
Quote from KuRiMi on December 15th, 2017, 11:25 PM
Quote from [VF]4L14HM3D on December 15th, 2017, 11:22 AM
Quote from Xmair on December 15th, 2017, 10:35 AM
Quote from [VF]4L14HM3D on December 15th, 2017, 10:22 AM
Quote from Xmair on December 15th, 2017, 09:40 AM
So, will you please elaborate why is this stolen from here with no credits or mentions at all?
It is not Stolen from there.I made it my self for your information.
Each line matches exactly like used in that script. Even the messages, you didn't even bother to modify them at least lol.
Updated Credits Given
Remove your nick off the credits.
I extracted it
VU Full Member | VCCNR Developer | KTB Developer | EAD Ex-Scripter

Retard

  • Full Member
  • Why so rude,be more rude
  • Posts: 104
Re: Basic Admin System
« Reply #13, on December 23rd, 2017, 05:47 AM »
Quote from Xmair on December 23rd, 2017, 05:33 AM
Quote from [VF]4L14HM3D on December 22nd, 2017, 06:17 AM
Quote from KuRiMi on December 15th, 2017, 11:25 PM
Quote from [VF]4L14HM3D on December 15th, 2017, 11:22 AM
Quote from Xmair on December 15th, 2017, 10:35 AM
Quote from [VF]4L14HM3D on December 15th, 2017, 10:22 AM
Quote from Xmair on December 15th, 2017, 09:40 AM
So, will you please elaborate why is this stolen from here with no credits or mentions at all?
It is not Stolen from there.I made it my self for your information.
Each line matches exactly like used in that script. Even the messages, you didn't even bother to modify them at least lol.
Updated Credits Given
Remove your nick off the credits.
I extracted it
lol What's the need of Aamir Liaquat Hussain
Just another retard roaming around.

Alecu Madalin

  • Jr. Member
  • Posts: 92