09.02.2016, 19:25
Hi all, i have a problem with dialog from portbagage system.
My command and dialog:
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 .
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; } } } }