Thank everybody for ideas.
And about -1 vehicle color bug: I added a hook to YSF.inc, re-compile your mode before you use the plugin. In hook, if you use -1 as car color, then color will be random number between 0 and 255 so should be fixed.
pawn Code:
stock YSF_AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2)
{
return AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, z_angle, (color1 == -1) ? (random(255)) : (color1), (color2 == -1) ? (random(255)) : (color2));
}
#if defined _ALS_AddStaticVehicle
#undef AddStaticVehicle
#else
#define _ALS_AddStaticVehicle
#endif
#define AddStaticVehicle YSF_AddStaticVehicle
stock YSF_AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay)
{
return AddStaticVehicleEx(modelid, spawn_x, spawn_y, spawn_z, z_angle, (color1 == -1) ? (random(255)) : (color1), (color2 == -1) ? (random(255)) : (color2), respawn_delay);
}
#if defined _ALS_AddStaticVehicleEx
#undef AddStaticVehicleEx
#else
#define _ALS_AddStaticVehicleEx
#endif
#define AddStaticVehicleEx YSF_AddStaticVehicleEx
stock YSF_CreateVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay)
{
return CreateVehicle(modelid, spawn_x, spawn_y, spawn_z, z_angle, (color1 == -1) ? (random(255)) : (color1), (color2 == -1) ? (random(255)) : (color2), respawn_delay);
}
#if defined _ALS_CreateVehicle
#undef CreateVehicle
#else
#define _ALS_CreateVehicle
#endif
#define CreateVehicle YSF_CreateVehicle