Simple and quick question
#1

Hello, how to join 2 variable with array into a string?

Код:
	new s[256];
	new Name[256];
	new FullLine[256];
	if(row < TEAM_MENU_ITEMS) {
		format(s,256,"You selected team %s",TeamStrings[row]);
		SendClientMessage(playerid,0xFFFFFFFF,s);
		GetPlayerName(playerid,Name,256);
		format(FullLine,256,B "%s has joined team " TeamStrings[row],Name);
		SendClientMessageToAll(COLOR_RED,FullLine);
That doesn't work.
Reply
#2

Sorry what do you mean? "Join" 2 variables in a string. I don't get the word "Join" :P - Converting two variables in one string's easy...
Reply
#3

you missed your comma by teamstrings
pawn Код:
format(FullLine,256,B "%s has joined team ", TeamStrings[row],Name);
Reply
#4

Yes I want to know how to join 2 variables into 1 string. Both strings with array and the strings without array.
Reply
#5

pawn Код:
new string1[50], string2[50], string3[50];
format(string1, 50, "String 1!");
format(string2, 50, "String 2!");
format(string3, 50, "%s + %s = String 3!", string1, string2);
printf("%s", string3);
This will put "String1! + String2! = String 3!" in your console. Is this what you want?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)