23.11.2014, 10:48
I want for example car id 1 to have LS 0001 , and car id 10 LS 0010 , ok ? how can i do something like these?.. every car to have plate.. ?
CMD:plate(playerid, params[])
{
new vehicleid;
vehicle = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, 0x00FF00AA, "You're in a vehicle.");
if(sscanf(params,"i", Plate)) return SendClientMessage(playerid, -1, "{15FF00}Usage: {FF0000}/Plate [Number Plate]");
SetVehicleNumberPlate(vehicleid, Plate);
return 1;
}
CMD:plates(playerid, params[])
{
for(new i; i != MAX_VEHICLES; i++)
{
new string[89];
new plates = 1 + random(500);
format(string, sizeof(string), "LS 00%d", plates);
SetVehicleNumberPlate(i, string);
}
return 1;
}
public OnVehicleSpawn(vehicleid)
{
new plate[32];
format(plate, sizeof(plate), "LS-%04d", vehicleid);
SetVehicleNumberPlate(vehicleid, plate); // before calling this, make sure vehicle has a plate as the Wiki states
SetVehicleToRespawn(vehicleid);
return 1;
}