06.05.2014, 02:16
(
Последний раз редактировалось TheChaoz; 11.05.2014 в 19:18.
Причина: Double posting
)
Quiero modificar el FS attachments, (el cual es para colocar objetos al PJ) lo que quiero es modificar el numero de objetos que se pueden aсadir al PJ el FS por defecto tiene la opcion de colocar 10 objetos pero yo nada mas quiero que sean 3 los que se puedan aсadir. En la imagen muestro lo que quiero editar
Ya lo solucione y por si a alguien mas le sirve, en las lineas del comando esta MAX_PLAYER_ATTACHED_OBJECTS que es el mбximo de objetos que se pueden agregar osea 10 y nada mas reemplace MAX_PLAYER_ATTACHED_OBJECTS por la cantidad de objetos que quiero agregar, en mi caso 3.
pd. perdon por la pobre explicaciуn
Код:
#define DIALOG_ATTACH_INDEX 13500 #define DIALOG_ATTACH_INDEX_SELECTION DIALOG_ATTACH_INDEX+1 #define DIALOG_ATTACH_EDITREPLACE DIALOG_ATTACH_INDEX+2 #define DIALOG_ATTACH_MODEL_SELECTION DIALOG_ATTACH_INDEX+3 #define DIALOG_ATTACH_BONE_SELECTION DIALOG_ATTACH_INDEX+4 enum AttachmentEnum { attachmodel, attachname[24] } new AttachmentObjects[][AttachmentEnum] = { {362, "Minigun"}, {18632, "Caсa de pescar"}, {18633, "Llave Inglesa"}, {18634, "Palanca"}, {18635, "Martillo"}, {18636, "Gorra de Policia"}, {18637, "Escudo de Policia"}, {18638, "Casco de Seguridad"}, {18639, "Sombrero"}, {18640, "Afro1"}, {18975, "Afro2"}, {19136, "Sombrero+Cabello"}, {19274, "Cabello de Payaso"}, {18641, "Linterna"}, {18642, "Taser"}, {18643, "Laser1"}, {19080, "Laser2"}, {341, "Sierra Electrica"}, {339, "Katana"}, {321, "Dildo"}, {18891, "Paсuelo 1"}, {18926, "Sombrero1"}, {18927, "Sombrero2"}, {18928, "Sombrero3"}, {18929, "Sombrero4"}, {18930, "Sombrero5"}, {18952, "Casco de box"}, {18953, "Gorro1"}, {18954, "Gorro2"}, {18955, "Gorra1"}, {18956, "Gorra2"}, {18960, "Gorra3"}, {19115, "Gorra4"}, {18962, "Sombrero vaquero2"}, }; new AttachmentBones[][24] = { {"Spine"}, {"Cabeza"}, {"Hombro Izquierdo"}, {"hombro Derecho"}, {"Mano Izquierda"}, {"Mano Derecha"}, {"Pie Izquierdo"}, {"Pie Derecho"}, {"Ante Brazo Izquierdo"}, {"Ante Brazo Derecho"}, {"Clavicula Izquierda"}, {"Clavicula Derecha"}, }; ////public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) switch(dialogid) { case DIALOG_ATTACH_INDEX_SELECTION: { if(response) { if(IsPlayerAttachedObjectSlotUsed(playerid, listitem)) { ShowPlayerDialog(playerid, DIALOG_ATTACH_EDITREPLACE, DIALOG_STYLE_MSGBOX, \ "{24FE03}Objetos", "Selecciona Editar o Borrar?", "Editar", "Borrar"); } else { new string[4000+1]; for(new x;x<sizeof(AttachmentObjects);x++) { format(string, sizeof(string), "%s%s\n", string, AttachmentObjects[x][attachname]); } ShowPlayerDialog(playerid, DIALOG_ATTACH_MODEL_SELECTION, DIALOG_STYLE_LIST, \ "{24FE03}Lista de Objetos - Selecciona el Modelo", string, "Seleccionar", "Cancelar"); } SetPVarInt(playerid, "AttachmentIndexSel", listitem); } return 1; } case DIALOG_ATTACH_EDITREPLACE: { if(response) EditAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel")); else RemovePlayerAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel")); DeletePVar(playerid, "AttachmentIndexSel"); return 1; } case DIALOG_ATTACH_MODEL_SELECTION: { if(response) { if(GetPVarInt(playerid, "AttachmentUsed") == 1) EditAttachedObject(playerid, listitem); else { SetPVarInt(playerid, "AttachmentModelSel", AttachmentObjects[listitem][attachmodel]); new string[256+1]; for(new x;x<sizeof(AttachmentBones);x++) { format(string, sizeof(string), "%s%s\n", string, AttachmentBones[x]); } ShowPlayerDialog(playerid, DIALOG_ATTACH_BONE_SELECTION, DIALOG_STYLE_LIST, \ "{24FE03}Attachment Modification - Bone Selection", string, "Select", "Cancel"); } } else DeletePVar(playerid, "AttachmentIndexSel"); return 1; } case DIALOG_ATTACH_BONE_SELECTION: { if(response) { SetPlayerAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"), GetPVarInt(playerid, "AttachmentModelSel"), listitem+1); EditAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel")); SendClientMessage(playerid, beige, "Sugerencia: Sugerencia: Usa La Esc para terminar de editar."); } DeletePVar(playerid, "AttachmentIndexSel"); DeletePVar(playerid, "AttachmentModelSel"); return 1; } } ////////// public para objetos /////////// 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 ) { new debug_string[256+1]; format(debug_string,256,"SetPlayerAttachedObject(playerid,%d,%d,%d,%f,%f,%f,%f,%f,%f,%f,%f,%f)", index,modelid,boneid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ); print(debug_string); //SendClientMessage(playerid, 0xFFFFFFFF, debug_string); SetPlayerAttachedObject(playerid,index,modelid,boneid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ); SendClientMessage(playerid, 0xFFFFFFFF, "Objeto Editado"); return 1; } //////// cmd objetos ////// cmd(objetos,playerid,params[]) { new string[128]; for(new x;x<MAX_PLAYER_ATTACHED_OBJECTS;x++) { if(IsPlayerAttachedObjectSlotUsed(playerid, x)) format(string, sizeof(string), "%s%d (Used)\n", string, x); else format(string, sizeof(string), "%s%d\n", string, x); } ShowPlayerDialog(playerid, DIALOG_ATTACH_INDEX_SELECTION, DIALOG_STYLE_LIST, \ "{24FE03}Lista de Objetos", string, "Seleccionar", "Cancelar"); return 1; }
pd. perdon por la pobre explicaciуn