Dialog_SetListitemPreviewRot(playerid, 0, 45.0, 5.0, 2.0, 10.0, cola1, colb1); Dialog_SetListitemPreviewRot(playerid, 1, 45.0, 5.0, 2.0, 1.0, cola2, colb2); Dialog_SetListitemPreviewRot(playerid, 2, 45.0, 5.0, 2.0, 1.0, cola3, colb3); ShowPlayerDialog(playerid, 6969, DIALOG_STYLE_PREVMODEL, "Vehicle's list", string, "Spawn", "Close");
at mos i have 3 items because i can own at most 3 items so i use it like this:
Code:
Dialog_SetListitemPreviewRot(playerid, 0, 45.0, 5.0, 2.0, 10.0, cola1, colb1); Dialog_SetListitemPreviewRot(playerid, 1, 45.0, 5.0, 2.0, 1.0, cola2, colb2); Dialog_SetListitemPreviewRot(playerid, 2, 45.0, 5.0, 2.0, 1.0, cola3, colb3); ShowPlayerDialog(playerid, 6969, DIALOG_STYLE_PREVMODEL, "Vehicle's list", string, "Spawn", "Close"); |
Maybe you don't have a main in your script.
PHP Code:
|
Thank you! Now it works perfectly.
In the future, can we change the number of rows and columns? Also change the position of the text, enable / disable rotation ... or even be able to zoom in or out instead of rotating. I think they are good suggestions. :P PS: I think the rotation buttons would look better and more discreet, close to the zoom value, and a bit smaller. If you lower it a little, and downsize them, it would look really good. #edit I made some changes (I added zoom in / out) and moved the rotation buttons lower. Prints: https://imgur.com/a/RODHf Source edited: https://pastebin.com/LVLuJ5if |
Thank you! Now it works perfectly.
In the future, can we change the number of rows and columns? Also change the position of the text, enable / disable rotation ... or even be able to zoom in or out instead of rotating. I think they are good suggestions. :P PS: I think the rotation buttons would look better and more discreet, close to the zoom value, and a bit smaller. If you lower it a little, and downsize them, it would look really good. #edit I made some changes (I added zoom in / out) and moved the rotation buttons lower. Prints: https://imgur.com/a/RODHf Source edited: https://pastebin.com/LVLuJ5if |
Another place for text would have been also good, Where I can show the price for things.
|
new string[132], DBResult:qresult, rows;
format(string, sizeof(string), "SELECT `NOMBRE`,`ID`,`VID`,`PRECIO` FROM `VDEPORT` WHERE `TIPO` = '1' ORDER BY (`ID` * 1) ASC limit 30");
qresult = db_query(ZLDB, string);
rows = db_num_rows(qresult);
static Query[120], DBResult:Result;
if(rows)
{
new final_string[32 * sizeof(string)];
new Nombre[50], MiID, Estado[50];
new Precio, LaID, VID;
for(new i = 0; i < rows; i ++)
{
SetDialogPreviewRotation (playerid, i, -16.0, 0.0, -55.0, 1.20);
db_get_field_assoc(qresult, "NOMBRE", Nombre, sizeof(Nombre));
LaID = db_get_field_assoc_int(qresult, "ID");
VID = db_get_field_assoc_int(qresult, "VID");
Precio = db_get_field_assoc_int(qresult, "PRECIO");
JugadorDato[playerid][zConteoPrecio][i] = Precio;
format(Query, sizeof(Query), "SELECT `ID` FROM `VCOM` WHERE `NUMITEM` = '%d' AND `TIPO` = '1' AND `ID` = '%d' COLLATE NOCASE", LaID, JugadorInfo[playerid][zMiID]);
Result = db_query(ZLDB, Query);
if(db_num_rows(Result)) MiID = db_get_field_assoc_int(qresult, "ID");
JugadorDato[playerid][zConteoID][i] = MiID;
JugadorDato[playerid][zVID][i] = VID;
format(Estado,sizeof(Estado),LaID != MiID ? ( "~y~%d G" ) : ( "~b~Usar" ),Precio);
db_free_result(Result);
format(string, sizeof(string), "%i\t%s~n~~n~~n~~n~%s\n", VID, Nombre, Estado);
strcat(final_string, string);
db_next_row(qresult);
}
ShowPlayerDialog(playerid,DIALOG_MAUTOS+1, DIALOG_STYLE_PREVIEW_MODEL, "Deportivos", final_string, "Seleccionar", "Atrбs");
PlayerPlaySound(playerid, 1139, 0.0, 0.0, 0.0);
}
db_free_result(qresult);
They do not come out well, with the previous update it was perfect. |
labels go wrong, do not appear or come out with repeated letters
|
Ok you can try using ShowPreviewModelDialog instead (there's an example in main post about how to use it).
Let me know if the bug still appears with it or not. |
new string[132], DBResult:qresult, rows;
format(string, sizeof(string), "SELECT `NOMBRE`,`ID`,`VID`,`PRECIO` FROM `VDEPORT` WHERE `TIPO` = '1' ORDER BY (`ID` * 1) ASC limit 30");
qresult = db_query(ZLDB, string);
rows = db_num_rows(qresult);
static Query[120], DBResult:Result;
if(rows)
{
new final_string[32 * sizeof(string)];
new Nombre[50], MiID, Estado[50];
new Precio, LaID, VID;
for(new i = 0; i < rows; i ++)
{
SetDialogPreviewRotation (playerid, i, -16.0, 0.0, -55.0, 1.20);
db_get_field_assoc(qresult, "NOMBRE", Nombre, sizeof(Nombre));
LaID = db_get_field_assoc_int(qresult, "ID");
VID = db_get_field_assoc_int(qresult, "VID");
Precio = db_get_field_assoc_int(qresult, "PRECIO");
JugadorDato[playerid][zConteoPrecio][i] = Precio;
format(Query, sizeof(Query), "SELECT `ID` FROM `VCOM` WHERE `NUMITEM` = '%d' AND `TIPO` = '1' AND `ID` = '%d' COLLATE NOCASE", LaID, JugadorInfo[playerid][zMiID]);
Result = db_query(ZLDB, Query);
if(db_num_rows(Result)) MiID = db_get_field_assoc_int(qresult, "ID");
JugadorDato[playerid][zConteoID][i] = MiID;
JugadorDato[playerid][zVID][i] = VID;
format(Estado,sizeof(Estado),LaID != MiID ? ( "~y~%d G" ) : ( "~b~Usar" ),Precio);
db_free_result(Result);
format(string, sizeof(string), "%s~n~~n~~n~~n~%s\n", Nombre, Estado);
strcat(final_string, string);
db_next_row(qresult);
}
ShowPreviewModelDialog(playerid, DIALOG_MAUTOS+1, "Deportivos", VID, final_string, "Seleccionar", "Atrбs", 20);