03.06.2017, 13:04
Is there a function to get the vehicle id from its plate number? Is there a function that can be made to do this?
format(string,sizeof(string),"SJ-%d%d", plate, vehicleid);
new Plates[MAX_VEHICLES][30];
SetVehicleNumberPlateEx(vehicleid, plate[])
{
SetVehicleNumberPlateEx(vehicleid, plate);
format(Plates[vehicleid],30,plate);
return 1;
}
Usage: SetVehicleNumberPlateEx(vehicleid, "ABCD 123");
GetIDFromPlate(plate[])
{
for(new i = 0; i < MAX_VEHICLES; i++)
{
if(!strcmp(Plates[i],plate)) return i;
}
return -1;
}
Usage: GetIDFromPlate("ABCD 123");
I guess you should making something like this.
PHP код:
|
SetVehicleNumberPlateEx(vehicleid, plate[])
{
SetVehicleNumberPlateEx(vehicleid, plate);//shouldn't this be SetVehicleNumberPlate?
format(Plates[vehicleid],30,plate);
return 1;
}