24.06.2013, 04:45
My printf's aren't even showing now. This is my new LoadCharacterNames:
And the thread under OnQueryFinish:
The printf's aren't even working, so I don't even know what's wrong.
pawn Код:
stock LoadCharacterNames(playerid)
{
new string[128];
format(string, sizeof(string), "SELECT * FROM accounts WHERE Username = '%s'", pInfo[playerid][Username]);
mysql_query(string, THREAD_LOAD_CNAMES, playerid, iConnectionHandle);
return 1;
}
pawn Код:
public OnQueryFinish(query[], resultid, extraid, connectionHandle)
{
new
szMessage[128],
szQuery[256];
#pragma unused szQuery
switch(resultid)
{
//Other threads, blablabla
case THREAD_LOAD_CNAMES:
{
printf("%i", mysql_num_rows(connectionHandle));
mysql_store_result(connectionHandle);
mysql_retrieve_row();
mysql_fetch_field_row(PlayerCharacters[extraid][0], "Character1", connectionHandle);
mysql_fetch_field_row(PlayerCharacters[extraid][1], "Character2", connectionHandle);
mysql_fetch_field_row(PlayerCharacters[extraid][2], "Character3", connectionHandle);
printf(PlayerCharacters[extraid][0]);
printf(PlayerCharacters[extraid][1]);
printf(PlayerCharacters[extraid][2]);
mysql_free_result(connectionHandle);
}
}
return 1;
}