Jump to content
  • 0

pomoc Format


vopojtepek

Dotaz

Ahojte, povedal by mi niekto čo v tom mam zle prečo ked dam /taxi a vyberem niaku polohu tak nenapíše nič ?

 

	if(dialogid == 2550)
 	{
		if(response == 1)
		{
  			if(listitem == 0)
			{
   			new string[256];
   			new menohraca[MAX_PLAYER_NAME];
      		GetPlayerName(playerid,menohraca,MAX_PLAYER_NAME);
			if (strlen(inputtext) > 0 && response)
			format(string,sizeof(string),"------------------------------------\n{ff00ff}%s hladá {ff00ff}taxi službu. {00ff00}Nachádza sa v meste {ff00ff}Los Santos\n{00ffff}------------------------------------",menohraca);
			SendClientMessageToAll(0x00FFFFFF,string);
    		}
    		if(listitem == 1)
			{
   			new string[256];
   			new menohraca[MAX_PLAYER_NAME];
      		GetPlayerName(playerid,menohraca,MAX_PLAYER_NAME);
			if (strlen(inputtext) > 0 && response)
			format(string,sizeof(string),"------------------------------------\n{ff00ff}%s hladá {ff00ff}taxi službu. {00ff00}Nachádza sa v meste {ff00ff}Las Venturas\n{00ffff}------------------------------------",menohraca);
			SendClientMessageToAll(0x00FFFFFF,string);
    		}
    		if(listitem == 2)
			{
   			new string[256];
   			new menohraca[MAX_PLAYER_NAME];
      		GetPlayerName(playerid,menohraca,MAX_PLAYER_NAME);
			if (strlen(inputtext) > 0 && response)
			format(string,sizeof(string),"------------------------------------\n{ff00ff}%s hladá {ff00ff}taxi službu. {00ff00}Nachádza sa v meste {ff00ff}San Fiero \n{00ffff}------------------------------------",menohraca);
			SendClientMessageToAll(0x00FFFFFF,string);
    		}
	}
}
Link to comment
Share on other sites

4 odpovědí na tuto otázku

Recommended Posts

  • 0
1) stačí if(response)

2) chyba je v textu nemůžeš používat znaky jako \n a myslet si že ti to udělá nový řádek pokud to tak chceš udělej to takto :

 

SendClientMessageToAll(0x00FFFFFF,"-----------------------------------------------------------------------------------------------------------------");

SendClientMessageToAll(0x00FFFFFF,string);

SendClientMessageToAll(0x00FFFFFF,"-----------------------------------------------------------------------------------------------------------------");

 

samožřejmě si formát textu uprav respektive odstran ty čárky s tím \n

 

- Určitě je i více způsobu ja kten text vytvořit třeba vložením stringu do stringu nebo tak podobně ale na to přídeš postupem času

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...