Jump to content
  • 0

Problema Dialog


1Shot

Question

Am o problema la comanda /members. Ar trebuii sa apara Numele/Rank-ul/OnlineOffline/FW/Zile factiune/ultima logare, dar imi apar doar primele 4. 

Zilele in factiune si ultima logare nu apar...nu stiu ce ar putea fi gresit...

Las aici cod-ul comenzii si o poza cu comanda /members din joc:

CMD:members(playerid, params[])
{
	if(PlayerInfo[playerid][pMember] >= 1 && PlayerInfo[playerid][pRank] >= 6)
	{
		new aim[2400], head[64], query[300], test[300], test1[4], test2[4], test3[10], test4[50], result[300];
		format(query, sizeof(query), "SELECT * FROM `users` WHERE `users`.`Member` = '%d' ORDER BY `users`.`Rank` DESC LIMIT 50", PlayerInfo[playerid][pMember]);
		new Cache: membresult = mysql_query(SQL, query);
		format(head, sizeof(head), "Nume\tRank\tStatus\tFW\tDays\tLast Online\n");
		for(new i, j = cache_get_row_count(); i != j; ++i)
		{
			cache_get_field_content(i, "name", result); format(test, 24, result);
			cache_get_field_content(i, "Rank", result); format(test1, 4, result);
			cache_get_field_content(i, "FWarn", result); format(test2, 4, result);
			cache_get_field_content(i, "FactionTime", result); format(test3, 10, result);
			cache_get_field_content(i, "lastOn", result); format(test4, 50, result);
			new id = GetIDClan( test );
			if( id != INVALID_PLAYER_ID ) format(aim, sizeof(aim), "%s\t%s\tOnline\t%s\t%s\t%s\n", test, test1, test2, test3, test4 );
			else format(aim, sizeof(aim), "%s\t%s\tOffline\t%s\t%s\t%s\n", test, test1, test2, test3, test4 );
		}
        strins(aim, head, 0);
		cache_delete(membresult);
		ShowPlayerDialog(playerid,DIALOG_MEMBERS,DIALOG_STYLE_TABLIST_HEADERS,"Members",aim,"Exit","");
	}
	return 1;
}

 

sa-mp-001.png

Multumesc!

Edited by 1Shot
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
22 minutes ago, Banditul said:

Din pacate din cate am incercat undeva la 4 ar fi numarul maxim de coloane dintr-un motiv sau altu. Si eu aveam nevoie sa afisez anumite elemente da nici o sansa. Revin cu edit dupa ce mai testez putin.

Ok, ma anunti daca ai reusit ceva...

Link to comment
Share on other sites

  • 0
Acum 10 ore, 1Shot a spus:

Ok, ma anunti daca ai reusit ceva...

https://imgur.com/3QcRjhG  (ignora fundalu, e singuru gm de pawn gasit)

CMD:test(playerid, params[])
{
    ShowPlayerDialog(playerid, 541, DIALOG_STYLE_TABLIST_HEADERS, "Caption",
"Header 1\tHeader 2\tHeader 3\tHeader 4\tHeader 5\tHeader 6\n\
Item 1 Column 1\tItem 1 Column 2\tItem 1 Column 3\tItem 1 Column 4\tItem 1 Column 5\tItem 1 Column 6\n\
Item 2 Column 1\tItem 2 Column 2\tItem 2 Column 3\tItem 2 Column 4\tItem 2 Column 5\tItem 2 Column 6",
"Button 1", "Button 2");
	return 1;
}

Da. Se pare ca 4 e numarul maxim. Dar

CMD:test(cmdid, playerid, params[])
{
    ShowPlayerDialog(playerid, 541, DIALOG_STYLE_LIST, "Caption",
"Header 1\tHeader 2\tHeader 3\tHeader 4\tHeader 5\tHeader 6\tHeader 7\tHeader 8\n\
Item 1 Column 1\tItem 1 Column 2\tItem 1 Column 3\tItem 1 Column 4\tItem 1 Column 5\tItem 1 Column 6\n\
Item 2 Column 1\tItem 2 Column 2\tItem 2 Column 3\tItem 2 Column 4\tItem 2 Column 5\tItem 2 Column 6",
"Button 1", "Button 2");
	return 1;
}

Acest dialog pare sa se mareasca pana la Header 7 dar exista o problema, asezarea textelor sunt pur si simplu spatiate intre ele de lungimea stringului. Cu cat stringul de pe o coloana  e mai mare cu atat impinge mai la dreapta restul stringurilor. Evident poti sta sa pui space in loc de \t pana se aseaza perfect dar nu e practic

  • Like 1
Link to comment
Share on other sites

  • 0
5 hours ago, Banditul said:

https://imgur.com/3QcRjhG  (ignora fundalu, e singuru gm de pawn gasit)

CMD:test(playerid, params[])
{
    ShowPlayerDialog(playerid, 541, DIALOG_STYLE_TABLIST_HEADERS, "Caption",
"Header 1\tHeader 2\tHeader 3\tHeader 4\tHeader 5\tHeader 6\n\
Item 1 Column 1\tItem 1 Column 2\tItem 1 Column 3\tItem 1 Column 4\tItem 1 Column 5\tItem 1 Column 6\n\
Item 2 Column 1\tItem 2 Column 2\tItem 2 Column 3\tItem 2 Column 4\tItem 2 Column 5\tItem 2 Column 6",
"Button 1", "Button 2");
	return 1;
}

Da. Se pare ca 4 e numarul maxim. Dar

CMD:test(cmdid, playerid, params[])
{
    ShowPlayerDialog(playerid, 541, DIALOG_STYLE_LIST, "Caption",
"Header 1\tHeader 2\tHeader 3\tHeader 4\tHeader 5\tHeader 6\tHeader 7\tHeader 8\n\
Item 1 Column 1\tItem 1 Column 2\tItem 1 Column 3\tItem 1 Column 4\tItem 1 Column 5\tItem 1 Column 6\n\
Item 2 Column 1\tItem 2 Column 2\tItem 2 Column 3\tItem 2 Column 4\tItem 2 Column 5\tItem 2 Column 6",
"Button 1", "Button 2");
	return 1;
}

Acest dialog pare sa se mareasca pana la Header 7 dar exista o problema, asezarea textelor sunt pur si simplu spatiate intre ele de lungimea stringului. Cu cat stringul de pe o coloana  e mai mare cu atat impinge mai la dreapta restul stringurilor. Evident poti sta sa pui space in loc de \t pana se aseaza perfect dar nu e practic

Varianta cu spatiu intre ele nu merge pentru ca spatiul are marime diferita pe fiecare rezolutie, adica pentru unii jucatori o sa fie ok, pentru altii o sa se vada aiurea.. m-am lovit si eu de problema asta in trecut si nu prea ai csf.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.