Making text string longer
#3

Max chat string is about 150 (since 0.3c). There is no need of using 256.

pawn Код:
COMMAND:o(playerid, params[])
{
    new text[150];
    if(sscanf(params, "s[150]", text))
    {
        new name[MAX_PLAYER_NAME], string[150];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(text), "%s:  [[%s]] ", name, text);
        SendClientMessageToAll(COLOR_WHITE, string);
        return 1;
    }
    else return SendClientMessage(playerid, COLOR_RED, "USAGE: /o [Text]");
}
Also, sscanf returns 0 on success, therefore you don't do "!sscanf."

Which version of sscanf are you using? You're probably not using the newest since you put strings without string size. Use the newest sscanf, find it with the "search" feature.
Reply


Messages In This Thread
Making text string longer - by milanosie - 14.01.2012, 13:42
Re: Making text string longer - by mineralo - 14.01.2012, 13:44
Re: Making text string longer - by Mean - 14.01.2012, 13:52
Re: Making text string longer - by milanosie - 14.01.2012, 14:00
Re: Making text string longer - by Mean - 14.01.2012, 14:01
Re: Making text string longer - by ivanVU - 14.01.2012, 14:23
Re: Making text string longer - by Mean - 14.01.2012, 14:44

Forum Jump:


Users browsing this thread: 2 Guest(s)