19.09.2016, 19:31
Try this;
PHP код:
CMD:top10(playerid, params[])
{
if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
for(new i, j = GetPlayerPoolSize(); i <= j; i++) // or use foreach
{
if(PlayerInfo[i][pHoursPlayed] >= 1 && IsPlayerConnected(i))
{
new sendername[30], string2[1000], coordsstring[1000];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(coordsstring, sizeof(coordsstring), "Nume\tOre jucate\n", sendername, PlayerInfo[playerid][pHoursPlayed]);
strcat(string2, coordsstring);
format(coordsstring, sizeof(coordsstring), "%s\t%d\n", sendername, PlayerInfo[playerid][pHoursPlayed]);
strcat(string2, coordsstring);
ShowPlayerDialog(playerid, 1341345, DIALOG_STYLE_TABLIST_HEADERS, "Top 10 jucatori activi", string2, "Iesi", "");
}
}
return 1;
}