Sscanf 2 problem
#1

Hello there,

I have a problem with SSCANF2.
The maximum length of text is way too low and I have no idea how to extend it.
It might've something to do with this:




Uploaded with ImageShack.us


Does anyone know how to extend the length of the text and fix those errors?

Thanks,
Jack Shred.
Reply
#2

Could you provide the script? (command)
Reply
#3

It's pretty much any command where you can place text.

Here's one example:

Quote:

dcmd_o(playerid, params[])
{
if(pInfo[playerid][pAdmin] > 2 || tOOC == 1)
{
new text[256],strtext[256];
if(sscanf(params,"s",text))
return SendClientMessage(playerid,0xFF634700,"[SYNTAX]:{FFFFFF} /o [message]");
format(strtext,129,"(( %s: %s ))",NUsN(playerid),text);
SendClientMessageToAll(0xFFFFFF00, strtext);
}
else
SendClientMessage(playerid,0xFF634700,"[ERROR]:{FFFFFF} You are either not a level 2 admin or OOC is turned off!");
return 1;
}

Reply
#4

pawn Код:
dcmd_o(playerid, params[])
{
    if(pInfo[playerid][pAdmin] > 2 || tOOC == 1)
    {
        new
            iStr[128];

        if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid,0xFF634700, "[SYNTAX]:{FFFFFF} /o [message]");

        format(iStr, sizeof(iStr), "(( %s: %s ))", NUsN(playerid), params);
        return SendClientMessageToAll(0xFFFFFF00, iStr);
    }
    else return SendClientMessage(playerid,0xFF634700,"[ERROR]:{FFFFFF} You are either not a level 2 admin or     OOC is turned off!");
}
Notice the string size after the "s". Read more about it on the sscanf2 topic.
Reply
#5

Thank you, it compiled fine.
Testing it right now.
I'll post the results.

EDIT: It worked, thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)