17.04.2011, 22:05
Hi all again,
Im new in MySQL, so I can find where's the problem: Server saves all server houses, but it dont load any house. I added a loaded house count - and its always 0
Function:
Im new in MySQL, so I can find where's the problem: Server saves all server houses, but it dont load any house. I added a loaded house count - and its always 0
Function:
pawn Код:
stock LoadHouses( )
{
mysql_query( "SELECT * FROM `namudb` " );
mysql_store_result( );
new
Query[ 750 ],
House = 1,
hCount = 0
;
while( mysql_fetch_row( Query ) == 1 && House < 49 )
{
sscanf( Query, "ffffffllls[24]s[24]dddd", NamuDB[ House ][ hIsejimas ][ 0 ], NamuDB[ House ][ hIsejimas ][ 1 ], NamuDB[ House ][ hIsejimas ][ 2 ],
NamuDB[ House ][ hIeimas ][ 0 ], NamuDB[ House ][ hIeimas ][ 1 ], NamuDB[ House ][ hIeimas ][ 2 ], NamuDB[ House ][ hParduodamas ], NamuDB[ House ][ hUzrakintas ], NamuDB[ House ][ hRaktai ], NamuDB[ House ][ hSavininkas ], NamuDB[ House ][ hRSavininkas ], NamuDB[ House ][ hInterior ], NamuDB[ House ][ hNamoID ], NamuDB[ House ][ hPinigai ],
NamuDB[ House ][ hKaina ] );
if( NamuDB[ House ][ hParduodamas ] == 1 )
{
format( Query, 157, "{FFFFFF}Рis namas {6EF83C}yra {FFFFFF}parduodamas.\nKaina: {FF0000}$%d\n{FFFFFF}Namo numeris: {FF0000}%d\n", NamuDB[ House ][ hKaina ], NamuDB[ House ][ hNamoID ] );
NamuDB[ House ][ hText ] = Create3DTextLabel( Query, -1, NamuDB[ House ][ hIsejimas ][ 0 ], NamuDB[ House ][ hIsejimas ][ 1 ], NamuDB[ House ][ hIsejimas ][ 2 ], 25, 0, 0 );
}
else
{
format( Query, 108, "{FFFFFF}Рis namas {FF0000}nлra {FFFFFF}parduodamas.\n{FFFFFF}Savininkas: {FF0000}%s", NamuDB[ House ][ hSavininkas ] );
NamuDB[ House ][ hText ] = Create3DTextLabel( Query, -1, NamuDB[ House ][ hIsejimas ][ 0 ], NamuDB[ House ][ hIsejimas ][ 1 ], NamuDB[ House ][ hIsejimas ][ 2 ], 25, 0, 0 );
if( NamuDB[ House ][ hRaktai ] == 1 )
{
format( Query, 108, "{FFFFFF}Рis namas {FF0000}nлra {FFFFFF}parduodamas.\n{FFFFFF}Savininkas: {FF0000}%s\n{FFFFFF}Namo raktus turi: {FFFF00}%s", NamuDB[ House ][ hSavininkas ], NamuDB[ House ][ hRSavininkas ] );
Update3DTextLabelText( NamuDB[ House ][ hText ], -1, Query );
}
}
hCount ++;
Itter_Add(fNamai, House);
}
mysql_free_result( );
return printf( "[NAMШ SISTEMA]: Iрviso pakrauta namш - %d", hCount );
}