20.02.2014, 12:16
I'm trying to select the objects ID from this Dialog so I can edit the object. The only problem is no matter what object I select in the list it always selects object id 0..
Here's my response for the dialog
pawn Код:
if(strcmp(cmd, "/houseinvent", true) == 0)
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if (PlayerToPoint(200.0, playerid,HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]))
{
if(GetPlayerVirtualWorld(playerid) == HouseInfo[i][EnterWorld])
{
if(PlayerInfo[playerid][pHouse1] == i || PlayerInfo[playerid][pHouse2] == i)
{
new info[256];
for(new object = 0; object < sizeof(ObjectInfo); object++)
{
if(ObjectInfo[object][oCreated] == 1 && ObjectInfo[object][oVW] == HouseInfo[i][EnterWorld])
{
format(info, sizeof(info), "%s Object ID %d\n", info, object);
}
}
ShowPlayerDialog(playerid,520,DIALOG_STYLE_LIST,"Furniture Inventory:", info, "Select","Cancel");
return 1;
}
}
}
}
}
pawn Код:
if(dialogid == 520)
{
if(!response)
{
SendClientMessage(playerid, 0x42F3F198, "You canceled the dialog.");
return 1;
}
if(response)
{
new id;
sscanf(inputtext[4], "d", id);
DestroyDynamicObject(ObjectInfo[id][oObject]);
ObjectInfo[id][oObject] = CreateObject(ObjectInfo[id][oModel],ObjectInfo[id][oX],ObjectInfo[id][oY],ObjectInfo[id][oZ],ObjectInfo[id][oRX],ObjectInfo[id][oRY],ObjectInfo[id][oRZ]);
EditObject(playerid, ObjectInfo[id][oObject]);
SendClientMessage(playerid, COLOR_ORANGE, "You're now editing the object.");
EditingObject[playerid] = id;
return 1;
}
}