Код:
public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
{
if(response)
{
SendClientMessage(playerid, COLOR_GREEN, "Toys successfully edited.");
PlayerToyInfo[playerid][index][ptPosX] = fOffsetX;
PlayerToyInfo[playerid][index][ptPosY] = fOffsetY;
PlayerToyInfo[playerid][index][ptPosZ] = fOffsetZ;
PlayerToyInfo[playerid][index][ptRotX] = fRotX;
PlayerToyInfo[playerid][index][ptRotY] = fRotY;
PlayerToyInfo[playerid][index][ptRotZ] = fRotZ;
PlayerToyInfo[playerid][index][ptScaleX] = fScaleX;
PlayerToyInfo[playerid][index][ptScaleY] = fScaleY;
PlayerToyInfo[playerid][index][ptScaleZ] = fScaleZ;
ShowEditMenu(playerid);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You have canceled editing your toys.");
new i = index;
SetPlayerAttachedObject(playerid, index, modelid, boneid, PlayerToyInfo[playerid][i][ptPosX], PlayerToyInfo[playerid][i][ptPosY], PlayerToyInfo[playerid][i][ptPosZ], PlayerToyInfo[playerid][i][ptRotX], PlayerToyInfo[playerid][i][ptRotY], PlayerToyInfo[playerid][i][ptRotZ], PlayerToyInfo[playerid][i][ptScaleX], PlayerToyInfo[playerid][i][ptScaleY], PlayerToyInfo[playerid][i][ptScaleZ]);
ShowEditMenu(playerid);
}
return 1;
}
Код:
stock ShowEditMenu(playerid)
{
new iIndex = slotselection[playerid];
if(IsPlayerAttachedObjectSlotUsed(playerid, iIndex))
{
RemovePlayerAttachedObject(playerid, iIndex);
}
if(PlayerToyInfo[playerid][iIndex][ptScaleX] == 0) {
PlayerToyInfo[playerid][iIndex][ptScaleX] = 1.0;
PlayerToyInfo[playerid][iIndex][ptScaleY] = 1.0;
PlayerToyInfo[playerid][iIndex][ptScaleZ] = 1.0;
}
SetPlayerAttachedObject(playerid, iIndex, PlayerToyInfo[playerid][iIndex][ptModelID],
PlayerToyInfo[playerid][iIndex][ptBone], PlayerToyInfo[playerid][iIndex][ptPosX],
PlayerToyInfo[playerid][iIndex][ptPosY], PlayerToyInfo[playerid][iIndex][ptPosZ],
PlayerToyInfo[playerid][iIndex][ptRotX], PlayerToyInfo[playerid][iIndex][ptRotY],
PlayerToyInfo[playerid][iIndex][ptRotZ], PlayerToyInfo[playerid][iIndex][ptScaleX],
PlayerToyInfo[playerid][iIndex][ptScaleY], PlayerToyInfo[playerid][iIndex][ptScaleZ]);
new stringg[128];
format(stringg, sizeof(stringg), "Bone (%s)\nOffset", HoldingBones[PlayerToyInfo[playerid][iIndex][ptBone]]);
ShowPlayerDialog(playerid, EDITTOYS2, DIALOG_STYLE_LIST, "Toy Menu: Edit", stringg, "Select", "Cancel");
}
Код:
if((dialogid == EDITTOYS) && response)
{
if(PlayerToyInfo[playerid][listitem][ptModelID] == 0)
{
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Toy Menu: Edit", "Woops! You don't have anything on that slot", "OK", "");
}
else
{
SendClientMessageEx(playerid, COLOR_WHITE, "{AA3333}HINT:{FFFF00} Position your camera differently to better see where your editing.");
slotselection[playerid] = listitem;
ShowEditMenu(playerid);
}
}
if((dialogid == EDITTOYS2)) {
if(response) switch(listitem) {
case 0: ShowPlayerDialog(playerid, EDITTOYSBONE, DIALOG_STYLE_LIST, "Select a Bone", "Spine\nHead\nLeft upper arm\nRight upper arm\nLeft hand\nRight hand\nLeft thigh\nRight thigh\nLeft foot\nRight foot\nRight calf\nLeft calf\nLeft forearm\nRight forearm\nLeft clavicle\nRight clavicle\nNeck\nJaw", "Select", "Cancel");
case 1:
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: Hold {8000FF}~k~~PED_SPRINT~ {FFFFAA}to move your camera, press escape to cancel");
EditAttachedObject(playerid, GetPVarInt(playerid, "ToySlot"));
}
}
I don't know where is the problem with slot issues