Have a Big Problem with Dialog
#1

DELETE
Reply
#2

Because you never use stringmot.
Reply
#3

oh sorry i change to string but it still not show distance
Reply
#4

Because you never use string.
Reply
#5

how can i use it's ?
Reply
#6

Information

You need to use format to replace the string formatter with the distance you have provided. putting "string" means nothing to the compiler and will interpret it as just the text "string". You need to replace "string" with the value for distance.

Where you have used format to make string have the value for distance, you need to instead put the dialog content in there and at the end use a format specifier to replace that with distance as I have done for you below

Код:
CMD:findjob( playerid, params[] ) 
{
	new 
		string[ 128 ] // increase this to allow for all your text to fit
	;

	format(
		string,
		sizeof( string ),
		"Job\tLocation\tDistance\n \
		Pizza Boy\tSan Fierro\t%.02f", 
		GetPlayerDistanceFromPoint( playerid, -1720.962646, 1364.456176, 7.187500 )
	);

	return ShowPlayerDialog(
		playerid, 
		DIALOG_FINDJOB, 
		DIALOG_STYLE_TABLIST_HEADERS, 
		"FINDJOB",
		string,
		"Select", 
		"Cancel"
	);
}
Reply
#7

oke thank you. but how can i ad another job
Reply
#8

Solution

Where you have the line "Pizza Boy\tSan Fierro\t%.02f" you will need to add a new line followed by the content you wish to add.

When using Dialogs and specifically the DIALOG_STYLE_LIST or DIALOG_STYLE_TABLIST_HEADERS, using \n means new line and a new line makes a new list item.

so to add on to what you had before you may use:
Код:
"Job\tLocation\tDistance\n \
Pizza Boy\tSan Fierro\t%.02f\n \
Dish Washer\tLas Venturas\t%.02f", // Just an example
So what did I add? I added \n to the end of the line to tell the compiler that your working on a list item. Then you fill in each column followed by a \t to separate it.

Just a note: As you can see I put an extra \ at the end of each line, this tells the compiler to ignore the whitespace and continue to treat it as a string, without it if you tried to put content on a new line the compiler would error.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)