Increasing the text length with another row. (REP+)
#1

Alright guys, I have no idea how to do this.
Maybe you've seen.. when you type a text with a big length it automaticly moves to a new row. For example you type:
"Hello I'm new can I get admin and shit I like the server blhablah"
And it sends: "Hello I'm new can I get ad" and that's it.
But how to do it like:
"Hello I'm new can I get admin and...
... shit I like the server blhablah" ?

Can you show me for example for the /b command?

pawn Код:
else if(strcmp(cmd, "/b", true) == 0 || strcmp(cmd, "/и", true) == 0)
    {
            if(gPlayerLogged[playerid] == 0) return  SendClientMessage(playerid, COLOR_GREY, "First you need to log in!");
            if(PlayerInfo[playerid][pMuted] == 1) return    SendClientMessage(playerid, COLOR_LIGHTRED,"You have a chat ban.");
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            new succ;
            for(new i; i<strlen(result); i++)
            {
            if(PText[playerid][i] == result[i]) succ++;
            }
            if(!strlen(result)) return  SendClientMessage(playerid, COLOR_WHITE, "Type: /b [message]");
            format(string, sizeof(string), "{ff6600}(( {ffffff}%s: %s {ff6600}))", sendername, result);
            ProxDetector(20.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
            printf("%s", string);
            Flood[playerid] = 4;
            return 1;
    }
Reply
#2

pawn Код:
else if(strcmp(cmd, "/b", true) == 0 || strcmp(cmd, "/и", true) == 0)
    {
            if(gPlayerLogged[playerid] == 0) return  SendClientMessage(playerid, COLOR_GREY, "First you need to log in!");
            if(PlayerInfo[playerid][pMuted] == 1) return    SendClientMessage(playerid, COLOR_LIGHTRED,"You have a chat ban.");
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[128];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            new succ;
            for(new i; i<strlen(result); i++)
            {
            if(PText[playerid][i] == result[i]) succ++;
            }
            if(!strlen(result)) return  SendClientMessage(playerid, COLOR_WHITE, "Type: /b [message]");
            format(string, sizeof(string), "{ff6600}(( {ffffff}%s: %s {ff6600}))", sendername, result);
            ProxDetector(20.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
            printf("%s", string);
            Flood[playerid] = 4;
            return 1;
    }
Make the string bigger. Here you go.
Reply
#3

Quote:
Originally Posted by Kingunit
Посмотреть сообщение
pawn Код:
else if(strcmp(cmd, "/b", true) == 0 || strcmp(cmd, "/и", true) == 0)
    {
            if(gPlayerLogged[playerid] == 0) return  SendClientMessage(playerid, COLOR_GREY, "First you need to log in!");
            if(PlayerInfo[playerid][pMuted] == 1) return    SendClientMessage(playerid, COLOR_LIGHTRED,"You have a chat ban.");
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[128];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            new succ;
            for(new i; i<strlen(result); i++)
            {
            if(PText[playerid][i] == result[i]) succ++;
            }
            if(!strlen(result)) return  SendClientMessage(playerid, COLOR_WHITE, "Type: /b [message]");
            format(string, sizeof(string), "{ff6600}(( {ffffff}%s: %s {ff6600}))", sendername, result);
            ProxDetector(20.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
            printf("%s", string);
            Flood[playerid] = 4;
            return 1;
    }
Make the string bigger. Here you go.
And it goes to the next row automaticly?
Reply
#4

Test it.
Reply
#5

Quote:
Originally Posted by Kingunit
Посмотреть сообщение
Test it.
Tested. But it doesn't move to a new line. Can anyone else help?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)