Admins Only
#1

Hi Sa-Mp, I want to ask you how do you make a Admin Broadcast only for a certain admin level.

For example I want the command /slap to be shown only to admin 2+.
Thank you.
Reply
#2

Its simple. first forward AdminBroadCast(color, const string[], level);
PHP код:
public AdminBroadCast(color, const string[], level)
{
    foreach (
Playeri)
    {
        if(
IsPlayerConnected(i))
        {
            if(
PInfo[i][pAdminLevel] >= level)
            {
                
SendClientMessage(icolorstring);
            }
        }
    }
    return 
1;

Example for /slap :
PHP код:
format(stringsizeof(string), "[Warning] Admin %s //... blah blah blah
AdminBroadCast(COLOR_WHITE, string, 2); 
Reply
#3

Quote:
Originally Posted by Alpay0098
Посмотреть сообщение
Its simple. first forward AdminBroadCast(color, const string[], level);
PHP код:
public AdminBroadCast(color, const string[], level)
{
    foreach (
Playeri)
    {
        if(
IsPlayerConnected(i))
        {
            if(
PInfo[i][pAdminLevel] >= level)
            {
                
SendClientMessage(icolorstring);
            }
        }
    }
    return 
1;

You don't have to check if the player is online when you use foreach.
Reply
#4

Thank you very much, but I would like to show only for a certain admin level
I would like to show only for Admin level 6

so the command used by another admin will be shown only to admins with level 6+
This is what I meant, thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)