New line after 128 characters.
#1

Hi, if I write something in chat, like /b on my server, it all get in one line. How do I make it so it continues on a new line?

Here is two screenshots to show what I mean.

This is how I want it. (The interior didnt load :X)


This is how it is right now.



pawn Код:
LEANCMD:(b)
{
    if(isnull(params)) return SCM(playerid, COLOR_GREY,"/b [local ooc chat]");
    new string[128];
    if(AdminDuty[playerid] == 0)
    {
    format(string, sizeof(string), "(( [%i] %s: %s ))",playerid, GetName(playerid), params);
    ProxDetector(20.0, playerid, string,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY);
    format(string,sizeof(string),"[%d-%d-%d](( %s: %s ))",GetDay(),GetMonth(),GetYear(),GetName(playerid), params);
    Log("/logs/Emotes.txt",string);
    return 1;
    }
    if(AdminDuty[playerid] == 1)
    {
    format(string, sizeof(string), "(( [%i] {FF9900}%s{C3C3C3}: %s ))",playerid, GetName(playerid), params);
    ProxDetector(20.0, playerid, string,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY);
    format(string,sizeof(string),"[%d-%d-%d][ADMINDUTY] (( %s: %s ))",GetDay(),GetMonth(),GetYear(),GetName(playerid), params);
    Log("/logs/Emotes.txt",string);
    return 1;
    }
    return 1;
 }
this is my /b command.
Reply
#2

quick sketch.

pawn Код:
inputtext[]

new text[2][128];

if(strlen(inputtext) > 128)
{
strmid(text[0],inputtext,0,127,128); //text[0] will contain text from 0-127
strmid(text[1],inputtext,128,strlen(inputtext),128);//text[1] will contain rest of the string
}
Reply
#3

Quote:
Originally Posted by ikey07
Посмотреть сообщение
quick sketch.

pawn Код:
inputtext[]

new text[2][128];

if(strlen(inputtext) > 128)
{
strmid(text[0],inputtext,0,127,128); //text[0] will contain text from 0-127
strmid(text[1],inputtext,128,strlen(inputtext),128);//text[1] will contain rest of the string
}
Don't forget this will cut off half way through a word... In theory you should make a function looking for a space after or on the 128th character.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)