CMD:radio(playerid, params[]) {
new
availableStations[256],
holder[256],
rStr[16],
radioCount = 0;
for( new r = 1; r < MAXIMUM_RADIO_STATIONS; r ++ )
{
format( rStr, sizeof( rStr ), "%s/%d.ini", RadioLocation, r );
if( fexist( rStr ) )
{
format( availableStations, sizeof( availableStations ), ""#STATIONGENRE"[%s]\t"#STATIONNAME"%s", radInfo[r][StationGenre], radInfo[r][StationName] );
strcat( availableStations, holder );
radioCount++;
printf("count %d", radioCount);
}
}
if(radioCount == 0)
return SendClientMessage(playerid, -1, "ERROR: No Radio Stations available.");
ShowPlayerDialog(playerid, RADIO_DIALOG, DIALOG_STYLE_LIST, "Please select a Radio Station", availableStations, "Play", "Cancel");
return true;
}
You're overwriting it every time. Also, you forgot to start a new line with \n.
|
You're wiping all past text in availableStations by using format. Use a different string variable.
|