SA-MP Forums Archive
How can i do this? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How can i do this? (/showthread.php?tid=300825)



How can i do this? - TiNcH010 - 02.12.2011

Hey guys!
Look, I want to do this but not all top players who are connected, but from a folder. "LV-RP/Usuarios /% s.ini" means?
Something like this:

pawn Код:
if(strcmp(cmdtext, "/toprolers", true) == 0)
{
        new top, str[64], str2[256], maxx;
        for(new i = 0; i < MAX_PLAYERS; i ++)
        {
            if(PlayerInfo[i][pPuntosRol] > top) { top = PlayerInfo[i][pPuntosRol]; }
        }
        for(new t = top; t >= 0; t--)
        {
            for(new i = 0; i < MAX_PLAYERS; i ++)
            {
                if(!IsPlayerConnected(i)) continue;
                if(PlayerInfo[i][pPuntosRol] != t) continue;
                GetPlayerName(i, str, 24);
                maxx++;
                format(str, sizeof str, "Puesto: %d | Nick: %s | Puntos de rol: %d\n", maxx, str, PlayerInfo[playerid][pPuntosRol]);
                strcat(str2, str);
            }
            ShowPlayerDialog(playerid, 150, DIALOG_STYLE_LIST, "Top 10 - Mejores Roler's del server", str2, "Ok", "");
            if(maxx == 10) break;
        }
        return 1;
}
I want to extract information from the folder scriptfiles "LV-RP/Usuarios /% s.ini"
Thanks