Don't show Names
#1

Hi,it don't show the names,if i go do /adminduty it show it how to make it show with out /adminduty?
Код:
CMD:admins(playerid,params[]) // Admins command
{
    SendClientMessage(playerid,-1,"Admin Online");
    for(new i = 0; i <MAX_PLAYERS; i++)
    {
        if(IsOnAdminDuty[i] == true)
        {
            new aname[24],astring[124];
            GetPlayerName(playerid,aname,sizeof(aname));
            format(astring,sizeof(astring),"%s (Duty)%s",aname);
            SendClientMessage(playerid,-1,astring);
         }
    }
    return 1;
}
Reply
#2

pawn Код:
format(astring,sizeof(astring),"%s (Duty)%s", astring, aname);
Reply
#3

still don't work if i type /adminduty it shows name on /admins
how i make it show name all the time


Код:
Код:
C:\Userspawno\include\PPC_PlayerCommands.inc(5079) : error 017: undefined symbol "name"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

if i type /admins can it show the names?
Reply
#5

pawn Код:
CMD:admins(playerid, params[])
{
    new bool:Count;
    new str[45], Admin[MAX_PLAYER_NAME], str2[128];
    for(new i, j = GetMaxPlayers(); i != j; i++)
    {
        if(PlayerInfo[i][pAdmin] >= 1)// replace with ur variable
        {
            GetPlayerName(i, Admin, MAX_PLAYER_NAME);
            format(str2, sizeof(str2), "      ~Current Administrators Online~    ");
            format(str, sizeof(str), "%s ",  Admin);
            SendClientMessage(playerid, -1, str2);
        SendClientMessage(playerid, -1, str);
            Count = true;
        }
    }

    if(!Count) SendClientMessage(playerid, -1, "No Administrators Online!");
    return 1;
}
U want something like this?
Reply
#6

it's spaming /admins
i mean like
Admin Online:
Test
if you type /adminduty
look like dis
Admin Online:
Test (Duty)
Reply
#7

Nvm it's working tys
Reply
#8

it show it 2 times how to make it show 1 time



Код:
CMD:admins(playerid, params[])
{
    new bool:Count;
    new str[45], Admin[MAX_PLAYER_NAME], str2[128];
    for(new i = 0; i <MAX_PLAYERS; i++)
    {
        if (APlayerData[i][PlayerLevel] >= 1)// replace with ur variable
        {
            GetPlayerName(i, Admin, MAX_PLAYER_NAME);
            format(str2, sizeof(str2), "Current Administrators Online");
            format(str, sizeof(str), "%s ",  Admin);
            SendClientMessage(playerid, -1, str2);
            SendClientMessage(playerid, -1, str);
            Count = true;
        }
        if(IsOnAdminDuty[i] == true)
        {
            new aname[24],astring[124];
            GetPlayerName(playerid,aname,sizeof(aname));
            format(astring,sizeof(astring),"%s(Duty)%s",aname);
            SendClientMessage(playerid,-1,astring);
         }
    }
    if(!Count) SendClientMessage(playerid, -1, "No Administrators Online");
    return 1;
}
Reply
#9

Any help?
Reply
#10

Use 'else if' instead of 'if' on the second one.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)