How to translate this sscanf function to avoid the plugin?
#1

Hello, I am using this include: https://sampforum.blast.hk/showthread.php?tid=329813

But it uses sscanf2, I didn't like it because I already have too many plugins and I don't use it for my gamemode.

The code I want to "translate" is:
PHP код:
    while(fread(camFileline128))
    {
        if (
idx == MAX_CAMNODE)
        {
            print(
"ERROR: Camera node limit reached");
            break;
        }
        if (!
sscanf(line"p<,>ffffffD(-1)D(-1)D(-1)"// Too much for one line
            
camData[id][idx][cam_cPosX], camData[id][idx][cam_cPosY], camData[id][idx][cam_cPosZ],
            
camData[id][idx][cam_lPosX], camData[id][idx][cam_lPosY], camData[id][idx][cam_lPosZ],
            
tmpData[TMP_LOAD][0], tmpData[TMP_LOAD][1], tmpData[TMP_LOAD][2] ))
        {
            for(new 
c;c<TMP_DATA_COUNT;c++) // c = cell reference
            
{
                if (
tmpData[TMP_LOAD][c] == -1tmpData[TMP_LOAD][c] = tmpData[TMP_KEEP][c]; // If it an optional param has -1 set it's detault value
                
else tmpData[TMP_KEEP][c] = tmpData[TMP_LOAD][c]; // Otherwise set the default value to the value just read
                // This method means that you can define timings for a set of coordinates
                // simply by defining the top one as what you want and leaving the rest blank
                // These settings will be default until the next line is found with optional params
            
}
            
camData[id][idx][cam_moveTime] = tmpData[TMP_LOAD][0]; // Set the values to the global array cell of this camera
            
camData[id][idx][cam_waitTime] = tmpData[TMP_LOAD][1];
            
camData[id][idx][cam_moveType] = tmpData[TMP_LOAD][2];
        }
        
idx++;
    } 
More specific:

PHP код:
        if (!sscanf(line"p<,>ffffffD(-1)D(-1)D(-1)"// Too much for one line
            
camData[id][idx][cam_cPosX], camData[id][idx][cam_cPosY], camData[id][idx][cam_cPosZ],
            
camData[id][idx][cam_lPosX], camData[id][idx][cam_lPosY], camData[id][idx][cam_lPosZ],
            
tmpData[TMP_LOAD][0], tmpData[TMP_LOAD][1], tmpData[TMP_LOAD][2] )) 
I want to remove that sscanf function but I don't understand what "p<,>ffffffD(-1)D(-1)D(-1)" means.

Is it possible to translate or I must use the plugin just for this include?

Thank you
Reply


Messages In This Thread
How to translate this sscanf function to avoid the plugin? - by iSanchez - 16.04.2017, 03:56
Re: How to translate this sscanf function to avoid the plugin? - by Logic_ - 16.04.2017, 04:03
Re: How to translate this sscanf function to avoid the plugin? - by Vince - 16.04.2017, 08:48
Re: How to translate this sscanf function to avoid the plugin? - by iSanchez - 18.04.2017, 18:08

Forum Jump:


Users browsing this thread: 1 Guest(s)