Hi, i have problem with rotation object in DIALOG_STYLE_PREVMODEL
http://prntscr.com/ew067n Код:
stock SearchName(id, item, slot) { new sNazev[50]; if(item == 157){ sNazev = "Kolo - Offroad"; } if(item == 158){ sNazev = "Kolo - Shadow"; } if(item == 159){ sNazev = "Kolo - Mega"; } if(item == 160){ sNazev = "Kolo - Rimshine"; } if(item == 161){ sNazev = "Kolo - Wires"; } if(item == 162){ sNazev = "Kolo - Classic"; } if(item == 163){ sNazev = "Kolo - Twist"; } if(item == 164){ sNazev = "Kolo - Cutter"; } if(item == 165){ sNazev = "Kolo - Switch"; } if(item == 166){ sNazev = "Kolo - Grove"; } if(item == 167){ sNazev = "Kolo - Import"; } if(item == 168){ sNazev = "Kolo - Dollar"; } if(item == 169){ sNazev = "Kolo - Trance"; } if(item == 170){ sNazev = "Kolo - Atomic"; } if(item == 171){ sNazev = "Kolo - Ahab"; } if(item == 172){ sNazev = "Kolo - Virtual"; } if(item == 173){ sNazev = "Kolo - Access"; } if(slot == 1){ strmid(Vozidlo[id][tuning_1_nazev], sNazev, 0, 50, 50); } return 1; } new const gAttachments[][e_ATTACHMENTS] = { {1025, "Kolo~n~Offroad"}, {1073, "Kolo~n~Shadow"}, {1074, "Kolo~n~Mega"}, {1075, "Kolo~n~Rimshine"}, {1076, "Kolo~n~Wires"}, {1077, "Kolo~n~Classic"}, {1078, "Kolo~n~Twist"}, {1079, "Kolo~n~Cutter"}, {1080, "Kolo~n~Switch"}, {1081, "Kolo~n~Grove"}, {1082, "Kolo~n~Import"}, {1083, "Kolo~n~Dollar"}, {1084, "Kolo~n~Trance"}, {1085, "Kolo~n~Atomic"}, {1096, "Kolo~n~Ahab"}, {1097, "Kolo~n~Virtual"}, {1098, "Kolo~n~Access"} }; switch(listitem) { case 0: { TuningEditSlot[playerid] = 1; new k = GetPVarInt(playerid, "VehicleITuning"); if(Vozidlo[k][tuning_1_objectid] == 0) { const size = sizeof(gAttachments) ; new models[size], labels[size][25] ; for (new x; x < size; x++) { models[x] = gAttachments[x][attachModel]; strcat(labels[x], gAttachments[x][attachName]); } ShowPlayerPreviewModelDialog(playerid, DIALOG_TUNING_SEARCH, DIALOG_STYLE_PREVMODEL, "Vyber modelu:", models, labels, "Zvolit", "Zavrit"); Dialog_SetModelRot(playerid, 157, .z = 35.0, .zoom = 1.3); // Wheel Offroad Dialog_SetModelRot(playerid, 158, .z = 35.0, .zoom = 1.3); Dialog_SetModelRot(playerid, 159, .z = 35.0, .zoom = 1.3); Dialog_SetModelRot(playerid, 160, .z = 35.0, .zoom = 1.3); Dialog_SetModelRot(playerid, 161, .z = 35.0, .zoom = 1.3); Dialog_SetModelRot(playerid, 162, .z = 35.0, .zoom = 1.3); Dialog_SetModelRot(playerid, 163, .z = 35.0, .zoom = 1.3); Dialog_SetModelRot(playerid, 164, .z = 35.0, .zoom = 1.3); Dialog_SetModelRot(playerid, 165, .z = 35.0, .zoom = 1.3); Dialog_SetModelRot(playerid, 166, .z = 35.0, .zoom = 1.3); Dialog_SetModelRot(playerid, 167, .z = 35.0, .zoom = 1.3); Dialog_SetModelRot(playerid, 168, .z = 35.0, .zoom = 1.3); Dialog_SetModelRot(playerid, 169, .z = 35.0, .zoom = 1.3); Dialog_SetModelRot(playerid, 170, .z = 35.0, .zoom = 1.3); Dialog_SetModelRot(playerid, 171, .z = 35.0, .zoom = 1.3); Dialog_SetModelRot(playerid, 172, .z = 35.0, .zoom = 1.3); Dialog_SetModelRot(playerid, 173, .z = 35.0, .zoom = 1.3); } else { ShowPlayerDialog(playerid, DIALOG_TUNING_EDIT, DIALOG_STYLE_LIST, "Tuning", "Upravit doplněk\nSmazat doplněk\nZměnit barvu doplňku", "Vybrat", "Zavřнt"); } } } |
@Gammix, This is only a sample, otherwise I have in the const 240 accessories. I have over 200 arrays.
|
#include <dialogs>
#include <YSI\y_inline>
#include <YSI\y_dialog>
CMD:test ( playerid, params [] ) {
inline TestResponse(pid, dialogid, response, listitem, string:inputtext[]) {
#pragma unused pid, dialogid, response, listitem, inputtext
SendClientMessage(playerid, 0xFF0000AA, "You clicked a button! Good for you!");
}
Dialog_ShowCallback(playerid, using inline TestResponse, DIALOG_STYLE_PREVMODEL_LIST, "Weapon selection dialog", "372\tTec-9\n352\tUZI\n346\t9mm\n347\tSilenced 9mm\n348\tDesert eagle", "Select", "Cancel");
return true ;
}
Hey, when i try to compile my Gamemode while using your include , pawno gets freezed ,and i can't use it, what can i do? Ty
EDIT: By just having "#Include <dialogs>" it crashes pawno in my gm, but when im using a different gamemode, it works, and it compiles, why? what can i do? |
CMD:editdealership(playerid, params[]) { Dialog_Show(playerid, EditDealershipCars, DIALOG_STYLE_PREVMODEL, "{7777FF}Edit Dealership Vehicles", "18631\tAdd more...", "Edit", "Cancel"); return 1; } Dialog:EditDealershipCars(playerid, response, listitem, inputtext[]) { if (response) { SendInfoMessage(playerid, "Pressed: %i", listitem); SendInfoMessage(playerid, "Pressed: %s", inputtext); } return 1; }
inline ToyStoreList(pid, dialogid, response, listitem, string:inputtext[]) { // handlers here } new sQuery [ 2048 ] ; for ( new i; i < sizeof ( Attachments ); i ++ ) { format ( sQuery, sizeof ( sQuery ), "%s%i\t%s\n", sQuery, Attachments [ i ] [ attach_model ], Attachments [ i ] [ attach_name ]) ; } Dialog_ShowCallback(playerid, using inline ToyStoreList, DIALOG_STYLE_PREVIEW_MODEL, "Attachments Store", sQuery, "Select", "Cancel");
Any reason why this happens? I am using the exact same code prefix as shown in your example. My other dialog using a similar prefix is bugged too.
The shown object model isn't the one I'm using - it's fucked up for some reason. http://i.imgur.com/wmG8yJi.png This is what it should look like: http://i.imgur.com/0HFhxZT.png Code:
inline ToyStoreList(pid, dialogid, response, listitem, string:inputtext[]) { // handlers here } new sQuery [ 2048 ] ; for ( new i; i < sizeof ( Attachments ); i ++ ) { format ( sQuery, sizeof ( sQuery ), "%s%i\t%s\n", sQuery, Attachments [ i ] [ attach_model ], Attachments [ i ] [ attach_name ]) ; } Dialog_ShowCallback(playerid, using inline ToyStoreList, DIALOG_STYLE_PREVIEW_MODEL, "Attachments Store", sQuery, "Select", "Cancel"); |
Try to print the results and see if they're OK, you could be loading wrong.
|
It works fine without the string specifier. It only fucks up when I use it.
The %i or %d specifier (after the modelid) is fine too, but that's not what I need. |
I've a problem here.
When I use DIALOG_STYLE_PREVMODEL_LIST, textdraw's model id doesn't show correctly. For instance, if i use Cigarettes's id (19897), the dialog truncates the last letter and shows an object with id: 1989 Same Objects in both dialog: ![]() ![]() DIALOG_STYLE_PREVMODEL_LIST Code:
COMMAND:testanim(playerid, params[]) { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PREVMODEL_LIST, "Selection", "2039\tItem1\n19565\tItem2\n19897\tItem3\n19998\tItem4", "OK", " "); return 1; } DIALOG_STYLE_PREVMODEL Code:
COMMAND:testanim2(playerid, params[]) { new models[] = {2039, 19565, 19897, 19998}; new labels[][] = {"Item1", "Item2", "Item3", "Item4"}; ShowPlayerPreviewModelDialog(playerid, 0, DIALOG_STYLE_PREVMODEL, "Selection", models, labels, "Select", "Cancel"); return 1; } EDIT: FIX: IN: stock Dialog_ShowToPlayer(playerid, dialogid, style, caption[], info[], button1[], button2[]) Search: for static str_model[5]; Replace with: static str_model[6]; |
Dialog_ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[], BG_COLOR = 0, DIALOG_LIST_ITEM_COLOR = 5864548, DIALOG_SELECTED_LIST_ITEM_COLOR = -1608903836)
Code:
Dialog_ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[], BG_COLOR = 0, DIALOG_LIST_ITEM_COLOR = 5864548, DIALOG_SELECTED_LIST_ITEM_COLOR = -1608903836) Another thing that would be useful, a callback that points to the player that item selected in real time. It would be used to point out additional item information (would be optional, for inventory systems). |
I have a mode where I use nex-ac include and your include but when I use a command to display skins, the dialog will not appear
Only the cursor is displayed |
new string[sizeof SkinItems* 50]; for (new i; i < sizeof SkinItems; i++) { format(string, sizeof string, "%s\t%s\n", string, SkinItems[i][attachName]); } ShowPlayerDialog(playerid, DIALOG_SKINS, DIALOG_STYLE_PREVMODEL, "Select Skins", string, "Select", "Close");
enum MaleSkins { attachModel, attachName[25] }; new const SkinItems[][MaleSkins] = { {9, "Skin"}, {10, "Skin"}, {12, "Skin"}, // atp ...... } ;