[Possible?] To make a function GetVehicleColor(vehicleID, Col1, Col2);?
#4

I suppose if you really want to
pawn Код:
// If you cba to change your script
#define AddStaticVehicle AddStaticVehicleEx
#define CreateVehicle CreateVehicleEx
#define ChangeVehicleColor ChangeVehicleColorEx
// Top of script
new Color1[MAX_VEHICLES];
new Color2[MAX_VEHICLES];
// AddStaticVehicle replacement
stock AddStaticVehicleEx(model, Float:x, Float:y, Float:z, Float:angle, color1, color2)
{
  new vehicle;
  vehicle = AddStaticVehicle(model, x, y, z, angle, color1, color2);
  Color1[vehicle] = color1;
  Color2[vehicle] = color2;
  return vehicle;
}
// CreateVehicle replacement
stock CreateVehicleEx(model, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawndelay)
{
  new vehicle;
  vehicle = CreateVehicle(model, x, y, z, angle, color1, color2, respawndelay);
  Color1[vehicle] = color1;
  Color2[vehicle] = color2;
  return vehicle;
}
// ChangeVehicleColor replacement
stock ChangeVehicleColorEx(vehicleid, color1, color2)
{
  ChangeVehicleColor(vehicleid, color1, color2);
  Color1[vehicleid] = color1;
  Color2[vehicleid] = color2;
  return 1;
}
// Get color1
stock GetVehicleColor1(vehicleid)
{
  return Color1[vehicleid];
}
// Get color2
stock GetVehicleColor2(vehicleid)
{
  return Color2[vehicleid];
}
Only a rough guidline BTW
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)