Vehicle Plates
#1

Is there a function to get the vehicle id from its plate number? Is there a function that can be made to do this?
Reply
#2

Vehicle plates aren't externally referenceable (there are no _Get functions), it is up to you to store plates for lookup. It's entirely possible to do it this way.
Reply
#3

I used an alternative way. Adding the vehicle ID on the last part of the plate. My problem now is how to extract the ID considering that vehicle ID's can range from tens, to hundreds, to thousands, if necessary.

Код:
format(string,sizeof(string),"SJ-%d%d", plate, vehicleid);
Reply
#4

I guess you should making something like this.
PHP код:
new Plates[MAX_VEHICLES][30];

SetVehicleNumberPlateEx(vehicleidplate[])
{
    
SetVehicleNumberPlateEx(vehicleidplate);
    
format(Plates[vehicleid],30,plate);
    return 
1;
}
UsageSetVehicleNumberPlateEx(vehicleid"ABCD 123");

GetIDFromPlate(plate[])
{
    for(new 
0MAX_VEHICLESi++)
    {
        if(!
strcmp(Plates[i],plate)) return i;
    }
    return -
1;
}
UsageGetIDFromPlate("ABCD 123"); 
And save the Plates variable too.
Reply
#5

Quote:
Originally Posted by Sunehildeep
Посмотреть сообщение
I guess you should making something like this.
PHP код:
new Plates[MAX_VEHICLES][30];
SetVehicleNumberPlateEx(vehicleidplate[])
{
    
SetVehicleNumberPlateEx(vehicleidplate);
    
format(Plates[vehicleid],30,plate);
    return 
1;
}
UsageSetVehicleNumberPlateEx(vehicleid"ABCD 123");
GetIDFromPlate(plate[])
{
    for(new 
0MAX_VEHICLESi++)
    {
        if(!
strcmp(Plates[i],plate)) return i;
    }
    return -
1;
}
UsageGetIDFromPlate("ABCD 123"); 
And save the Plates variable too.
Awesome! Just wanna ask if
PHP код:
SetVehicleNumberPlateEx(vehicleidplate[])
{
    
SetVehicleNumberPlateEx(vehicleidplate);//shouldn't this be SetVehicleNumberPlate?
    
format(Plates[vehicleid],30,plate);
    return 
1;

Reply
#6

Quote:
Originally Posted by NealPeteros
Посмотреть сообщение
Awesome! Just wanna ask if
PHP код:
SetVehicleNumberPlateEx(vehicleidplate[])
{
    
SetVehicleNumberPlateEx(vehicleidplate);//shouldn't this be SetVehicleNumberPlate?
    
format(Plates[vehicleid],30,plate);
    return 
1;

Yea my bad
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)