12.06.2015, 20:12
So, I've had this problem for about 4 - 5 days now and it's really really irritating me. I'm currently using BlueG's MySQL R39-3.
Anyway the problem is that when I store the house and slotID inside the database it always stores it as 2 and 3 :/ I've added some debug code which displays what it's actual values are at; they display as the right ones but the database always stores as 2 & 3 :@
It's kinda difficult for me to explain........ here's some code and ss's.
CreateNewFurnitureObject function:
Dialog Response for the buy a furniture item:
Database:
REP++ for a fast response and helpful information on the problem.
Anyway the problem is that when I store the house and slotID inside the database it always stores it as 2 and 3 :/ I've added some debug code which displays what it's actual values are at; they display as the right ones but the database always stores as 2 & 3 :@
It's kinda difficult for me to explain........ here's some code and ss's.
CreateNewFurnitureObject function:
PHP код:
stock CreateNewFurniture(playerid, houseID, ModelID, Float:iiX, Float:iiY, Float:iiZ, Float:irX, Float:irY, Float:irZ)
{
new query[400], iSlot = GetNextFurnitureSlot(houseID);
if(iSlot == INVALID_FURNITURE_SLOT || houseID == INVALID_HOUSE_ID) printf("Invalid Slots! No more left for house: %d.", houseID, iSlot);
printf("House: %d | Slot: %d", houseID, iSlot);
mysql_format(MySQL, query, sizeof(query), "INSERT INTO `FurnitureInfo` (`HouseID`,\
`SlotID`, `X`, `Y`, `Z`, `rX`, `rY`, `rZ`, `Model`) VALUES (%d, %d, '%f', '%f', '%f', '%f', '%f', '%f', %d)",
HouseID, SlotID, iiX, iiY, iiZ, irX, irY, irZ, ModelID);
mysql_tquery(MySQL, query);
ReloadFurnitureObject(houseID, iSlot);
if(playerid != INVALID_PLAYER_ID) EditDynamicObject(playerid, HFurnitureInfo[houseID][iSlot][fObject]);
return iSlot;
}
PHP код:
if(dialogid == DIALOG_FURNITURE_BUY && response)
{
new iCount;
for(new c; c < sizeof(hfObjects); c++)
{
if(PInfo[playerid][hfChosenCategory] == FURNITURE_CATEGORY_LIVINGROOM)
{
if(hfObjects[c][hfCategory] != FURNITURE_CATEGORY_LIVINGROOM) continue;
if(iCount == listitem)
{
new iHouse = PInfo[playerid][InHouse], Float:piX, Float:piY, Float:piZ;
GetPlayerPos(playerid, piX, piY, piZ);
CreateNewFurniture(playerid, iHouse, hfObjects[c][hfModel], piX, piY, piZ, 0.0, 0.0, 0.0);
printf("ModelID: %d", hfObjects[c][hfModel]);
break;
}
iCount++;
}
}
}
if(dialogid == DIALOG_FURNITURE_BUY && !response) return PInfo[playerid][hfChosenCategory] = -1, ShowFurnitureDialog(playerid, DIALOG_FURNITURE_LOBBY);
REP++ for a fast response and helpful information on the problem.