Furniture not showing the ID
#1

Okay so the problem is quite simple, lets say I purchase new furniture, it wont show in /myfurniture BUT it allows me to edit it
So, I can edit it but I cannot see it in /myfurniture for some reason.

PHP код:
YCMD:buyfurniture(playerid,params[],help) {
    
#pragma unused params
    
if(help) return SendClientMessage(playerid,COLOR_RED,"This command is used to purchase furniture for your house");
    new 
fid;
    if(
sscanf(params,"i",fid)) return SendClientMessage(playerid,COLOR_RED,"Usage: /buyfurniture [Object ID]");
    if(
GetPlayerCash(playerid) < GetFurniturePrice(fid)) return SendClientMessage(playerid,COLOR_RED,"Not enough money");
    if(
AccInfo[playerid][HouseOwner] == 0) return SendClientMessage(playerid,COLOR_RED,"You dont own a house");
    if(
GetFurniturePrice(fid) == 5000000) return SendClientMessage(playerid,COLOR_RED,"Invalid Furniture ID");
    
    for(new 
0MAX_HOUSES;x++) {
        if(
AccInfo[playerid][HouseOwner] == HouseInfo[x][HID]) {
            new 
frid CreateDynamicObject(fidHouseInfo[x][ExitX],HouseInfo[x][ExitY],HouseInfo[x][ExitZ], 0,0,0HouseInfo[x][VirtualWorld],HouseInfo[x][Interior]);
            
FurnitureData[frid][FurnitureSlot] = HouseInfo[x][HouseFurniture];
            
FurnitureData[frid][FurnitureMaster] = x;
            
FurnitureData[frid][FurnitureModel] = fid;
            
FurnitureData[frid][FurnitureX] = HouseInfo[x][ExitX];
            
FurnitureData[frid][FurnitureY] = HouseInfo[x][ExitY];
            
FurnitureData[frid][FurnitureZ] = HouseInfo[x][ExitZ];
             
FurnitureData[frid][FurnitureInterior] = HouseInfo[x][Interior];
             
FurnitureData[frid][FurnitureWorld] = HouseInfo[x][VirtualWorld];
             
FurnitureData[frid][FurnitureObject] = frid;
             
SetDynamicObjectPos(frid,HouseInfo[x][ExitX],HouseInfo[x][ExitY],HouseInfo[x][ExitZ]);
             
HouseInfo[x][HouseFurniture] += 1;
             new 
query[512];
            
mysql_format(mysqlquerysizeof(query),"INSERT INTO `furniture` (`Master`,`Slot`,`Model`,`X`,`Y`,`Z`,`RX`,`RY`,`RZ`,`Interior`,`World`) VALUES ('%i','%i','%i','%f','%f','%f','%f','%f','%f','%i','%i')",\
            
HouseInfo[x][HID],HouseInfo[x][HouseFurniture],fid,HouseInfo[x][ExitX],HouseInfo[x][ExitY],HouseInfo[x][ExitZ],0.0,0.0,0.0,HouseInfo[x][Interior],HouseInfo[x][VirtualWorld]);
            
mysql_tquery(mysqlquery"OnFurnitureCreation""i"frid);
            print(
query);
        }
    }
    return 
true;
}
YCMD:myfurniture(playerid,params[],help) {
    new 
string[128];
    if(
help) return SendClientMessage(playerid,COLOR_RED,"This command is used to list all your house furniture");
    for(new 
0MAX_FURNITURE;x++) {
        if(
AccInfo[playerid][HouseOwner] == FurnitureData[x][FurnitureMaster]) {
            
format(string,sizeof(string),"Object ID: %i || SQL ID: %i || Model ID: %i\n",FurnitureData[x][FurnitureObject],FurnitureData[x][FurnitureID],FurnitureData[x][FurnitureModel]);
            
SendClientMessage(playerid,COLOR_RED,string);
        }
    }
    return 
true;

If I type /editfurniture ObjectID SQLID I can edit it perfectly, but until I restart the server, the object wont appear in /myfurniture
Reply
#2

There is nothing wrong here twinki, Show us myfurniture command
Reply
#3

Quote:
Originally Posted by vassilis
Посмотреть сообщение
There is nothing wrong here twinki, Show us myfurniture command
Weird shit Im tellin u
PHP код:
YCMD:myfurniture(playerid,params[],help) { 
    new 
string[128]; 
    if(
help) return SendClientMessage(playerid,COLOR_RED,"This command is used to list all your house furniture"); 
    for(new 
0MAX_FURNITURE;x++) { 
        if(
AccInfo[playerid][HouseOwner] == FurnitureData[x][FurnitureMaster]) { 
            
format(string,sizeof(string),"Object ID: %i || SQL ID: %i || Model ID: %i\n",FurnitureData[x][FurnitureObject],FurnitureData[x][FurnitureID],FurnitureData[x][FurnitureModel]); 
            
SendClientMessage(playerid,COLOR_RED,string); 
        } 
    } 
    return 
true

Reply
#4

First of all whats the difference between FurnitureObject variable and FurnitureModel?
I guess the first returns a string with furniture name and furniture model i guess is the object id? or what?
Reply
#5

Quote:
Originally Posted by vassilis
Посмотреть сообщение
First of all whats the difference between FurnitureObject variable and FurnitureModel?
I guess the first returns a string with furniture name and furniture model i guess is the object id? or what?
Okay so:
FurnitureModel = Object Model
FurnitureObject = Object ID (current server object ID)
Reply
#6

Resolved. ID was popping out as 0.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)