Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: RDXing_KR on Apr 04, 2016, 06:10 PM

Title: How To!
Post by: RDXing_KR on Apr 04, 2016, 06:10 PM
function onPlayerCommand(player, command, arguments)
{   
local cmd, text;
        cmd = command.tolower();
        text = arguments;

if ( cmd == "ann" || cmd == "announce" )
{
if ( !text ) PrivMessage ( player, "Use /" + cmd + " <message>." );
else
{
AnnounceAll ( text + "", 3);
MessagePlayer(">> You have announced: " + text + "",player )
}
}
}
How to change it to admin function and i have to access it till 4 Level to the end 10
Title: Re: How To!
Post by: MacTavish on Apr 04, 2016, 06:24 PM
function onPlayerCommand(player, command, arguments)
{   
local cmd, text;
        cmd = command.tolower();
        text = arguments;

if ( cmd == "ann" || cmd == "announce" )
{
if ( !text ) PrivMessage ( player, "Use /" + cmd + " <message>." );
else if ( GetLevel(player) < 4 ) PrivMessage ( player, "You must need atleast level 4 to access the command" );
else
{
AnnounceAll ( text + "", 3);
MessagePlayer(">> You have announced: " + text + "",player )
}
}
}