Space in player message.
#1

I have made a command "/act".
but I want spaces in the message.
Код:
if(!strcmp(cmdtext, "/act", true ,4))
	{
	    if(!cmdtext [3]) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /act [action]");
	    new str[128];
		GetPlayerName(playerid, str, sizeof(str));
		format(str, sizeof(str), "[HERE A SPACE]>[HERE A SPACE]%s (([HERE A SPACE]%s[HERE A SPACE]))", cmdtext[4], str);
		SendClientMessageToAll(0xC2A2DAAA, str);
		return 1;
	}
How do I do that? just spaces don't work.
Reply
#2

Even if I doubt that spaces don't work, you can add something like this:
pawn Код:
new space[2] = " ";
format(string, sizeof(string), "%s", space); // will store only a space in the string.
format(string, sizeof(string), "%s%s", space, space); // will store 2 spaces in the string.
Reply
#3

You can add as many spaces as you like...

pawn Код:
format(str, sizeof(str), "  >      %s  ((     %s    ))", cmdtext[4], str);
Reply
#4

Quote:
Originally Posted by Schneider
Посмотреть сообщение
You can add as many spaces as you like...

pawn Код:
format(str, sizeof(str), "  >      %s  ((     %s    ))", cmdtext[4], str);
I added that piece of code and it doesn't add all those spaces?
What's up with it?
Reply
#5

The spaces ingame are a lot smaller than they appear in Pawno, so you might have to add more.
Reply
#6

Idk how I fixed this, but just 1 space was enough.
Thank you all.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)