05.12.2010, 15:55
(
Last edited by armyoftwo; 05/12/2010 at 04:25 PM.
)
I can't tell in which function the problem is
Code:
[19:22:18] CMySQLHandler::Query(SELECT * FROM characters WHERE faction = '1') - An error has occured. (Error ID: 2014, Commands out of sync; you can't run this command now) [19:22:18] >> mysql_store_result( Connection handle: 1 ) [19:22:18] CMySQLHandler::StoreResult() - Result was stored. [19:22:18] >> mysql_fetch_row_format( Connection handle: 1 ) [19:22:18] CMySQLHandler::FetchRow() - An error has occured. (Error ID: 2014, Commands out of sync; you can't run this command now) [19:22:18] >> mysql_free_result( Connection handle: 1 ) [19:22:18] CMySQLHandler::FreeResult() - Result was successfully free'd. [19:22:21] >> mysql_query( Connection hand
pawn Code:
{
new message[128];
new Date[25];
new CharacterIDs;
new mSQLID;
new messagescount = 0;
format(string, sizeof(string), "SELECT * FROM offline_messages WHERE characterID = '%d'", AccountData[playerid][characterID]);
mysql_query(string);
mysql_store_result();
AddDListItem(playerid, "Message type\t\t\t Date", 10001, 0);
string = " ";
ProductList = " ";
while(mysql_fetch_row_format(line,"|")) {
sscanf(line, "p<|>iis[128]s[25]", mSQLID, CharacterIDs , message, Date );
messagescount ++;
//SendFormattedMessage(playerid, COLOR_YELLOW, "[Offline Message:] Date: %i %s Message: %s", Date, month, message);
format(ProductList, sizeof(ProductList), "Offline Message\t\t %s", Date);
}
if(messagescount == 0)
{
ShowPlayerDialog(playerid, 99999, DIALOG_STYLE_MSGBOX, "No Messages", "You have no messages", "Okay", "Cancel");
return 1;
}
format(string, sizeof(string), "New messages: %i", messagescount);
mysql_free_result();
}
pawn Code:
stock ShowFactionMembers(playerid, factionid)
{
string = " ";
ProductList = " ";
new LastSeen[20];
new Rankk;
new MemberCount;
new CharacterName[24];
new RankkName[24];
new MemberID;
format(string, sizeof(string), "SELECT * FROM characters WHERE faction = '%d'", factionid);
mysql_query(string);
mysql_store_result();
AddDListItem(playerid, "Member Name\t\tRank\t\t\tLast Seen", 10000, 0);
while(mysql_fetch_row_format(line,"|"))
{
MemberCount ++;
sscanf(line, "p<|>{iffiiiiiii}i{ii}s[24]i{ffffii}s[20]", Rankk, CharacterName, MemberID, LastSeen );
switch(Rankk)
{
case 1: format(RankkName, 24, "%s", FactionInfo[factionid][Rank1]);
case 2: format(RankkName, 24, "%s", FactionInfo[factionid][Rank2]);
case 3: format(RankkName, 24, "%s", FactionInfo[factionid][Rank3]);
case 4: format(RankkName, 24, "%s", FactionInfo[factionid][Rank4]);
case 5: format(RankkName, 24, "%s", FactionInfo[factionid][Rank5]);
}
format(ProductList, sizeof(ProductList), "%s\t\t%s\t\t%s", CharacterName, RankkName, LastSeen);
printf("Prod: %s string: %s", ProductList, string);
}
format(string, sizeof(string), "Members: %i", MemberCount);
mysql_free_result();
}