SA-MP Forums Archive
Displaying msg in rows - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Displaying msg in rows (/showthread.php?tid=582544)



Displaying msg in rows - Lajko1 - 21.07.2015

Guys I'm saving a string into map with yini. So I'm wondering how can I display tickets that are pending at player in rows.

Now it saves like this:

Tickets = Test1, test2, test3

But I want to display this In game like this:

Your Tickets:
Test1
Test2
Test3

How can I do that?


Re: Displaying msg in rows - zT KiNgKoNg - 21.07.2015

Are you just sending a message to the people you'd like to show it too, or are you showing it in a Dialog?


Re: Displaying msg in rows - Mariciuc223 - 21.07.2015

EDIT: Sorry , don't read all ... That's over my knowledge , sorry for post ..


Re: Displaying msg in rows - Lajko1 - 21.07.2015

Well lets say that for test script I'm trying just to send message to players..


Re: Displaying msg in rows - Evocator - 21.07.2015

sscanf!

Code:
	new
		info[3][10];

	sscanf("Test1, test2, test3", "p<,>s[10]s[10]s[10]", info[0], info[1], info[2]);
	for (new i = 0; i != 3; i++) {
		printf("%i)))   %s", i, info[i]);
	}
And you will get:

Code:
 Test1
 test2
 test3



Re: Displaying msg in rows - GTLS - 21.07.2015

or use "\n" in your message(probably in formatted one) so it will create a new line in your msg.


Re: Displaying msg in rows - Lajko1 - 21.07.2015

Quote:
Originally Posted by Ralfie
View Post
sscanf!

Code:
	new
		info[3][10];

	sscanf("Test1, test2, test3", "p<,>s[10]s[10]s[10]", info[0], info[1], info[2]);
	for (new i = 0; i != 3; i++) {
		printf("%i)))   %s", i, info[i]);
	}
And you will get:

Code:
 Test1
 test2
 test3
How can I do this when I'm using PlayerInfo[playerid][TicketInfo]; ?


Re: Displaying msg in rows - Stereotype - 21.07.2015

In that case you are using multiple tickets, you need to have definition for all of them
for example
PlayerInfo[playerid][TicketInfo1]
PlayerInfo[playerid][TicketInfo2]
PlayerInfo[playerid][TicketInfo3]


And then when you want to send it use

SendClientMessage(playerid, -1, "Ticket 1 - %s",PlayerInfo[playerid][TicketInfo1] );