sscanf warning Please help.
#1

I Keep getting this warning when i do /putincell

sscanf warning: Strings without a length are deprecated, please add a destination size.

PHP код:
CMD:putincell(playeridparams[])
{
    new 
giveplayerid,cellid,block[16];
    if(
sscanf(params,"isi",giveplayerid,block,cellid)) return Syntax(playerid,"putincell""[ID] [Block] [Cell]");
    if(
IsACop(playerid) || IsALVMPDCop(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
    {
        if(!
IsPlayerConnected(giveplayerid)) return Error(playerid"That person does not exist!");
        if(!
PlayerInfo[giveplayerid][pJailed]) return Error(playerid"That player is not jailed.");
        new 
string[128], blocknum;
        if(
strcmp(block"a"false) == 1)
        {
            
blocknum 1;
        }
        if(
strcmp(block"b"false) == 1)
        {
            
blocknum 2;
        }
        if(
strcmp(block"c"false) == 1)
        {
            
blocknum 3;
        }
        switch (
blocknum)
        {
            case 
1:
            {
                switch (
cellid)
                {
                    case 
1:
                    { 
Reply
#2

You have to give string length to sscanf.

pawn Код:
if(sscanf(params,"is[16]i",giveplayerid,block,cellid))
And just reminding, this isn't the right section to ask this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)