29.11.2009, 06:24
I am searching for a function which retrieves a vehicles colour id, but I cannot find any, does anyone know one?
// Top of script
new V_Colors[2][MAX_VEHICLES];
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
V_Colors[0][vehicleid] = color1;
V_Colors[1][vehicleid] = color2;
return 1;
}
//OnPlayerCommandText
if(!strcmp(cmdtext,"/vehiclecolor",true))
{
format(string,sizeof string,"First Color - %d | 2nd Color - %d",V_Colors[0][GetPlayerVehicleID(playerid)],V_Colors[1][GetPlayerVehicleID(playerid)]);
SendClientMessage(playerid,0xCCAABBDD,string);
}
//OnPlayerCommandText
if(!strcmp(cmdtext,"/vehiclecolor",true))
{
if(V_Colors[0][GetPlayerVehicleID(playerid)] == 0x_YOUR_CODE_FROM_PAINTJOB)
{
format(string,sizeof string,"First color - %s","red/or what color it is");
return SendClientMessage(playerid,0xFFFFFFFF,string);
}
format(string,sizeof string,"First Color - %d | 2nd Color - %d",V_Colors[0][GetPlayerVehicleID(playerid)],V_Colors[1][GetPlayerVehicleID(playerid)]);
SendClientMessage(playerid,0xCCAABBDD,string);
}