Optimizar cуdigo. (De nuevo)
#2

pawn Код:
CMD:vips(playerid, params[])
{
    new title[30], string[1500], temp[128], count;
    for(new i = 0, j = GetPlayerPoolSize(); i <= j; i ++)
    {
        if(!IsPlayerConnected(i) || !JugadorInfo[i][zVip])
        {
            continue;
        }

        switch(JugadorInfo[i][zVip])
        {
            case 1:
            {
                format(temp, sizeof(temp), ""COL_BLANCO"%s [%d]\t"#COL_SILVER"Silver\t%d\n", pName(i), i, JugadorInfo[i][zVip]);
            }
            case 2:
            {
                format(temp, sizeof(temp), ""COL_BLANCO"%s [%d]\t"#COL_PREMIUM"Premium\t%d\n", pName(i), i, JugadorInfo[i][zVip]);
            }
            case 3:
            {
                format(temp, sizeof(temp), ""COL_BLANCO"%s [%d]\t"#COL_EXTREMO"Extremo\t%d\n", pName(i), i, JugadorInfo[i][zVip]);
            }
            case 4:
            {
                format(temp, sizeof(temp), ""COL_BLANCO"%s [%d]\t"#COL_SUPREMO"Supremo\t%d\n", pName(i), i, JugadorInfo[i][zVip]);
            }
            case 5:
            {
                format(temp, sizeof(temp), ""COL_BLANCO"%s [%d]\t"#COL_LEGENDARIO"Legendario\t%d\n", pName(i), i, JugadorInfo[i][zVip]);
            }
        }

        strcat(string, temp);

        count ++;
    }

    if(!count)
    {
        ShowPlayerDialog(playerid, DIALOG_SINUSO, DIALOG_STYLE_MSGBOX, ""COL_NARANJA"-§- Vips -§-", "No hay VIPs conectados.", "Aceptar", "");
    }
    else
    {
        format(title, sizeof(title), "VIPs Conectados: "COL_ROJO"%d", count);

        strins(string, "Nickname\tVIP\tNivel\n", 0);

        ShowPlayerDialog(playerid, DIALOG_SINUSO, DIALOG_STYLE_TABLIST_HEADERS, titulo, string, "Aceptar", "");
    }

    PlayerPlaySound(playerid, 1139, 0.0, 0.0, 0.0);
    return 1;
}
Reply


Messages In This Thread
Optimizar cуdigo. (De nuevo) - by dannypanda05 - 07.03.2016, 04:01
Re: Optimizar cуdigo. (De nuevo) - by SickAttack - 07.03.2016, 05:02
Respuesta: Optimizar cуdigo. (De nuevo) - by dannypanda05 - 07.03.2016, 17:20

Forum Jump:


Users browsing this thread: 1 Guest(s)