List Command Help (+Rep)
#1

I have problem in my VipList Command:
pawn Код:
if(strcmp(cmdtext,"/VipList",true) == 0)
{
    printf("[INFO]: \"%s\" Typed /VipList",GetName(playerid));
    if(IsPlayerConnected(playerid))
{
    new count = 0;
    for(new i=0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
{
    if(IsPViP(i))
{
    SendClientMessage(playerid,COLOR_WHITE,"--- ViP ---");
    format(string,sizeof(string),"%d) \"%s\" [id: %d | ViP Level: %d]",i,GetName(i),i,GetVipLevel(i));
    SendClientMessage(playerid,COLOR_YELLOW,string);
    count++;
    SendClientMessage(playerid,COLOR_WHITE,"--- ViP  ---");
}}}
    if(count == 0) return SendClientMessage(playerid,COLOR_RED,"! no VIP");
}
return 1;
}
if there is more than 2 players its show:

--- Vip ----
---- Vip ----
2)DownLoaD
---- vip -----
4)SingelOut
---- vip -----
Reply
#2

Whats the problem?
Reply
#3

if there is more than 2 players its show:

--- Vip ----
---- Vip ----
2)DownLoaD
---- vip -----
4)SingelOut
---- vip ----
Reply
#4

err

pawn Код:
if(strcmp(cmdtext,"/VipList",true) == 0)
{
    printf("[INFO]: \"%s\" Typed /VipList",GetName(playerid));
    if(IsPlayerConnected(playerid))
{
    new count = 0;
    SendClientMessage(playerid,COLOR_WHITE,"--- ViP ---");
    for(new i=0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
{
    if(IsPViP(i))
{
    SendClientMessage(playerid,COLOR_WHITE,"--- ViP ---");
    format(string,sizeof(string),"%d) \"%s\" [id: %d | ViP Level: %d]",i,GetName(i),i,GetVipLevel(i));
    SendClientMessage(playerid,COLOR_YELLOW,string);
    count++;
}
}
}
    SendClientMessage(playerid,COLOR_WHITE,"--- ViP  ---");
    if(count == 0) return SendClientMessage(playerid,COLOR_RED,"! no VIP");
}
return 1;
}
Reply
#5

Still not.
its show:
--- VIP ---
--- VIP ---
DownLoaD
--- VIP ---
SingelOut
--- VIP ---
Reply
#6

Its fixed half of the command
when there is more than 2 Vip's online its works fine.
but if there is no online VIP its show:
--- vip ---
--- vip ---
no VIPS !

here's the command:

pawn Код:
if(strcmp(cmdtext,"/VipList",true) == 0)
{
    printf("[INFO]: \"%s\" Typed /VipList",GetName(playerid));
    if(IsPlayerConnected(playerid))
    {
        new count = 0;
        SendClientMessage(playerid,COLOR_WHITE,"--- ViP ---");
        for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(IsPViP(i))
                {
                    format(string,sizeof(string),"%d) \"%s\" [id: %d | ViP Level: %d]",i,GetName(i),i,GetVipLevel(i));
                    SendClientMessage(playerid,COLOR_YELLOW,string);
                    count++;
                }
            }
        }
    SendClientMessage(playerid,COLOR_WHITE,"--- ViP  ---");
    if(count == 0) return SendClientMessage(playerid,COLOR_RED,"! no VIP");
    }
return 1;
}
Reply
#7

Try This:
pawn Код:
if(strcmp(cmdtext,"/VipList",true) == 0)
    {
        printf("[INFO]: \"%s\" Typed /VipList",GetName(playerid));
        if(IsPlayerConnected(playerid))
        {
            new count = 0;
            SendClientMessage(playerid,COLOR_WHITE,"--- ViP ---");
            for(new i=0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(IsPViP(i))
                    {
                        format(string,sizeof(string),"%d) \"%s\" [id: %d | ViP Level: %d]",i,GetName(i),i,GetVipLevel(i));
                        SendClientMessage(playerid,COLOR_YELLOW,string);
                        count++;
                    }
                }
            }
            if(count == 0) return SendClientMessage(playerid,COLOR_RED,"! no VIP");
        }
        return 1;
    }
Reply
#8

but i want it to show:
-- vips ---
players..
--- vips ---
Reply
#9

Here you go:
pawn Код:
if(strcmp(cmdtext,"/VipList",true) == 0)
    {
        printf("[INFO]: \"%s\" Typed /VipList",GetName(playerid));
        if(IsPlayerConnected(playerid))
        {
            new count = 0;
            SendClientMessage(playerid,COLOR_WHITE,"--- ViP ---");
            for(new i=0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(IsPViP(i))
                    {
                        format(string,sizeof(string),"%d) \"%s\" [id: %d | ViP Level: %d]",i,GetName(i),i,GetVipLevel(i));
                        SendClientMessage(playerid,COLOR_YELLOW,string);
                        count++;
                    }
                }
            }
            if(count == 0) return SendClientMessage(playerid,COLOR_RED,"! no VIP");
           SendClientMessage(playerid,COLOR_WHITE,"--- ViP ---");
        }
        return 1;
    }
Now Out put will be :
Код:
-- vips ---
 players..
 --- vips ---
AND ifcount =0;

Код:
-- vips ---
 no vip
 --- vips ---
Reply
#10

i want it to show,
out put will show:
- VIPS -
player.
- VIPS -
and if Count = 0
no online VIPS.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)