17.03.2009, 18:55
Is it possible?
// 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];
}
Originally Posted by Westie
You do know that you can edit a_vehicles.inc, and make it so that the original ChangeVehicleColor gets renamed to something like oldChangeVehicleColor, and then you can create a stock with the same name that keeps log of all the colours, so effectively all that is needed for scripts is a recompile, amiryte?
|