Problem with MySQL + Furniture System..
#1

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:
PHP код:
stock CreateNewFurniture(playeridhouseIDModelIDFloat:iiXFloat:iiYFloat:iiZFloat:irXFloat:irYFloat:irZ)
{
    new 
query[400], iSlot GetNextFurnitureSlot(houseID);
    if(
iSlot == INVALID_FURNITURE_SLOT || houseID == INVALID_HOUSE_IDprintf("Invalid Slots! No more left for house: %d."houseIDiSlot);
    
printf("House: %d | Slot: %d"houseIDiSlot);
    
     
mysql_format(MySQLquerysizeof(query), "INSERT INTO `FurnitureInfo` (`HouseID`,\
     `SlotID`, `X`, `Y`, `Z`, `rX`, `rY`, `rZ`, `Model`) VALUES (%d, %d, '%f', '%f', '%f', '%f', '%f', '%f', %d)"
,
     
HouseIDSlotIDiiXiiYiiZirXirYirZModelID);
     
    
mysql_tquery(MySQLquery);
    
ReloadFurnitureObject(houseIDiSlot);
    if(
playerid != INVALID_PLAYER_IDEditDynamicObject(playeridHFurnitureInfo[houseID][iSlot][fObject]);
    return 
iSlot;

Dialog Response for the buy a furniture item:
PHP код:
    if(dialogid == DIALOG_FURNITURE_BUY && response)
    {
        new 
iCount;
        for(new 
csizeof(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:piXFloat:piYFloat:piZ;
                    
GetPlayerPos(playeridpiXpiYpiZ);
                    
CreateNewFurniture(playeridiHousehfObjects[c][hfModel], piXpiYpiZ0.00.00.0);
                    
printf("ModelID: %d"hfObjects[c][hfModel]);
                    break;
                }
                
iCount++;
            }
        }
    }
    if(
dialogid == DIALOG_FURNITURE_BUY && !response) return PInfo[playerid][hfChosenCategory] = -1ShowFurnitureDialog(playeridDIALOG_FURNITURE_LOBBY); 
Database:






REP++ for a fast response and helpful information on the problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)