26.02.2012, 05:35
Hook the AddStaticVehicle function, and script the -1 colour yourself. This actually set the vehicle into a fixed but randomly chosen colour, but not -1.
Example:
Example:
pawn Код:
//Put this at the top of your script in order to hook the original function.
AddStaticVehicle_hooked(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2)
{
if(color1 == -1) color1 = random(128);//All normal vehicle colours in single player
if(color2 == -1) color2 = random(128);
AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2);
}
#define AddStaticVehicle AddStaticVehicle_hooked