02.08.2011, 09:17
you could actually just use "-1, -1" as color id for all vehicles.. that's a (more or less) random color...
else just try this code (under OnVehicleSpawn)...
(there are other ways to do it but this is the simpliest code to understand I guess)...
however remember that this function won't be called when the server loads and all vehicles spawn...
OnVehicleSpawn gets just called when a vehicle actually respawns..
else just try this code (under OnVehicleSpawn)...
pawn Код:
new ran = random(3);
if(ran == 0) ChangeVehicleColor(vehicleid, 151, 117);
else if(ran == 1) ChangeVehicleColor(vehicleid, 144, 146);
else if(ran == 2) ChangeVehicleColor(vehicleid, 6, 7);
return 1;
however remember that this function won't be called when the server loads and all vehicles spawn...
OnVehicleSpawn gets just called when a vehicle actually respawns..