So i tryed to add like each player would have their own license plate with random numbers in end but it's not working
Maximum number of characters that license plate can contain is 13, and since MAX_PLAYER_NAME can be max. 24 characters plus random numbers, you should put lower number of characters on each license plate.
My code.
Also about that license plate lenght, you can use colors on plates, so its not always [13], like {ff0000}IKEY would show IKEY in red color on the plate, and its not 4 chars, its 12.
It's not like custom vehicle plate. I made it to set all server used vehicle plate.
PHP код:
new UKFirstLetter[21][] = {
"A", "B", "C", "D", "E", "F", "G", "H", "K", "L", "M", "N", "O",
"P", "R", "S", "U", "V", "W", "X", "Y"
};
new UKSecondLetter[23][] = {
"A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N",
"O", "P", "R", "S", "T", "U", "V", "W", "X", "Y"
};
new UKLastFirstLetter[23][] = {
"A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N",
"O", "P", "R", "S", "T", "U", "V", "W", "X", "Y"
};
new UKLastSecondLetter[23][] = {
"A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N",
"O", "P", "R", "S", "T", "U", "V", "W", "X", "Y"
};
new UKLastThirdLetter[23][] = {
"A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N",
"O", "P", "R", "S", "T", "U", "V", "W", "X", "Y"
};
public OnVehicleSpawn(vehicleid)
{
new string[9], year, month, day,number;
getdate(year, month, day);
if(year >= 2013 && month >= 2){number = 13;}
if(year >= 2013 && month >= 9){number = 63;}
if(year >= 2014 && month >= 2){number = 14;}
if(year >= 2014 && month >= 9){number = 64;}
if(year >= 2015 && month >= 2){number = 15;}
if(year >= 2015 && month >= 9){number = 65;}
if(year >= 2016 && month >= 2){number = 16;}
if(year >= 2016 && month >= 9){number = 66;}
if(year >= 2017 && month >= 2){number = 17;}
if(year >= 2017 && month >= 9){number = 67;}
format(string, sizeof(string), "%s%s%d %s%s%s",UKFirstLetter[random(sizeof(UKFirstLetter))],UKSecondLetter[random(sizeof(UKSecondLetter))],number,UKLastFirstLetter[random(sizeof(UKLastFirstLetter))],UKLastSecondLetter[random(sizeof(UKLastSecondLetter))],UKLastThirdLetter[random(sizeof(UKLastThirdLetter))]);
SetVehicleNumberPlate(vehicleid, string);
//new engine, lights, alarm, doors, bonnet, boot, objective;
//GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
//SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, 0);
//GearDamage[vehicleid] = 0;
//VehicleInfo[vehicleid][Engine] = 0;
return 1;
}