SA-MP Forums Archive
Loading code problem -.- - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Loading code problem -.- (/showthread.php?tid=385228)



Loading code problem -.- - RLGaming - 14.10.2012

pawn Код:
LoadDFU()
{
    if(!fexist("Factions/Factions.cfg")) return 1;

    new
        szFileStr[512],
        File: fHandle = fopen("Factions/Factions.cfg", io_read);

    for(new iIndex; iIndex < sizeof(arrFaction); ++iIndex) {

        fread(fHandle, szFileStr);

        sscanf(szFileStr, "%i|%i|%s|%s|%s|%f|%f|%f|%f|%f|%f|%f|%f|%d|%d|%d|%d|$%i|%d|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s\r\n",
            arrFaction[iIndex][g_iFactionID],
            arrFaction[iIndex][g_iFactionType],
            arrFaction[iIndex][g_szFactionName],
            arrFaction[iIndex][g_iLockerGuns],
            arrFaction[iIndex][g_iLockerCost],
            arrFaction[iIndex][g_iAllegiance],
            arrFaction[iIndex][g_iBugAccess],
            arrFaction[iIndex][g_iChatAccess],
            arrFaction[iIndex][g_iRadioAccess],
            arrFaction[iIndex][g_iDeptRadioAccess],
            arrFaction[iIndex][g_hDutyColour],
            arrFaction[iIndex][g_hRadioColour],
            arrFaction[iIndex][g_iShareAssets],
            arrFaction[iIndex][g_iLockerStock],
            arrFaction[iIndex][g_fLockerPos],
            arrFaction[iIndex][g_iLockerVW],
            arrFaction[iIndex][g_fCratePos],
            arrFaction[iIndex][g_iFacVault],
            arrFaction[iIndex][g_t3DLabels],
            arrFaction[iIndex][p_iRank1],
            arrFaction[iIndex][p_iRank2],
            arrFaction[iIndex][p_iRank3],
            arrFaction[iIndex][p_iRank4],
            arrFaction[iIndex][p_iRank5],
            arrFaction[iIndex][p_iRank6],
            arrFaction[iIndex][p_iRank7],
            arrFaction[iIndex][p_iRank8],
            arrFaction[iIndex][p_iRank9],
            arrFaction[iIndex][p_iRank10],
            arrFaction[iIndex][p_iRank11],
            arrFaction[iIndex][p_iRank12]
        );
    }
    return fclose(fHandle);
}
Error:
Quote:

(1292 -- 1311) : warning 213: tag mismatch

Line 1292 is where it says 'sscanf(szFileStr, "letter here",' and then to line
Quote:

arrFaction[iIndex][g_t3DLabels],

Anyone please!


Re: Loading code problem -.- - Azazelo - 14.10.2012

You are typed may be wrong this "$%i" in
Quote:

