SA-MP Forums Archive
sscanf warning Please help. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: sscanf warning Please help. (/showthread.php?tid=560291)



sscanf warning Please help. - Samieastwood - 27.01.2015

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:
                    { 



Re: sscanf warning Please help. - Ironboy - 27.01.2015

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.