BIG HELP +REPPP !
#1

Hello Guys I have a problem about Text String soo
This is the problem

http://www.imgz.ro/view.php?id=165755

Look when i player types in chat more about 2 -3 words it's starting a new line but I want all the text in one line

Here's my code , and string length

pawn Код:
else if(AccInfo[playerid][Level] >= 3 && AccInfo[playerid][Level] == 10 && IsPlayerAdmin(playerid))
    {
        format(PText, 1000, "{FF0000}({FFFFFF}RCON{FF0000}){15FF00}(%d):{FFFFFF} {%06x}%s", playerid, AccInfo[playerid][p_TextColor], text);
        SendPlayerMessageToAll(playerid, PText);
        return 0;
    }
    else if(AccInfo[playerid][Level] >= 3 && AccInfo[playerid][Level] <= 10)
    {
        format(PText, 1000, "{1900FF}(Admin){15FF00}(%d):{FFFFFF} {%06x}%s", playerid, AccInfo[playerid][p_TextColor], text);
        SendPlayerMessageToAll(playerid, PText);
        return 0;
    }
+REP for who can solve this !
Reply
#2

That code doesn't look like the one in the picture, check through OnPlayerText.
Reply
#3

I think you get an out of bound, the maximum length of a message string is 144, if you go more than that it's not shown !
Try to use sizeof() instead of 1000
Reply
#4

pawn Код:
else if(AccInfo[playerid][Level] >= 3 && AccInfo[playerid][Level] == 10 && IsPlayerAdmin(playerid))
    {
        format(PText, 144, "{FF0000}({FFFFFF}RCON{FF0000}){15FF00}(%d):{FFFFFF} {%06x}%s", playerid, AccInfo[playerid][p_TextColor], text);
        SendPlayerMessageToAll(playerid, PText);
        return 0;
    }
    else if(AccInfo[playerid][Level] >= 3 && AccInfo[playerid][Level] <= 10)
    {
        format(PText, 144, "{1900FF}(Admin){15FF00}(%d):{FFFFFF} {%06x}%s", playerid, AccInfo[playerid][p_TextColor], text);
        SendPlayerMessageToAll(playerid, PText);
        return 0;
    }
    else if(AccInfo[playerid][pVip] > 0)
    {
        format(PText, 144, "{FF0000}(VIP){15FF00}(%d):{FFFFFF} {%06x}%s", playerid, AccInfo[playerid][p_TextColor], text);
        SendPlayerMessageToAll(playerid, PText);
        return 0;
    }
    else if(AccInfo[playerid][Level] < 1 && AccInfo[playerid][pVip] < 1)
    {
        format(PText, 144, "{15FF00}(%d):{FFFFFF} {%06x}%s", playerid, AccInfo[playerid][p_TextColor], text);
        SendPlayerMessageToAll(playerid, PText);
        return 0;
    }
Modified , same problem
Reply
#5

Don't write it just make sure your PText string has a lengh of 144 like

new PText[144];

then instead of writing 144 on format write:

format(PText, sizeof(PText),...
Reply
#6

I don't think above is the cause of the problem.
If it's not, show your SendPlayerMessageToAll stock.
Reply
#7

I finally solved, thanks all for help
here is how I did:

pawn Код:
else if(AccInfo[playerid][Level] >= 3 && AccInfo[playerid][Level] <= 10)
    {
        format(PText, sizeof(PText), "%s{1900FF}(Admin){15FF00}(%d):{FFFFFF} {%06x}%s",PlayerName2(playerid), playerid, AccInfo[playerid][p_TextColor], text);
        SendClientMessageToAll(GetPlayerColor(playerid), PText);
        return 0;
    }
Thanks again
Reply
#8

Your welocme don't forget about reputation !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)