PDA

View Full Version : Dialog doesn't show up


justjamie
27/10/2016, 04:23 PM
Hello.
my dialog doesn't show up.
This is my code:


//The command:
/*================================================= ============================ */
new query[200];
format(query,sizeof(query),"SELECT * FROM vehicles WHERE vOwner='%s'",Name(playerid));
mysql_tquery(connection,query,"VehicleTow","i",playerid);
return 1;

//The function:
/* ================================================== =========================== */
forward VehicleTow(playerid);
public VehicleTow(playerid)
{
new TowString[3000];
if(!cache_num_rows()) return SendClientError(playerid,"You do not have any vehicles.");
for(new i=0; i<cache_get_row_count(); i++)
{
new carid = cache_get_field_content_int(i,"id");
strcat(TowString,sprintf("%s(%i)\n",GetVehicleName(Vehicle[carid][vModel]),Vehicle[carid][vModel]));
}
ShowPlayerDialog(playerid,91141,DIALOG_STYLE_LIST, sprintf("%s's vehicles.",Name(playerid)),TowString,"Tow","Cancel");
return 1;
}
/* ================================================== =========================== */

StR_MaRy
27/10/2016, 04:26 PM
try this
forward VehicleTow(playerid);
public VehicleTow(playerid)
{
new TowString[200];
if(!cache_num_rows()) return SendClientError(playerid,"You do not have any vehicles.");
for(new i=0; i<cache_get_row_count(); i++)
{
new carid = cache_get_field_content_int(i,"id");
strcat(TowString,sprintf("%s(%i)\n",GetVehicleName(Vehicle[carid][vModel]),Vehicle[carid][vModel]));
}
ShowPlayerDialog(playerid,91141,DIALOG_STYLE_LIST, sprintf("%s's vehicles.",Name(playerid)),TowString,"Tow","Cancel");
return 1;
}

justjamie
27/10/2016, 04:29 PM
try this
forward VehicleTow(playerid);
public VehicleTow(playerid)
{
new TowString[200];
if(!cache_num_rows()) return SendClientError(playerid,"You do not have any vehicles.");
for(new i=0; i<cache_get_row_count(); i++)
{
new carid = cache_get_field_content_int(i,"id");
strcat(TowString,sprintf("%s(%i)\n",GetVehicleName(Vehicle[carid][vModel]),Vehicle[carid][vModel]));
}
ShowPlayerDialog(playerid,91141,DIALOG_STYLE_LIST, sprintf("%s's vehicles.",Name(playerid)),TowString,"Tow","Cancel");
return 1;
}

Doesn't change anything mate ;/

Update i fixed it.
"Vehicle[carid][vModel]" best.
I searched for the vModel instead of the carid itself.
oops..

But now i got this new issue.

switch(dialogid)
{
case 91141:
{
SendMessage(playerid,-1,sprintf("%i",listitem));
if(IsVehicleOccupied(listitem)) return SendClientError(playerid,"That vehicle is occupied.");
ReloadVehicle(listitem);
SendClientNotice(playerid,"That car has succesfully been towed.");
}
}

When i click on something, it doesn't put anything here.

StR_MaRy
27/10/2016, 04:56 PM
why you wont try it ? it changes that

new TowString[3000]; to 200 , 3000 is not even possible max 2024 as i remember but put it less like 200 it will be ok

justjamie
27/10/2016, 04:58 PM
why you wont try it ? it changes that

new TowString[3000]; to 200 , 3000 is not even possible max 2024 as i remember but put it less like 200 it will be ok

i did try it, but that solution didnt work.