How to script team vehicle colours?
#1

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!
Reply
#2

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

this goes above the main function
pawn Код:
new vehicle1;
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
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)