This function was added in SA-MP 0.3a and will not work in earlier versions!
(vehicleid, slot)
vehicleid
The ID of the vehicle to check for the component.
slot
The component slot to check for components.
Known Bug(s):
- Doesn't work for CARMODTYPE_STEREO.
- Both front bull bars and front bumper components are saved in the CARMODTYPE_FRONT_BUMPER slot. If a vehicle has both of them installed, this function will only return the one which was installed last.
- Both rear bull bars and rear bumper components are saved in the CARMODTYPE_REAR_BUMPER slot. If a vehicle has both of them installed, this function will only return the one which was installed last.
- Both left side skirt and right side skirt are saved in the CARMODTYPE_SIDESKIRT slot. If a vehicle has both of them installed, this function will only return the one which was installed last.
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp("/myspoiler", cmdtext) && IsPlayerInAnyVehicle(playerid))
{
new component;
component = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_SPOILER);
if (component == 1049)
{
SendClientMessage(playerid,0xFFFFFFFF,"You have an Alien spoiler installed in your Elegy!");
}
}
}
The following functions may be useful, as they are related to this function in one way or another.
The following callbacks might be useful, as they're related to this function in one way or another.