Simple help me please
#1

Hey guys i am creating a function like.

Onvehiclespawn

it sets its color to

ChangeVehicleColor(vehicleid, 151, 117);

or
ChangeVehicleColor(vehicleid, 144, 146);
or
ChangeVehicleColor(vehicleid, 6, 7);

I mean like else setthiscolor else setthiscolor

Like different colors

Because in my GM all AddStaticVehicle colors are white.

So i am trying this.

Please help me.
Reply
#2

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)...
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;
(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..
Reply
#3

Thanks very much Sascha I HIT THE STAR. Good luck
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)