Space in player message. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Space in player message. (
/showthread.php?tid=557952)
Space in player message. -
xX4m4zingXx - 15.01.2015
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.
Re: Space in player message. -
HazardouS - 15.01.2015
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.
Re: Space in player message. -
Schneider - 15.01.2015
You can add as many spaces as you like...
pawn Код:
format(str, sizeof(str), " > %s (( %s ))", cmdtext[4], str);
Re: Space in player message. -
xX4m4zingXx - 15.01.2015
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?
Re: Space in player message. -
Schneider - 15.01.2015
The spaces ingame are a lot smaller than they appear in Pawno, so you might have to add more.
Re: Space in player message. -
xX4m4zingXx - 15.01.2015
Idk how I fixed this, but just 1 space was enough.
Thank you all.