[Include] SCMEX
#1

SCMEX
Description:
I think a lot people having that problem, if you write a long text, which is longer than 128 or 144, then you can't read it perfect, becasue it is out of view. But with this include, you can slice them into more lines, and with it you can read the long text purely. The default slice value is 128, but you can set it to MAX 148!

Picture:


As you can see, the long text is sliced into 4 piece, and you can reade it purely.

Warning:
If you color your text, it can slice it, and it's lose their color effect.

Usage:
Just put the include into your pawno/include folder, place the following code under the include <a_samp>
Код:
#include <scmex>
And you need just recompile your script, beacuse its redefine the SendClientMessage and SendClientMessageToAll.

Download:
Pastebin
Solidfiles
Код:
#if defined scmex_included
	#endinput
#endif
#define scmex_included

stock
	darabolas_SCM(playerid, color, const text[], darabolas = 128)
{
	new
		seged1[148 + 1],
		valami = 0 - darabolas,
		lenght = strlen(text);

	while(lenght > (valami += darabolas))
		strmid(seged1, text[valami], 0, darabolas), SendClientMessage(playerid, color, seged1);
}
#if defined _ALS_SendClientMessage
    #undef SendClientMessage
#else
    #define _ALS_SendClientMessage
#endif
#define SendClientMessage darabolas_SCM

stock
	darabolas_SCMToAll(color, const text[], darabolas = 128)
{
	new
		seged1[148 + 1],
		valami = 0 - darabolas,
		lenght = strlen(text);

	while(lenght > (valami += darabolas))
		strmid(seged1, text[valami], 0, darabolas), SendClientMessageToAll(color, seged1);
}
#if defined _ALS_SendClientMessageToAll
    #undef SendClientMessageToAll
#else
    #define _ALS_SendClientMessageToAll
#endif
#define SendClientMessageToAll darabolas_SCMToAll
Reply
#2

Great include! You should set it 64 characters instead of 128 as SA-MP has it that way (per line).

It'd be great if you could supposedly add a feature where it will automatically push embedded colours to the next line instead of it being cut, such as:
"goodincsasdkasjdhqwuieyquwbedlasdbasdhashdajsdhas jhdkasjhdk{FFFFFF}I like apples..."

:P
Reply
#3

Yeah ****** i know that you are just trying to help to make the code more excellent, and if i will have much free time, i will make the code bit shorter, than now. And i'm trying to make compatible with colored text. And ATM i dont know, how can i make the code more shorter, with "valami += darabolas", beaucse it's always ot ouf the memory, and it won't work.
Reply
#4

Like this?
Reply
#5

this one is so goood!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)