Problem dialog - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem dialog (
/showthread.php?tid=600564)
Problem dialog -
widstrike123 - 09.02.2016
Hi all, i have a problem with dialog from portbagage system.
My command and dialog:
Код:
CMD:v(playerid, params)
{
if(P_DATA[playerid][pCarKey][1] == 0 || P_DATA[playerid][pCarKey][2] == 0 || P_DATA[playerid][pCarKey][3] == 0)
return SCM(playerid, Red, "You don't have personal vehicle!");
new string[60];
for(new key = 1; key <= 3; key++)
{
foreach(new i : Vehicles)
{
if(P_DATA[playerid][pCarKey][key] == 0)
continue;
if ( P_DATA[playerid][pCarKey][key] == AutoData[i][cID] )
{
format(string, sizeof(string), "%s%s:(%d)\n", string, vehName[AutoData[i][cModel] - 400], AutoData[i][cID]);
ShowPlayerDialog(playerid, DIALOG_VEHICLES, DIALOG_STYLE_LIST, "Cars", string, "OK", "Exit");
}
}
}
return 1;
}
Код:
case DIALOG_VEHICLES:
{
new idx = 0, string[10];
for(new i = 0; i <= 4; i++)
{
if(idx++ == listitem)
{
foreach(new v: Vehicles)
{
if(P_DATA[playerid][pCarKey][i] == AutoData[v][cID])
{
format(string, sizeof(string), "%s", vehName[AutoData[v][cModel] - 400]);
SCM(playerid, Verde, string);
}
else continue;
}
}
}
}
The problem is that if we did not slot 1 or 2 on the vehicle and on the other we can not select the vehicle , rustle . If it works in perfect order .
Re: Problem dialog -
widstrike123 - 10.02.2016
someone?
Re: Problem dialog -
widstrike123 - 10.02.2016
so, my problem is with show vehicle in dialog_STYLE_LIST. If i don't have vehicle on slot 1 or 2 and i have vehicle in the other not working. If i have vehicle on slot 1,2 or 3 in that order work perfect.
Re: Problem dialog -
GangstaSunny - 10.02.2016
Just format the string if there is no vehicle and call it "No Vehicle". With "inputtext" you can find out if the text of the listitem he selected is "No Vehicle". If yes, just reshow the dialog or close it.