GetVehicleComponentInSlot

From SA-MP Wiki

Jump to: navigation, search

GetVehicleComponentInSlot


Warning: This function was added in SA-MP version 0.3. It is not available in previous versions.


Returns the installed component ID from a vehicle in a determined slot.


Parameters:
(vehicleid, slot)
vehicleidVehicle to check for the component.
slotThe component slot to check.


ReturnsThe component number installed in the defined slot.


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!");
        }
    }
}

Related Functions

The following functions might be useful as well, as they're related to this function in one way or another.


Related Callbacks

The following callbacks might be useful, as they're related to this function in one way or another.

Personal tools