18.01.2014, 14:16
Here:
Код:
stock ShowEditMenu(playerid) { new iIndex = GetPVarInt(playerid, "ToySlot"); 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 in that slot.", "OK", ""); } else { SendClientMessageEx(playerid, COLOR_WHITE, "{AA3333}HINT:{FFFF00} Position your camera differently to better see where your editing."); SetPVarInt(playerid, "ToySlot", 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")); } } else { new stringg[512]; for(new x;x<MAX_PLAYERTOYS;x++) { new name[24]; format(name, sizeof(name), "None"); for(new i;i<sizeof(HoldingObjectsAll);i++) { if(HoldingObjectsAll[i][holdingmodelid] == PlayerToyInfo[playerid][x][ptModelID]) { format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]); break; } } if(PlayerToyInfo[playerid][x][ptModelID] != 0 && (strcmp(name, "None", true) == 0)) { format(name, sizeof(name), "Obj ID: %d", PlayerToyInfo[playerid][x][ptModelID]); } format(stringg, sizeof(stringg), "%s(%d) %s (Bone: %s)\n", stringg, x, name, HoldingBones[PlayerToyInfo[playerid][x][ptBone]]); } ShowPlayerDialog(playerid, EDITTOYS, DIALOG_STYLE_LIST, "Select a Toy", stringg, "Select", "Cancel"); } } if(dialogid == EDITTOYSBONE) { if(response) { PlayerToyInfo[playerid][GetPVarInt(playerid, "ToySlot")][ptBone] = listitem+1; g_mysql_SaveToys(playerid,GetPVarInt(playerid, "ToySlot")); } ShowEditMenu(playerid); }