sscanf warning help
#1

hello i can compile my my GM just fine no errors but when i start my server i get

Код:
[20:47:40] sscanf warning: Unenclosed specifier parameters are deprecated, consider using something like p<,>.
[20:47:40] sscanf warning: Unenclosed specifier parameters are deprecated, consider using something like p<,>.
[20:47:40] sscanf warning: Unenclosed specifier parameters are deprecated, consider using something like p<,>.
[20:47:40] sscanf warning: Unenclosed specifier parameters are deprecated, consider using something like p<,>.
[20:47:40] sscanf warning: Unenclosed specifier parameters are deprecated, consider using something like p<,>.
in my server CMD

there is no location to what string needs a value is there away of finding this out?
Reply
#2

Show me the code that sends the warning to the console.
Reply
#3

am not sure where the error is and i have 14k lines of code
Reply
#4

i get the error when i use the command to create a dealership

pawn Код:
CMD:adddealership(playerid, params[])
{
    if(AdminLevel[playerid]!=4) return SendClientMessage(playerid, COLOR_RED, "You admin is'nt high enough!");
    if(!IsPlayerSpawned(playerid)) return SendClientMessage(playerid, COLOR_RED, "You can't use this command now!");
    for(new i=1; i < MAX_DEALERSHIPS; i++)
    {
        if(!DealershipCreated[i])
        {
            new msg[128];
            DealershipCreated[i] = 1;
            GetPlayerPos(playerid, DealershipPos[i][0], DealershipPos[i][1], DealershipPos[i][2]);
            UpdateDealership(i, 0);
            SaveDealership(i);
            format(msg, sizeof(msg), "Added dealership id %d", i);
            SendClientMessage(playerid, COLOR_WHITE, msg);
            return 1;
        }
    }
    SendClientMessage(playerid, COLOR_RED, "Can't add any more dealerships!");
    return 1;
}
Reply
#5

In the command I see nothing about sscanf, the code could be in a function that uses the command.

PHP код:
UpdateDealership(i0);

SaveDealership(i); 
Reply
#6

its only happened since i added the dealerships with that command

pawn Код:
UpdateDealership(dealerid, removeold)
{
    if(DealershipCreated[dealerid])
    {
        if(removeold)
        {
            Delete3DTextLabel(DealershipLabel[dealerid]);
        }
        new labeltext[32];
        format(labeltext, sizeof(labeltext), "Vehicle Dealership\nID: %d", dealerid);
        DealershipLabel[dealerid] = Create3DTextLabel(labeltext, 0x00BB00DD, DealershipPos[dealerid][0],
            DealershipPos[dealerid][1], DealershipPos[dealerid][2]+0.5, 20.0, 0);
    }
}
pawn Код:
SaveDealership(dealerid)
{
    new filename[64], line[256];
    format(filename, sizeof(filename), DEALERSHIP_FILE_PATH "d%d.ini", dealerid);
    new File:handle = fopen(filename, io_write);
    format(line, sizeof(line), "Created=%d\r\n", DealershipCreated[dealerid]); fwrite(handle, line);
    format(line, sizeof(line), "Pos=%.3f,%.3f,%.3f\r\n", DealershipPos[dealerid][0],
        DealershipPos[dealerid][1], DealershipPos[dealerid][2]);
    fwrite(handle, line);
    fclose(handle);
}
Reply
#7

pawn Код:
LoadDealerships()
{
    new File:handle, count;
    new filename[64], line[256], s, key[64];
    for(new i=1; i < MAX_DEALERSHIPS; i++)
    {
        format(filename, sizeof(filename), DEALERSHIP_FILE_PATH "d%d.ini", i);
        if(!fexist(filename)) continue;
        handle = fopen(filename, io_read);
        while(fread(handle, line))
        {
            StripNL(line);
            s = strfind(line, "=");
            if(!line[0] || s < 1) continue;
            strmid(key, line, 0, s++);
            if(strcmp(key, "Created") == 0) DealershipCreated[i] = strval(line[s]);
            else if(strcmp(key, "Pos") == 0) sscanf(line[s], "p,fff", DealershipPos[i][0],
                DealershipPos[i][1], DealershipPos[i][2]);
        }
        fclose(handle);
        if(DealershipCreated[i]) count++;
    }
    printf("  Loaded %d dealerships", count);
}
Reply
#8

PHP код:
LoadDealerships()
{
    new 
File:handlecount;
    new 
filename[64], line[256], skey[64];
    for(new 
i=1MAX_DEALERSHIPSi++)
    {
        
format(filenamesizeof(filename), DEALERSHIP_FILE_PATH "d%d.ini"i);
        if(!
fexist(filename)) continue;
        
handle fopen(filenameio_read);
        while(
fread(handleline))
        {
            
StripNL(line);
            
strfind(line"=");
            if(!
line[0] || 1) continue;
            
strmid(keyline0s++);
            if(
strcmp(key"Created") == 0DealershipCreated[i] = strval(line[s]);
            else if(
strcmp(key"Pos") == 0sscanf(line[s], "p<,>fff"DealershipPos[i][0],
                
DealershipPos[i][1], DealershipPos[i][2]);
        }
        
fclose(handle);
        if(
DealershipCreated[i]) count++;
    }
    
printf("  Loaded %d dealerships"count);

Reply
#9

Thanks JuanStone thats fixed it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)