SA-MP Forums Archive
SendClientMessage in seperate lines... - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SendClientMessage in seperate lines... (/showthread.php?tid=82210)



SendClientMessage in seperate lines... - SiJ - 16.06.2009

Hey,
Firstly, SendFMessage:
pawn Код:
#define SendFMessage(%1,%2,%3,%4) do{new sendfstring[128];format(sendfstring,128,(%3),%4);SendClientMessage((%1), (%2) ,sendfstring);}while(false)
Ok, I have this:
pawn Код:
new ServerMSG[][] =
{
  "\n Found a bug? Or maybe grammar error?\n /report us now!\n You will get BiG ReWaRD!\n And.. Don't forget our website: %s ! \n",
  "\n Have a suggestion? \n Use /suggest to tell us, and get rewarded!\n And.. Don't forget our website: %s ! \n",
    "\n Stuck somewhere? Can't find something?\n Check for a /help or ask one of our friendly admins :) \n And.. Don't forget our website: %s ! \n"
};
and this timer:
pawn Код:
public ServerMSGS(playerid)
{
    new randMSG = random(sizeof(ServerMSG));
    SendFMessage(playerid,COLOR_SYSTEM, ServerMSG[randMSG],SITE_URL);
}
But it doesn't add new lines there \n character is.. i even tried \r\n but they works only if i'm printing it to console..
How can I add new lines, there \n in the array is?
P.S. On SendClientMessage it makes double space in the place there \n is


Re: SendClientMessage in seperate lines... - Donny_k - 16.06.2009

You would have to format the line over the limit (12 then send another and by the way it's "false" not "flase", typo in your define.


Re: SendClientMessage in seperate lines... - SiJ - 16.06.2009

Quote:
Originally Posted by Donny
You would have to format the line over the limit (12 then send another and by the way it's "false" not "flase", typo in your define.
Oops.. "false" is ok in my gm.. just a typo in my post...
Can u explain me more about what you wrote... (my bad English... )


Re: SendClientMessage in seperate lines... - Donny_k - 16.06.2009

If your message is greater than 128 characters long then split it up into two messages and send them both using the string functions such as strmid and format.


Re: SendClientMessage in seperate lines... - SiJ - 16.06.2009

Quote:
Originally Posted by Donny
If your message is greater than 128 characters long then split it up into two messages and send them both using the string functions such as strmid and format.
But I don't want to split it because it is longer than 128 characters... I want to split it into each line because it is nicer.. Isn't it possible to do that easier..? \n won't work in any way?


Re: SendClientMessage in seperate lines... - Donny_k - 16.06.2009

Ok well split it then dude, I put 128 as an example as this is the output limit but if you want to split it at 17 or 36 or 84 then do so.

Look up 'strmid' on the wiki.


Re: SendClientMessage in seperate lines... - SiJ - 16.06.2009

Quote:
Originally Posted by Donny
Ok well split it then dude, I put 128 as an example as this is the output limit but if you want to split it at 17 or 36 or 84 then do so.

Look up 'strmid' on the wiki.
Going to look at that now... Hope it's easy..

P.S. http://forum.sa-mp.com/index.php?topic=107009.0