AddVehicleComponent won't add the component. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: AddVehicleComponent won't add the component. (
/showthread.php?tid=277035)
AddVehicleComponent won't add the component. -
Jack_Leslie - 16.08.2011
So I'm working on a dealership, and I've got a command to change the color, that works completely fine, but the car modifications don't work. Here's the weird thing, they save
perfect fine! So there's no reason why vehicle modifications shouldn't work, they save, but they won't load.
I'd rather not publicly release the whole code but here's a bit of it that someone should understand:
pawn Код:
CarInfo[idx][ownedvehicle] = CreateVehicle(CarInfo[idx][vModel],CarInfo[idx][vLocationx],CarInfo[idx][vLocationy],CarInfo[idx][vLocationz],CarInfo[idx][vAngle],CarInfo[idx][vColorOne],CarInfo[idx][vColorTwo],300000);
printf("CarInfo: %d Owner:%s LicensePlate %s",idx,CarInfo[idx][vOwner],CarInfo[idx][vLicense]);
AddVehicleComponent(CarInfo[idx][ownedvehicle],CarInfo[idx][cMod1]);
So I've loaded cars from a file and created the CarInfo[idx][ownedvehicle]. Nothing wrong with this, because the changing the color of the car works fine. Then saving modifications works fine, but it won't add the component. Which is the code above.