SA-MP Forums Archive
Wierd [roblem in public - 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: Wierd [roblem in public (/showthread.php?tid=536810)



Wierd [roblem in public - LivingLikeYouDo - 12.09.2014

pawn Код:
public OnHouseDataLoad()
{
    for(new i = 0, i < MAX_HOUSES, i++)
    {
        hData[i][ID]        =   cache_get_row_int(0, ROW_ID, sqHandle);
        hData[i][Safe]      =   cache_get_row_int(0, ROW_SAFE, sqHandle);
        hData[i][Locked]    =   cache_get_row_int(0, ROW_LOCKED, sqHandle);
        hData[i][Owned]     =   cache_get_row_int(0, ROW_OWNED, sqHandle);
        hData[i][Price]     =   cache_get_row_int(0, ROW_PRICE, sqHandle);
        hData[i][Pickup]    =   cache_get_row_int(0, ROW_PICKUP, sqHandle);
        hData[i][Icon]      =   cache_get_row_int(0, ROW_ICON, sqHandle);
        hData[i][eX]        =   cache_get_row_int(0, ROW_EX, sqHandle);
        hData[i][eY]        =   cache_get_row_int(0, ROW_EY, sqHandle);
        hData[i][eZ]        =   cache_get_row_int(0, ROW_EZ, sqHandle);
        hData[i][iX]        =   cache_get_row_int(0, ROW_IX, sqHandle);
        hData[i][iY]        =   cache_get_row_int(0, ROW_IY, sqHandle);
        hData[i][iZ]        =   cache_get_row_int(0, ROW_IZ, sqHandle);
        hData[i][eVW]       =   cache_get_row_int(0, ROW_EVW, sqHandle);
        hData[i][eInt]      =   cache_get_row_int(0, ROW_EINT, sqHandle);
        hData[i][iVW]       =   cache_get_row_int(0, ROW_IVW, sqHandle);
        hData[i][iInt]      =   cache_get_row_int(0, ROW_IINT, sqHandle);
       
    }
    return 1;
}
It happens almost everytime I try to loop;
Код:
C:\Documents and Settings\Taha\Desktop\Project Standalone Survival\filterscripts\housesys.pwn(127) : error 021: symbol already defined: "i"
C:\Documents and Settings\Taha\Desktop\Project Standalone Survival\filterscripts\housesys.pwn(132) : warning 213: tag mismatch
C:\Documents and Settings\Taha\Desktop\Project Standalone Survival\filterscripts\housesys.pwn(127) : warning 204: symbol is assigned a value that is never used: "i"
C:\Documents and Settings\Taha\Desktop\Project Standalone Survival\filterscripts\housesys.pwn(337) : warning 203: symbol is never used: "hCount"



Re: Wierd [roblem in public - HazardouS - 12.09.2014

You declared "i" as a global variable. Change it or change the variable name inside the loops.


Re: Wierd [roblem in public - Stinged - 12.09.2014

Can you show me where you use mysql_tquery with OnHouseDataLoad?
(Not the single line, but the whole code)


Re: Wierd [roblem in public - Vince - 12.09.2014

The parts in a for-statement are separated by a semicolon, not a comma. A comma defines additional information or actions within a section.
pawn Код:
for( initializers ; condition ; increment )
Additionally, you should use cache_get_row_float for x, y and z.