18.03.2012, 04:04
well this is what i get
this is my script
Код:
[00:08:36] CMySQLHandler::Query(SELECT * FROM Houses WHERE ID = 11) - Successfully executed. [00:08:36] >> mysql_query( Connection handle: 1 ) [00:08:36] CMySQLHandler::Query(UPDATE Houses SET Owner = 'No Owner' WHERE ID = 11) - An error has occured. (Error ID: 2014, Commands out of sync; you can't run this command now) [00:08:36] >> mysql_query( Connection handle: 1 )
pawn Код:
format(str,sizeof(str),"SELECT * FROM Houses WHERE ID = %d",hcpid[playerid]);
mysql_query(str);
if(HouseInfo[hcpid[playerid]][Cost] > GetPlayerCash(playerid))return SendClientMessage(playerid,red,"ERROR: You don't have enough money to buy this house");
GivePlayerCash(playerid, -HouseInfo[hcpid[playerid]][Cost]);
GetPlayerName(playerid,Nam,sizeof(Nam));
format(str,sizeof(str),"UPDATE Houses SET Owner = '%s' WHERE ID = %d",Nam,hcpid[playerid]);
mysql_query(str);
format(str,sizeof(str),"UPDATE Houses SET HasOwner = 1 WHERE ID = %d",hcpid[playerid]);
mysql_query(str);
format(str, sizeof(str), "{FF9900}House ID:{FFFFFF} %d\n{FF9900}Cost:{FFFFFF} $%i\n{FF9900}Owner:{FFFFFF} %s",hcpid[playerid],HouseInfo[hcpid[playerid]][Cost],Nam);
Update3DTextLabelText(HouseInfo[hcpid[playerid]][hLabel],-1,str);
format(str,sizeof(str),"Congratulations, you bought this house for $%d",HouseInfo[hcpid[playerid]][Cost]);
SendClientMessage(playerid,COLOR_GREEN,str);
PlayerData[playerid][HasHouse] = 1;
PlayerData[playerid][HouseID] = hcpid[playerid];
HouseInfo[hcpid[playerid]][HasOwner] = 1;
format(str,sizeof(str),"UPDATE accounts SET HasHouse = 1,HouseID = %d WHERE Name = '%s'",hcpid[playerid],Nam);
mysql_query(str);
format(HouseInfo[hcpid[playerid]][Owner],24,"%s",Nam);
DestroyDynamicMapIcon(HouseInfo[hcpid[playerid]][MapIcon]);
HouseInfo[hcpid[playerid]][MapIcon] = CreateDynamicMapIcon(HouseInfo[hcpid[playerid]][OutX],HouseInfo[hcpid[playerid]][OutY],HouseInfo[hcpid[playerid]][OutZ], 32,0,-1, -1, -1,100);