making team car colors - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: making team car colors (
/showthread.php?tid=499817)
making team car colors -
1fret - 09.03.2014
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...
Re: making team car colors -
Aerotactics - 09.03.2014
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
Re: making team car colors -
1fret - 09.03.2014
Could you do it for 2 cars let me edit it for the rest
Re: making team car colors -
Aerotactics - 09.03.2014
Quote:
Originally Posted by 1fret
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);
}
Re: making team car colors -
1fret - 09.03.2014
thanks man rep+