11.06.2013, 21:23
can anyone help? how do i set this command so that only a admin or owner can use it?
GROUPS
pawn Код:
YCMD:ban(playerid, params[], help)
{
if (help)
{
return SendClientMessage(playerid, 0xFF0000AA, "Bans another player.");
}
else
{
new
pid,
reason[32];
if (sscanf(params, "uS[32]", pid, reason))
{
return SendClientMessage(playerid, 0xFF0000AA, "Parameters: <playerid/name> [reason]");
}
if (reason[0])
{
SendClientMessage(pid, 0xFF0000AA, "You have been banned. Reason:");
SendClientMessage(pid, 0xFF0000AA, reason);
}
else
{
SendClientMessage(pid, 0xFF0000AA, "You have been banned.");
}
Ban(pid);
}
return 1;
}
pawn Код:
stock GetPlayerAdminLevel(playerid)
{
new
a_level_string[ 128 ];
if ( userData[ playerid ][ Admin_Level ] == 1 )
format( a_level_string, sizeof ( a_level_string ), "Mod" );
else if ( userData[ playerid ][ Admin_Level ] == 2 )
format( a_level_string, sizeof ( a_level_string ), "Super Mod" );
else if ( userData[ playerid ][ Admin_Level ] == 3 )
format( a_level_string, sizeof ( a_level_string ), "Admin" );
else if ( userData[ playerid ][ Admin_Level ] == 4 )
format( a_level_string, sizeof ( a_level_string ), "Owner" );
else
format( a_level_string, sizeof ( a_level_string ), "Unknown admin level!" );
return a_level_string;
}