String cuts of,
#1

So, My strings cuts of here as soon as I added the ranks:

pawn Код:
CMD:n(playerid, params[])
{
    new text[128];
    if(!sscanf(params, "s", text))
    {
        new name[MAX_PLAYER_NAME], string[64];
        GetPlayerName(playerid, name, sizeof(name));
        if(PlayerInfo[playerid][AdminLevel] <= 0 )
        {
            if(PlayerInfo[playerid][Score] <= 2)
            {
                format(string, sizeof(string), "[Newbie Chat] Newbie %s say: %s ", name, text);
                ProxDetector(10000000000.0, playerid, string, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN);
            }
            if(PlayerInfo[playerid][Score] >= 3 && PlayerInfo[playerid][Score] < 6)
            {
                format(string, sizeof(string), "[Newbie Chat] Regular Player %s say: %s ", name, text);
                ProxDetector(10000000000.0, playerid, string, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN);
            }
            if(PlayerInfo[playerid][Score] >= 6)
            {
                format(string, sizeof(string), "[Newbie Chat] Experienced Player %s say: %s ", name, text);
                ProxDetector(10000000000.0, playerid, string, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN);
            }
        }
        if(PlayerInfo[playerid][AdminLevel] >= 1 )
        {
            format(string, sizeof(string), "[Newbie Chat] Administrator %s say: %s ", name, text);
            ProxDetector(10000000000.0, playerid, string, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN);
        }
        return 1;
    }
    else return SendClientMessage(playerid, COLOR_RED, "USAGE: /n [Text]");
}
I mean it wont show the whole text
Reply
#2

pawn Код:
string[150]
Reply
#3

You have string in array [ 64 ] = Chars 49( includes + 20 Chars Max Lenght Name) + text.
It will appears only 15 leters from your text. Change it to 128.


Quote:
Originally Posted by Unte99
Посмотреть сообщение
pawn Код:
string[150]
128 is enough.
Reply
#4

tthanks
Reply
#5

Quote:
Originally Posted by Dwane
Посмотреть сообщение
You have string in array [ 64 ] = Chars 49( includes + 20 Chars Max Lenght Name) + text.
It will appears only 15 leters from your text. Change it to 128.




128 is enough.
Well then what if the input text would be larger then ~90 characters ? That still wouldn't fit in.
Reply
#6

If the ProxDetector shows only one line on the chat then it must be 128.
Even if you have 256 it will never show 256 Characters.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)