making team car colors
#1

As I say in my first thread I'm not a good scripter. Can someone tell me how to make team cars color meaning the cars at ballas spawn area is purple, the cars at grove spawn area is green etc...
Reply
#2

pawn Code:
//top of script
new GroveCar[10]; // or however many you want

//under OnGamemodeInit
GroveCar[0] = AddStaticVehicle(etc.) // Arrays start at 0, and it counts as 1
GroveCar[1] =
.
.
.
GroveCar[9] =

// You have 2 options. You can set all the car colors to green in spawn info^ OR make a foreach loop:
for (new i = 0; i<sizeof(GroveCar);i++)
{
ChangeVehicleColor(GroveCar[i], 128, 128); // Sets all GroveCars to Green on spawn
}

// You would have to do this process for each of the gangs, but I hope this is a helpful start. :)
EDIT: fixed typos
Reply
#3

Could you do it for 2 cars let me edit it for the rest
Reply
#4

Quote:
Originally Posted by 1fret
View Post
Could you do it for 2 cars let me edit it for the rest
YEP! Same instructions as before:

pawn Code:
new GroveCar[2];

GroveCar[0] = AddStaticVehicleEx(536,2508.2949000,-1668.1362000,13.0688000,0.0000000,-1,-1,15); //Blade
GroveCar[1] = AddStaticVehicleEx(535,2502.2048000,-1657.6660000,13.1479000,53.9400000,-1,-1,15); //Slamvan

for (new i = 0; i<sizeof(GroveCar);i++)
{
    ChangeVehicleColor(GroveCar[i], 128, 128);
}
Reply
#5

thanks man rep+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)