How to script team vehicle colours? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to script team vehicle colours? (
/showthread.php?tid=175086)
How to script team vehicle colours? -
Alphos - 08.09.2010
Hi,
I saw in a random DM server that vehicle colours change when you enter them. The colours change in your teamcolor when you press enter of F if standing near them. Does anybody know how to script something like that? Would like to know as I'm a scripting rookie.
Thanks in advance!
Re: How to script team vehicle colours? -
Mauzen - 08.09.2010
There is a OnPlayerEnterVehicle callback that is called when you press F.
There you can add ChangeVehicleColor, with an if() for the team then, to change it to the team color.
Re: How to script team vehicle colours? -
Mean - 08.09.2010
this goes above the main function
this goes under GameModeInit
pawn Код:
vehicle1 == AddStaticVehicle(bla, bla, bla);
Look for OnPlayerEnterVehicle in your script and add this

hope it helps
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new string[128];
format(string, sizeof(string), "You are entering vehicle %i",vehicleid);
SendClientMessage(playerid, COLOR, string);//Replace COLOR with the color of the text you want
return ChangeVehicleColor(vehicleid,color,color);//Ofcourse change vehicleid and colors
}