Vice City: Multiplayer

Server Development => Scripting and Server Management => Snippet Showroom => Topic started by: KAKAN on Sep 07, 2015, 05:59 PM

Title: Level command
Post by: KAKAN on Sep 07, 2015, 05:59 PM
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";
}
}
Title: Re: Level command
Post by: FinchDon on Sep 08, 2015, 09:37 AM
:/  Whats new in it?
Title: Re: Level command
Post by: KAKAN on Sep 08, 2015, 11:00 AM
Nothing, thats why i posted
Title: Re: Level command
Post by: FinchDon on Sep 08, 2015, 02:54 PM
Better is if you add Hidden Admin In Level cmd
Title: Re: Level command
Post by: KAKAN on Sep 08, 2015, 05:35 PM
What u mean actually? Its easy to add it using an array
Title: Re: Level command
Post by: KAKAN on Sep 08, 2015, 05:51 PM
Anyways added
Title: Re: Level command
Post by: Thijn on Sep 08, 2015, 06:15 PM
Why would you hide your admin level :x
Title: Re: Level command
Post by: MacTavish on Sep 08, 2015, 06:23 PM
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
Title: Re: Level command
Post by: Thijn on Sep 08, 2015, 07:13 PM
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..
Title: Re: Level command
Post by: FinchDon on Sep 09, 2015, 01:55 AM
:/ one word for u .l.
Title: Re: Level command
Post by: Thijn on Sep 09, 2015, 06:02 PM
Useless posts removed. Locked.