dialog
#1

how fix dialog ??

i try make:


CMD:addfriend Samp_Player 123 (example)

system work but in dialog if i add 2 or more players.. how to fix it.. and i need i have 10 friend, i still can select new friend/number add..

Code:
new query[254],
		i[254],
		name[5120], nr[512],string2[5120];
		format(query,sizeof(query),"SELECT * FROM `drgbaze` WHERE `VardasD` = '%s'",GetPlayerNameEx(playerid));
		mysql_query(query);
		mysql_store_result();

		if(mysql_num_rows() != 0)
		{

			while(mysql_fetch_row_format(query, "|"))
			{
				FriendsData[playerid][TotalFriends] ++;
			 	mysql_fetch_field_row(i,"Fvardas"); format(name,sizeof(name),i);
			 	mysql_fetch_field_row(i,"numeris"); format(nr,sizeof(nr),i);
			 	if(IsPlayerOnline(name))
			 	{
		        	format(name,sizeof(name),"Adresato vardas\tNumeris\tBыsena\n\
					{ffc38c}%s\t{ffffff}%s\t{5c8141}on\n\n\
					{82171f}[+] {ffffff}new friend/number add", name, nr);
		        	strcat(string2,name);
				}
				else
				{
				    format(name,sizeof(name),"%s %s- off\n", name);
				    strcat(string2,name);
				}
           		ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_TABLIST_HEADERS, "Test", string2, "Select", "");
Reply
#2

PHP Code:
new query[254],i[254],name[MAX_PLAYER_NAME],nr[128],string2[512];
format(query,sizeof(query),"SELECT * FROM `drgbaze` WHERE `VardasD` = '%s'",GetPlayerNameEx(playerid));
mysql_query(query);
mysql_store_result();
if(
mysql_num_rows() != 0)
{
    
format(string2,sizeof(string2),"{82171f}[+] {ffffff}new friend/number add");
    while(
mysql_fetch_row_format(query,"|"))
    {
        
FriendsData[playerid][TotalFriends] ++;
        
mysql_fetch_field_row(i,"Fvardas"); format(name,sizeof(name),i);
        
mysql_fetch_field_row(i,"numeris"); format(nr,sizeof(nr),i);
        if(
IsPlayerOnline(name))
        {
            
format(name,sizeof(name),"{ffc38c}%s\t{ffffff}%s\t{5c8141}on\n",name,nr);
            
strcat(string2,name);
        }
        else
        {
            
format(name,sizeof(name),"%s %s- off\n"name);
            
strcat(string2,name);
        }
    }
    
ShowPlayerDialog(playerid9999DIALOG_STYLE_TABLIST_HEADERS"Test"string2"Select""");

Is this what you want?

___________________________
The problem with the 10 friends:
You have to count your friends, and if the player click on "[+] new friend/number add" you have to check if the variable with the count is 10 or over 10. Sorry, but my english isn't very well. I hope you know what I mean.
Reply
#3

Quote:
Originally Posted by Mencent
View Post
PHP Code:
new query[254],i[254],name[MAX_PLAYER_NAME],nr[128],string2[512];
format(query,sizeof(query),"SELECT * FROM `drgbaze` WHERE `VardasD` = '%s'",GetPlayerNameEx(playerid));
mysql_query(query);
mysql_store_result();
if(
mysql_num_rows() != 0)
{
    
format(string2,sizeof(string2),"{82171f}[+] {ffffff}new friend/number add");
    while(
mysql_fetch_row_format(query,"|"))
    {
        
FriendsData[playerid][TotalFriends] ++;
        
mysql_fetch_field_row(i,"Fvardas"); format(name,sizeof(name),i);
        
mysql_fetch_field_row(i,"numeris"); format(nr,sizeof(nr),i);
        if(
IsPlayerOnline(name))
        {
            
format(name,sizeof(name),"{ffc38c}%s\t{ffffff}%s\t{5c8141}on\n",name,nr);
            
strcat(string2,name);
        }
        else
        {
            
format(name,sizeof(name),"%s %s- off\n"name);
            
strcat(string2,name);
        }
    }
    
ShowPlayerDialog(playerid9999DIALOG_STYLE_TABLIST_HEADERS"Test"string2"Select""");

Is this what you want?

___________________________
The problem with the 10 friends:
You have to count your friends, and if the player click on "[+] new friend/number add" you have to check if the variable with the count is 10 or over 10. Sorry, but my english isn't very well. I hope you know what I mean.
and your code:

No , i need if i add second player or more it show but not create again and again new friend/number add
Reply
#4

more peoples ?
Reply
#5

still not working... i can't find way how to fix it
Reply
#6

Still guys, i can't find problem
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)