Hmm, I've been wondering this as-well, just ******d it and it seems this might be a way to do it.
Strmid
If anyone knows how to use it to do something like this, I'd be interested as-well.
EDIT: First off, realize that I am not the best scripter.
I attempted scripting something like this.
I suppose something like this could be done (untested):
pawn Код:
if(strlen(stringhere) >= size-at-which-you-must-split-the-text) //If string "stringhere"'s string length is over "size-at-which-you-must-split-the-text", do the following:
{
strmid(string, stringhere, size-at-which-you-must-split-the-text, textsizeend);//Split string, extract beginning at size-at-which-you-must-split-the-text, and the end of textsizeend, and store it in the variable "string"
strdel(stringhere, size-at-which-you-must-split-the-text, textsizeend); //Delete the second part from the string "stringhere", to prevent it from the text being there twice
format(string, sizeof(string), "%s~n~%s", stringhere, string);//Format the string with the ~n~ inbetween the two strings
//Do whatever with string now
}
Hope I explained it good enough
EDIT2:
Quote:
Originally Posted by Vince
pawn Код:
for(new i = 30, j = strlen(text); i < j; i += 30) { strins(text, "~n~", i); }
Something like that, maybe. Untested.
|
This actually seems more efficient then my code, and actually makes sense.
It simply makes 2 new variables, one is 30, while the other is the length of the text that is inputted. Then, if the text is greater than 30 (string length), it will add a ~n~ at the mark.
Then again, I'd also suggest checking where the closest space is, cause I wouldn't like to see this happen.
Код:
/testcommand Testing out my sick thing... blabla... (20+ characters later) blablablatestbla
And then it output like so:
Код:
Testing out my sick thing... blabla... blablabl
atestbla