28.06.2012, 20:50
For some reason, the vehicle's plate doesn't set on spawning.
Can someone help me out? Here's the code.
Thanks!
Can someone help me out? Here's the code.
pawn Код:
new
vCarID = CreateVehicle(Vehicles[vID][vModel], Vehicles[vID][vPosX], Vehicles[vID][vPosY], Vehicles[vID][vPosZ], Vehicles[vID][vPosA], Vehicles[vID][vColor1], Vehicles[vID][vColor2], 500000);
ChangeVehicleColor(vCarID, Vehicles[vID][vColor1], Vehicles[vID][vColor2]);
new rand[7];
rand[0] = random(sizeof(letters));
rand[1] = random(sizeof(letters));
rand[2] = random(sizeof(nums));
rand[3] = random(sizeof(nums));
rand[4] = random(sizeof(letters));
rand[5] = random(sizeof(letters));
rand[6] = random(sizeof(letters));
format(Vehicles[OwnedCar(vID)][VehiclePlate], 10, "%s%s%d%d%s%s%s", letters[rand[0]], letters[rand[1]], nums[rand[2]], nums[rand[3]], letters[rand[4]], letters[rand[5]], letters[rand[6]]);
SetVehicleNumberPlate(vID, Vehicles[OwnedCar(vID)][VehiclePlate]);
SetVehicleToRespawn(vID);
++ TotalVehiclesCreated;
OwnedCar(vCarID) = vID;
SaveOwnedCar(OwnedCar(vID));