Changing vehicle color.
#4

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:
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
Reply


Messages In This Thread
Changing vehicle color. - by Dreftas - 25.02.2012, 20:09
Re: Changing vehicle color. - by Slash_ - 25.02.2012, 20:17
Re: Changing vehicle color. - by Dreftas - 25.02.2012, 20:54
Re: Changing vehicle color. - by leong124 - 26.02.2012, 05:35
Re: Changing vehicle color. - by Dreftas - 26.02.2012, 08:45
Re: Changing vehicle color. - by KingHual - 26.02.2012, 09:38

Forum Jump:


Users browsing this thread: 2 Guest(s)