GetVehicleComponentInSlot

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 23:25, 4 May 2012
Smithy (Talk | contribs)

← Previous diff
Revision as of 04:29, 5 February 2014
Connor Mead (Talk | contribs)

Next diff →
Line 1: Line 1:
{{Scripting}} {{Scripting}}
-{{Title}} 
{{0.3Added|function|}} {{0.3Added|function|}}
Line 36: Line 35:
[[Category:Scripting Functions]] [[Category:Scripting Functions]]
 +
 +[[fr:GetVehicleComponentInSlot]]

Revision as of 04:29, 5 February 2014



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


Description:

Retreives the installed component ID from a vehicle in a specific slot.


Parameters:
(vehicleid, slot)
vehicleidThe ID of the vehicle to check for the component.
slotThe component slot to check for components.


Return Values:

The ID of the component installed in the specified 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 may be useful, as they are 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.

In other languages