Need command /admins
#1

Hello humans, I really need the command /admins ONLY to show rcon admins that are online. Thank you for that amazing help that you always deliver to me

PD: ****** are you happy now or you need me to rename the post. If yes DON'T DELETE IT just tell me.
Reply
#2

You have script request thread for this.
https://sampforum.blast.hk/showthread.php?tid=187229
Reply
#3

pawn Код:
CMD:admins(playerid, params[])
{
    if(playercount >= 1)
    {
        new str[128], count = 0;
        SendClientMessage(playerid, GREEN, "||| Admins Online |||"); // change colors
        for(new i; i<=playercount; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(IsPlayerAdmin(i))
                {
                    format(str, sizeof(str), "%s[%d]", Name3(i), i);
                    SendClientMessage(playerid, YELLOW, str); // this too
                    count++;
                }
            }
        }
        if(count == 0) return SendClientMessage(playerid, RED, "No admins online"); // maybe this too?
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by Tamer T
Посмотреть сообщение
pawn Код:
CMD:admins(playerid, params[])
{
    if(playercount >= 1)
    {
        new str[128], count = 0;
        SendClientMessage(playerid, GREEN, "||| Admins Online |||"); // change colors
        for(new i; i<=playercount; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(IsPlayerAdmin(i))
                {
                    format(str, sizeof(str), "%s[%d]", Name3(i), i);
                    SendClientMessage(playerid, YELLOW, str); // this too
                    count++;
                }
            }
        }
        if(count == 0) return SendClientMessage(playerid, RED, "No admins online"); // maybe this too?
    }
    return 1;
}
Look:
Код:
DM.pwn(3533) : error 017: undefined symbol "playercount"
DM.pwn(3537) : error 017: undefined symbol "playercount"
DM.pwn(3543) : error 017: undefined symbol "Name3"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

3 Errors.
Reply
#5

Код:
CMD:admins(playerid, params[])
{
    new str[128],name[MAX_PLAYER_NAME];
    SendClientMessage(playerid, GREEN, "||| Admins Online |||"); // change colors
    for(new i; i<=MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerAdmin(i))
            {
                 GetPlayerName(i,name,sizeof(name));
                 format(str, sizeof(str), "%s[%d]",name, i);
                 SendClientMessage(playerid, YELLOW, str); // this too
            }
        }
    }
    return 1;
}
Reply
#6

Код:
COMMAND:admins(playerid,params[])
{
	SendClientMessage(playerid,neongruen,"Online admins:");

	new var;
	for(new i=0;i<MAX_PLAYERS;i++)
	{
	    if(IsPlayerConnected(i))
	    {
			if(Admin[i] > 0)
			{
			    format(str,144,"*%d admin %s[%d]",Admin[i],pname[i],i);
			    SendClientMessage(playerid,hellblau,str);
			    var ++;
			}
		}
	}
	if(var == 0) NoSuccess(playerid,"No admins online");
	return 1;
}
Reply
#7

Quote:
Originally Posted by coakiddo
Посмотреть сообщение
Код:
CMD:admins(playerid, params[])
{
    new str[128],name[MAX_PLAYER_NAME];
    SendClientMessage(playerid, GREEN, "||| Admins Online |||"); // change colors
    for(new i; i<=MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerAdmin(i))
            {
                 GetPlayerName(i,name,sizeof(name));
                 format(str, sizeof(str), "%s[%d]",name, i);
                 SendClientMessage(playerid, YELLOW, str); // this too
            }
        }
    }
    return 1;
}
WORKING AT 100%
YOU JUST GOT YOUR SELF SOME FREE REP

(If anyone needs it to here you can get it)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)