GetVehicleComponentType

warning

This function was added in SA-MP 0.3a and will not work in earlier versions!

Description

Find out what type of component a certain ID is.

NameDescription
componentThe component ID to check.

Returns

The component slot ID of the specified component or -1 if the component is invalid.

Examples

public OnVehicleMod(playerid, vehicleid, componentid)
{
new
componentType = GetVehicleComponentType(componentid);
if (componentType != -1)
{
new
clientMessage[41];
format(clientMessage, sizeof(clientMessage), "You have modified your vehicle on slot %i", componentType);
SendClientMessage(playerid, 0xFFFFFFFF, clientMessage);
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "The component is invalid.");
}
return 1;
}

Related Functions