06.05.2010, 18:54
Hello again,
Today I've been setting up my Factions database and I managed to set it up in the script fine to connect and so on but when I use printf(); something is not working.
printf();
It only comes up with:
Here is the LoadFaction(); function:
For some strange reason the name of the faction isn't appearing. What am I doing wrong? :P
(I've edited out most of the code like the other parts of the faction)
Today I've been setting up my Factions database and I managed to set it up in the script fine to connect and so on but when I use printf(); something is not working.
printf();
pawn Код:
printf("[Factions] Name: %s ID: %d",DynamicFactions[ idx ][ fName ],DynamicFactions[ idx ][ fType ]);
Код:
[Factions] Name: ID: 1
pawn Код:
public LoadFaction()
{
new DataString[ 128 ], String[ 128 ], Query[ 128 ], idx;
format( Query, sizeof( Query ), "SELECT * FROM `Factions`");
mysql_query( Query );
mysql_store_result();
while( mysql_fetch_row_data() )
{
mysql_fetch_field( "FactionID", DataString );
DynamicFactions[ idx ][ fID ] = strval( DataString );
mysql_fetch_field( "FactionName", String );
DynamicFactions[ idx ][ fName ] = strval( String );
printf("[Factions] Name: %s ID: %d",DynamicFactions[ idx ][ fName ],DynamicFactions[ idx ][ fType ]);
idx++;
}
mysql_free_result();
return 1;
}
(I've edited out most of the code like the other parts of the faction)