Level command

Started by KAKAN, Sep 07, 2015, 05:59 PM

Previous topic - Next topic

KAKAN

This is a sh!t cmd :P, anyone can make it easily who knows how to...
Additional you can add a array to make your level HIDDEN
Anyways here is the simple CMD, Its fully tested, if u want the additional think, you may post a YES, I want it
Here is the command:-
function onScriptLoad()
{
ahide<- array(GetMaxPlayers(), false)
}

function onPlayerCommand( player, command, arguments )
{
    local cmd, text;
        cmd = command.tolower();
        text = arguments;

if ( cmd == "level" || cmd == "lvl")
{
if (!text) PrivMessage(player,"Use " + cmd + " <player Name/ID" );
else
{
local plr, level
plr = GetPlayer(GetTok(text, " ", 1))
level = stats[ plr.ID ].Level //Change this if this is different
if(!plr) PrivMessage(player,"Error: Unknown Player." );
                else if(ahide[ plr.ID ] ) PrivMessage(player,"The requested player have his level request turned off.");
else
{
Message(">> " + plr.Name + "'s level is " + level + " which stands for " + leveltags(plr, level) );
}
}
}
else if ( cmd == "ahide" || cmd == "adminhide" )
{
if( stats[ player.ID].Level < 2 ) MessagePlayer("Error: You don't have access to it.",player); //Insert your admin function here, else remove this line and change the other else if to if
else if(!text) MessagePlayer("Syntax Error: Use /" + cmd + " <on/off>.",player);
else
{
switch(text.tolower())
{
case "on":
ahide[ player.ID ] = true;
PrivMessage(player,"Now you have turned your admin-hide mode to ON.");
break;

case "off":
ahide[ player.ID ] = false;
PrivMessage(player,"Now you have turned your admin-hide mode to OFF.");
break;

default: PrivMessage(player,"Syntax Error: Use /" + cmd + " <on/off>."); break;
}
}
}
}

FUNCTIONS(You may change it according to your wish :)
function leveltags(player, level)
{
switch(level)
{
case 6: return "Owner";
case 5: return "Head Admin";
case 4: return "Admin";
case 3: return "Moderator";
case 2: return "V.I.P";
case 1: return "User";
case 0: return "Guest";
default: return "Unknown";
}
}
oh no

FinchDon

:/  Whats new in it?
For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

KAKAN

Nothing, thats why i posted
oh no

FinchDon

Better is if you add Hidden Admin In Level cmd
For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

KAKAN

What u mean actually? Its easy to add it using an array
oh no

KAKAN

oh no

Thijn

Why would you hide your admin level :x

MacTavish

Quote from: Thijn on Sep 08, 2015, 06:15 PMWhy would you hide your admin level :x

Because if @KAKAN is server owner and @FinchDon saw him in adminlist the he can beg for adminship :p

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

Thijn

Why would you want to be an admin in a server run by FinchDon :P
This is what comes with the job, deal with it or don't be an admin..

FinchDon

:/ one word for u .l.
For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

Thijn

Useless posts removed. Locked.