16.08.2013, 13:31
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_MENU:
{
if(response)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, DIALOG_MENU_EDIT, DIALOG_STYLE_LIST,"My Accessories", "Adjust Object\nDelete Permanently\nUse Accessories\nRemove Accessories", "Select", "Cancel");
}
case 1:
{
ShowPlayerDialog(playerid, DIALOG_MENU_EDIT1, DIALOG_STYLE_LIST,"My Accessories", "Adjust Object\nDelete Permanently\nUse Accessories\nRemove Accessories", "Select", "Cancel");
}
case 2:
{
ShowPlayerDialog(playerid, DIALOG_MENU_EDIT2, DIALOG_STYLE_LIST,"My Accessories", "Adjust Object\nDelete Permanently\nUse Accessories\nRemove Accessories", "Select", "Cancel");
}
}
}
}
case DIALOG_MENU_EDIT:
{
if(response)
{
switch(listitem)
{
case 0:
{
EditObject(playerid, 0);
pInfo[playerid][pCurrentEdit] = 0;
}
case 1:
{
pInfo[playerid][pSlotUsed] = 0;
SendClientMessage(playerid, COLOR_WHITE, "You have just removed object Slot 1 from your accessories.");
}
case 2:
{
new index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ;
pInfo[playerid][pSlot] = index;
pInfo[playerid][pModelID] = modelid;
pInfo[playerid][pBone] = boneid;
pInfo[playerid][pOffsetX] = fOffsetX;
pInfo[playerid][pOffsetY] = fOffsetY;
pInfo[playerid][pOffsetZ] = fOffsetZ;
pInfo[playerid][pRotX] = fRotX;
pInfo[playerid][pRotY] = fRotY;
pInfo[playerid][pRotZ] = fRotZ;
pInfo[playerid][pScaleX] = fScaleX;
pInfo[playerid][pScaleY] = fScaleY;
pInfo[playerid][pScaleZ] = fScaleZ;
SetPlayerAttachedObject(playerid,index,modelid,boneid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ);
}
case 3:
{
RemovePlayerAttachedObject(playerid, 0);
}
}
}
}
case DIALOG_MENU_EDIT1:
{
if(response)
{
switch(listitem)
{
case 0:
{
EditObject(playerid, 1);
pInfo[playerid][pCurrentEdit] = 1;
}
case 1:
{
pInfo[playerid][p1SlotUsed] = 0;
SendClientMessage(playerid, COLOR_WHITE, "You have just removed object Slot 2 from your accessories.");
}
case 2:
{
new index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ;
pInfo[playerid][p1Slot] = index;
pInfo[playerid][p1ModelID] = modelid;
pInfo[playerid][p1Bone] = boneid;
pInfo[playerid][p1OffsetX] = fOffsetX;
pInfo[playerid][p1OffsetY] = fOffsetY;
pInfo[playerid][p1OffsetZ] = fOffsetZ;
pInfo[playerid][p1RotX] = fRotX;
pInfo[playerid][p1RotY] = fRotY;
pInfo[playerid][p1RotZ] = fRotZ;
pInfo[playerid][p1ScaleX] = fScaleX;
pInfo[playerid][p1ScaleY] = fScaleY;
pInfo[playerid][p1ScaleZ] = fScaleZ;
SetPlayerAttachedObject(playerid,index,modelid,boneid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ);
}
case 3:
{
RemovePlayerAttachedObject(playerid, 1);
}
}
}
}
case DIALOG_MENU_EDIT2:
{
if(response)
{
switch(listitem)
{
case 0:
{
EditObject(playerid, 2);
pInfo[playerid][pCurrentEdit] = 3;
}
case 1:
{
pInfo[playerid][p2SlotUsed] = 0;
SendClientMessage(playerid, COLOR_WHITE, "You have just removed object Slot 3 from your accessories.");
}
case 2:
{
new index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ;
pInfo[playerid][p2Slot] = index;
pInfo[playerid][p2ModelID] = modelid;
pInfo[playerid][p2Bone] = boneid;
pInfo[playerid][p2OffsetX] = fOffsetX;
pInfo[playerid][p2OffsetY] = fOffsetY;
pInfo[playerid][p2OffsetZ] = fOffsetZ;
pInfo[playerid][p2RotX] = fRotX;
pInfo[playerid][p2RotY] = fRotY;
pInfo[playerid][p2RotZ] = fRotZ;
pInfo[playerid][p2ScaleX] = fScaleX;
pInfo[playerid][p2ScaleY] = fScaleY;
pInfo[playerid][p2ScaleZ] = fScaleZ;
SetPlayerAttachedObject(playerid,index,modelid,boneid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ);
}
case 3:
{
RemovePlayerAttachedObject(playerid, 2);
}
}
}
}
}
return 1;
}