30.03.2013, 13:26
I have this stock:
And this is the dialog:
The thing is that is always shows invalid vehicle plate... even though the vehicle is spawned and the variable:
VehicleInfo[vehicleid][carPlate] is good, I checked it by printing it.
pawn Код:
stock FindVehicleByPlate(plate[])
{
for(new i = 0; i < MAX_VEHICLES; i++)
{
if(!strcmp(VehicleInfo[i][carPlate], plate, true))
{
return i;
}
}
return 0;
}
pawn Код:
if(response)
{
new plate[64], vehicle;
if(sscanf(inputtext, "s[64]", plate)) return ShowDialog(playerid, Show:<MDCVehicle>, DIALOG_STYLE_INPUT, "LSPD Mobile Data Computer - Vehicle Search", ""EMBED_WHITE"Please enter the vehicle plate you wish to search for below", "Enter", "Escape");
vehicle = FindVehicleByPlate(plate);
if(vehicle == 0) return ShowDialog(playerid, Show:<MDCVehicle>, DIALOG_STYLE_INPUT, "LSPD Mobile Data Computer - Vehicle Search", ""EMBED_RED"Invalid vehicle plate\n\n"EMBED_WHITE"Please enter the vehicle plate you wish to search for below", "Enter", "Escape");
ActionMessage(playerid, 10.0, "logs on the MDC.");
format(msg, sizeof(msg), ""EMBED_LIGHTBLUE"%s info\n"EMBED_WHITE"Owner: %s\nRegistered: %d\nEND OF TRANSMISSION", VehicleNames[VehicleInfo[vehicle][carModel]-400], VehicleInfo[vehicle][carOwner], VehicleInfo[vehicle][carRegistered]);
ShowDialog(playerid, Show:<MDCResult>, DIALOG_STYLE_MSGBOX, "LSPD MDC - Result", msg, "Escape", "");
}
VehicleInfo[vehicleid][carPlate] is good, I checked it by printing it.