SA-MP Forums Archive
[Ajuda] Duvida no cmd /vips - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Duvida no cmd /vips (/showthread.php?tid=598424)



Duvida no cmd /vips - viniciussvl - 12.01.2016

Gostaria de saber se esse comando estб certo, a ordem das funзхes e o loop..., pq meu comando anterior depois desse estava mostrando os players q nгo eram vips e vips tambem

Comando que eu quero saber se estб certo...
pawn Код:
CMD:vips(playerid, params[])
{
    new Str[85];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(pVip[playerid][Vip] >= 1)
            {
                format(Str,sizeof(Str), "{FFFF00}%s: {FFFFFF}%s", GetName(i));
                ShowPlayerDialog(playerid, DialogVips, DIALOG_STYLE_MSGBOX, "Jogadores VIPs", Str, "X", "");
            }
        }
    }
    if(pVip[playerid][Vip] <= 0)
    {
        format(Str,sizeof(Str), "Nenhum jogador vip estб online!");
        ShowPlayerDialog(playerid, DialogVipsOff, DIALOG_STYLE_LIST, "Jogadores VIPs", Str, "X", "");
    }
    return 1;
}

Comando anterior:

pawn Код:
CMD:vips(playerid)
{
    new strings[85];
    new count;
    SendClientMessage(playerid, 0x33AAFFFF, "•~~~~~~~~ Jogadores VIP online ~~~~~~~~•");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(pVip[playerid][Vip] >= 1)
        {
            if(IsPlayerConnected(i))
            {
                format(strings, sizeof(strings), "%s", GetName(i));
                SendClientMessage(playerid, 0xE3E3E3FF, strings);
                count++;
            }
        }
    }
    if(count == 0)
    return SendClientMessage(playerid, 0xD8D8D8FF, "Nгo tem nenhum jogador vip on-line!");

return true;
}



Re: Duvida no cmd /vips - EditPawn - 12.01.2016

Dessa forma talvez possa funcionar do modo que deseja.

PHP код:
CMD:vips(playeridparams[])
{
    new 
Str[85], StrDialog[300], cont;
    for(new 
iMAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i) && pVip[i][Vip] >= 1)
        {
            
format(Str,sizeof(Str), "{FFFF00}%s: {FFFFFF}%i\n"GetName(i), pVip[i][Vip]);
            
strcat(StrDialogStr);
            
cont++;
        }
    }
    if(
cont != 0ShowPlayerDialog(playeridDialogVipsDIALOG_STYLE_MSGBOX"Jogadores VIPs"StrDialog"X""");
    else 
ShowPlayerDialog(playeridDialogVipsOffDIALOG_STYLE_LIST"Jogadores VIPs""Nenhum jogador vip estб online!""X""");
    return 
1;

Sу preste atenзгo nas cйlulas da string StrDialog, pois irб mostrar 8 ~ 12 jogadores vips, aumente o numero de 300 cйlulas para um valor maior caso tenha mais vips.


Re: Duvida no cmd /vips - viniciussvl - 12.01.2016

Esse if no caso mostra se for igual ou maior que 1?


Re: Duvida no cmd /vips - EditPawn - 12.01.2016

Quote:
Originally Posted by viniciussvl
Посмотреть сообщение
Esse if no caso mostra se for igual ou maior que 1?
Isso!

Irб mostrar todos players online que sгo level Maior ou igual a 1.


Re: Duvida no cmd /vips - viniciussvl - 12.01.2016

Muito obrigado, amanhг irei testar com os vips e comento aqui


Re: Duvida no cmd /vips - ClaudioF - 12.01.2016

Quote:

Scavenge and Survive й um servidor de sobrevivкncia no samp, uma mistura de DayZ com Minecraft codado por Southclaw.

Acho que esse й o Scripter "Fodelastico" do Scavange, que me baniu do fуrum, como essa internet й pequena...