Displaying msg in rows
#1

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?
Reply
#2

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

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

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

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
Reply
#6

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

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]; ?
Reply
#8

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] );
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)