How To!

Started by RDXing_KR, Apr 04, 2016, 06:10 PM

Previous topic - Next topic

RDXing_KR

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

MacTavish

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 )
}
}
}

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

Retired VC:MP Player/Scripter :P