Posts: 170
Threads: 7
Joined: Sep 2014
Reputation:
0
Well, recently I noticed that when a vehicle is resprayed the 2 colors are indeed saved but when respawned the vehicle's color came back to the ones used with CreateVehicle. I came up with 2 solutions using ChangeVehicleColor after SetVehicleToRespawn and assigning it the color from the variable which contains it or when someone actually tries to respray his vehicle I would have to completely recreate it. I think the first one is much better but, my question is, is that SA-MP bug? Is it something I did wrong? Like in order to respawn with the new color I should return a specific value in a callback or?
Posts: 4,759
Threads: 33
Joined: Dec 2013
Reputation:
0
That's normal, and how it should work. If you want resprays to be permanent, then create a variable, when you respray a vehicle save the color in the variable, and in the callback OnVehicleSpawn, change the color of the vehicle to the color in the variable.
Posts: 170
Threads: 7
Joined: Sep 2014
Reputation:
0
Right, never thought of OnVehicleSpawn would be a global workaround. I already have a variable saving all vehicle information. On the first thought, I was thinking about making all commands execute ChangeVehicleColor(someid, myvar[someid][c1], myvar[someid][c2]) after SetVehicleToRespawn but your idea is even better. Thanks mate <3