19.12.2015, 16:10
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.
If I type /editfurniture ObjectID SQLID I can edit it perfectly, but until I restart the server, the object wont appear in /myfurniture
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 x = 0; x < MAX_HOUSES;x++) {
if(AccInfo[playerid][HouseOwner] == HouseInfo[x][HID]) {
new frid = CreateDynamicObject(fid, HouseInfo[x][ExitX],HouseInfo[x][ExitY],HouseInfo[x][ExitZ], 0,0,0, HouseInfo[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(mysql, query, sizeof(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(mysql, query, "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 x = 0; x < MAX_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;
}