/admins online command
#1

Hi all,someone know how to set /admins for checking the admins online at moment?

Example.I use /admins and..:

Admins Online:

NICK 1
NICK 2

ETC.
Reply
#2

This is pretty basic scripting, I suggest you read up on pawn on the wiki.

Loop through player, checking if connected
I recommend using foreach, but a simple loop through max players will do the same thing
https://sampforum.blast.hk/showthread.php?tid=92679

inside the loop, check if the player is an admin, using whatever variable you store admin in, and/or IsPlayerAdmin()
format a string, and send it to the players client.
Reply
#3

pawn Код:
IsPlayerAdmin
Use that with your
pawn Код:
OnPlayerCommandText
line (( underneath ))
Reply
#4

Quote:
Originally Posted by SampStunta
Посмотреть сообщение
pawn Код:
IsPlayerAdmin
Use that with your
pawn Код:
OnPlayerCommandText
line (( underneath ))
How the fuck is that going to help him?

You might aswell have said nothing :S

He is going to reply with "how to use that?"

If your going to spoon feed people then atleast do it properly.
Reply
#5

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
        if(IsPlayerAdmin(i))
        {
            new string[27];
            new sendername[MAX_PLAYER_NAME];
            GetPlayerName(i, sendername, sizeof(sendername));
            format(string, sizeof(string), "Admin: %s", sendername);
            SendClientMessage(playerid, culoare, string);
        }
    }
}
The IsPlayerAdmin only works with rcon admins , replace that with what you're using to check if is an admin(if you have an custom-made admin-system)
Also ,this is only the loop , make the command the same as the others.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)