sscanf(szFileStr, "%i|%i|%s|%s|%s|%f|%f|%f|%f|%f|%f|%f|%f|%d|%d|%d|% d|$%i

or you miss variable type.


Re: Loading code problem -.- - RLGaming - 14.10.2012

I already tried that


Re: Loading code problem -.- - Azazelo - 14.10.2012

Is it valure of this number ??
Quote:

printf("%i",arrFaction[iIndex][g_t3DLabels]);

You may try to print all value and see if you real miss tag.


Re: Loading code problem -.- - RLGaming - 14.10.2012

It didnt print anything but on my server log I get this:
pawn Код:
[00:10:49] sscanf warning: sscanf specifiers do not require '' before them.
[00:10:49] 0
[00:10:49] sscanf warning: sscanf specifiers do not require '' before them.
[00:10:49] 0
[00:10:49] sscanf warning: sscanf specifiers do not require '' before them.
[00:10:49] 0
[00:10:49] sscanf warning: sscanf specifiers do not require '' before them.
[00:10:49] 0
[00:10:49] sscanf warning: sscanf specifiers do not require '' before them.
[00:10:49] 0
[00:10:49] sscanf warning: sscanf specifiers do not require '' before them.
[00:10:49] 0
[00:10:49] sscanf warning: sscanf specifiers do not require '' before them.
[00:10:49] 0
[00:10:49] sscanf warning: sscanf specifiers do not require '' before them.
[00:10:49] 0
[00:10:49] sscanf warning: sscanf specifiers do not require '' before them.
[00:10:49] 0
[00:10:49] sscanf warning: sscanf specifiers do not require '' before them.
[00:10:49] 0
[00:10:49] sscanf warning: sscanf specifiers do not require '' before them.
[00:10:49] 0
[00:10:49] sscanf warning: sscanf specifiers do not require '' before them.
[00:10:49] 0



Re: Loading code problem -.- - Azazelo - 14.10.2012

Hmm do this

Below line
Quote:

fread(fHandle, szFileStr);
printf("%s",szFileStr);

and rest of code make to be comment //


Re: Loading code problem -.- - RLGaming - 14.10.2012

I get this now
pawn Код:
[00:38:13] sscanf warning: sscanf specifiers do not require '' before them.
[00:38:13] 0|1|hi|||0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0|0|0|0|$0|0||||||||||||


[00:38:13] sscanf warning: sscanf specifiers do not require '' before them.
[00:38:13] 0|0||||0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0|0|0|0|$0|0||||||||||||


[00:38:13] sscanf warning: sscanf specifiers do not require '' before them.
[00:38:13] 0|0||||0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0|0|0|0|$0|0||||||||||||


[00:38:13] sscanf warning: sscanf specifiers do not require '' before them.
[00:38:13] 0|0||||0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0|0|0|0|$0|0||||||||||||


[00:38:13] sscanf warning: sscanf specifiers do not require '' before them.
[00:38:13] 0|0||||0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0|0|0|0|$0|0||||||||||||


[00:38:13] sscanf warning: sscanf specifiers do not require '' before them.
[00:38:13] 0|0||||0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0.000000|0|0|0|0|$0|0||||||||||||



Re: Loading code problem -.- - Azazelo - 14.10.2012

Show me you enum or chek it
Quote:

"%i|%i|%s|%s|%s|%f|%f|%f|%f|%f|%f|%f|%f|%d|%d|%d|% d|$%i|%d|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s\r\n",
g_iFactionID, //number
g_iFactionType,//number
g_szFactionName[],//string
g_iLockerGuns[],//string
g_iLockerCost[],//string
Float:g_iAllegiance,//float
Float:g_iBugAccess,//float
Float:g_iChatAccess,//float
Float:g_iRadioAccess,//float
Float:g_iDeptRadioAccess,//float
Float:g_hDutyColour,//float
Float:g_hRadioColour,//float
Float:g_iShareAssets,//float
g_iLockerStock,//double
g_fLockerPos,//double
g_iLockerVW,//double
g_fCratePos,//double
g_iFacVault,//number
g_t3DLabels,//double
p_iRank1[],//string
p_iRank2[],//string
p_iRank3[],//string
p_iRank4[],//string
p_iRank5[],//string
p_iRank6[],//string
p_iRank7[],//string
p_iRank8[],//string
p_iRank9[],//string
p_iRank10[],//string
p_iRank11[],//string
p_iRank12[]//string

Is this corect ? In you enum ?


Re: Loading code problem -.- - RLGaming - 14.10.2012

my enum
pawn Код:
enum eFactionInfo {
    g_iFactionID,
    g_iFactionType,
    g_szFactionName[GROUP_MAX_NAME_LEN],
    g_iLockerGuns[16],
    g_iLockerCost[MAX_GROUP_WEAPONS],
    g_iAllegiance,
    g_iBugAccess,
    g_iChatAccess,
    g_iFacVault,
    g_iRadioAccess,
    g_iDeptRadioAccess,
    g_hDutyColour,
    p_iMember,
    p_iRanks[255],
    p_iRank1[20],
    p_iRank2[20],
    p_iRank3[20],
    p_iRank4[20],
    p_iRank5[20],
    p_iRank6[20],
    p_iRank7[20],
    p_iRank8[20],
    p_iRank9[20],
    p_iRank10[20],
    p_iRank11[20],
    p_iRank12[20],
    g_hRadioColour,
    g_iShareAssets,
    g_iLockerStock,
    Float: g_fLockerPos[3],
    g_iLockerVW,
    Float: g_fCratePos[3],
    Text3D: g_t3DLabels[2],
};
Thanks for all the help so far


Re: Loading code problem -.- - Azazelo - 15.10.2012

OK i see problem now

g_iAllegiance,
g_iBugAccess,
g_iChatAccess,
g_iFacVault,
g_iRadioAccess,
g_iDeptRadioAccess,
g_hDutyColour,
p_iMember,

Are this need to be Float ==== You know what is float (0.000000) right or numbers (1156156)??