Dialog is showing black box?
#1

My dialog is showing blank, how can I fix this

Код:
stock GetPlayerMusic(playerid)
{
	new sendername[24];
	GetPlayerName(playerid, sendername, 24);
	new string[256];
	new found = 0;
    for(new i = 1; i < MAX_SONGS;i++)
	{
		if(strcmp(MusicInfo[i][PlayerName], sendername, true) == 0)
		{
		    found = 1;
		    format(string, sizeof(string), "%s\n", MusicInfo[i][SongName]);
		}
	}
	if(found == 0) return SendClientMessage(playerid, 0x969696FF, "Error: You haven't saved any music into the database yet.");
	ShowPlayerDialog(playerid, SongList, DIALOG_STYLE_LIST, "Songs", string, "Play", "Cancel");
	return 1;

}

stock LoadMusic()
{
	new query[256];
	for(new i = 1; i < MAX_SONGS; i++)
	{
		format(query, sizeof(query), "SELECT * FROM Music WHERE ID=%i", i);
		mysql_function_query(mysql, query, true, "LoadMusicSQL", "d", i);
	}
	return 1;
}

forward LoadMusicSQL(id);
public LoadMusicSQL(id)
{
    new fields, rows;
    cache_get_data(rows, fields);
    if(rows)
    {
        if(MusicInfo[id][SongUsed] == 0)
    	{
        	new fetch[256];
        	cache_get_field_content(0, "ID", fetch);
			MusicInfo[id][ID]= strval(fetch);
        	cache_get_field_content(0, "Name", fetch);
  			format(MusicInfo[id][PlayerName], 24, fetch);
  			cache_get_field_content(0, "SongName", fetch);
  			format(MusicInfo[id][SongName], 256, fetch);
  			cache_get_field_content(0, "SongLink", fetch);
  			format(MusicInfo[id][SongLink], 128, fetch);
			cache_get_field_content(0, "SongUsed", fetch);
			MusicInfo[id][SongUsed]= strval(fetch);
            print("I have loaded a song.");
		}
	}
	return 1;
}
Reply
#2

PHP код:
stock GetPlayerMusic(playerid)
{
    new 
sendername[24];
    
GetPlayerName(playeridsendername24);
    new 
string[256];
        new 
str[36];
    new 
found 0;
        for(new 
1MAX_SONGS;i++)
    {
        if(!
strcmp(MusicInfo[i][PlayerName], sendernametrue))
        {
            
found 1;
                    if(
isnull(string)) format(strsizeof(str), "%s"MusicInfo[i][SongName]);
            else 
format(strsizeof(str), "%s\n%s"stringMusicInfo[i][SongName]);
        }
    }
    if(
found == 0) return SendClientMessage(playerid0x969696FF"Error: You haven't saved any music into the database yet.");
    
ShowPlayerDialog(playeridSongListDIALOG_STYLE_LIST"Songs"string"Play""Cancel");
    return 
1;

Reply
#3

Quote:
Originally Posted by TitanX
Посмотреть сообщение
PHP код:
stock GetPlayerMusic(playerid)
{
    new 
sendername[24];
    
GetPlayerName(playeridsendername24);
    new 
string[256];
        new 
str[36];
    new 
found 0;
        for(new 
1MAX_SONGS;i++)
    {
        if(!
strcmp(MusicInfo[i][PlayerName], sendernametrue))
        {
            
found 1;
                    if(
isnull(string)) format(strsizeof(str), "%s"MusicInfo[i][SongName]);
            else 
format(strsizeof(str), "%s\n%s"stringMusicInfo[i][SongName]);
        }
    }
    if(
found == 0) return SendClientMessage(playerid0x969696FF"Error: You haven't saved any music into the database yet.");
    
ShowPlayerDialog(playeridSongListDIALOG_STYLE_LIST"Songs"string"Play""Cancel");
    return 
1;

its not showing the dialog or any of the messages now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)