Vip not showing the names
#1

not showing the names just showing the vip level.here the command


Код:
COMMAND:vips(playerid, params[])
{
    new Count;
    new str[45];
    new playername[MAX_PLAYER_NAME];
    SendClientMessage(playerid, -1, "Vip online:");
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(Pinfo[i][VipLevel] >= 1)
        {
            Count ++;
            format(str, sizeof str, "%s %s",playername,VipName(i));
            SendClientMessage(playerid, -1, str);
        }
    }
    if(Count < 1) SendClientMessage(playerid, -1, "No Vip Online!");
    // Let the server know that this was a valid command
    return 1;
}
Reply
#2

You never got the player's name.
edit:
try this
pawn Код:
COMMAND:vips(playerid, params[])
{
    new Count;
    new str[45];
    new playername[MAX_PLAYER_NAME];
    SendClientMessage(playerid, -1, "Vip online:");
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(Pinfo[i][VipLevel] >= 1)
        {
            Count ++;
            GetPlayerName(i, playername, sizeof(playername));
            format(str, sizeof(str), "%s %s",playername,VipName(i));
            SendClientMessage(playerid, -1, str);
        }
    }
    if(Count < 1) SendClientMessage(playerid, -1, "No Vip Online!");
    // Let the server know that this was a valid command
    return 1;
}
Reply
#3

your format is wrong, put bracket at sizeof, and remove the pragma.
and first actually get the player's name before formatting it.
Reply
#4

Can you give me the code?
Reply
#5

Did you even bother trying mine?
Reply
#6

Yes,Thanks.it work.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)