Posts: 515
Threads: 76
Joined: May 2008
Reputation:
0
If I go to some building (changing interior and virtual world from 0 to another one) and then leave(changing interior and virtual world back to 0) my vehicle color changes, but changes just those which are near my exit. I don't change it by any function.
Vehicles created with AddStaticVehicle.
Is this really bug or what ?
Posts: 99
Threads: 10
Joined: Feb 2012
Reputation:
0
it will happen when the vehicle colors are set to random 1,1.
Posts: 515
Threads: 76
Joined: May 2008
Reputation:
0
How to avoid this without removing colors parameters from -1 -1 ?
Posts: 2,286
Threads: 18
Joined: Jun 2010
Quote:
Originally Posted by leong124
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
|
He doesn't really need hooks. He can just use[code random(12
[/code] in the color params.