GetVehicleComponentInSlot
Description:
Function GetVehicleComponentInSlot retrieves the installed component ID (mod shop mod(ification)) on a vehicle in a specific slot.
Known Bug(s):
|
Function GetVehicleComponentInSlot was added in 0.3a and will not work in earlier versions! |
Parameters:
(vehicleid, slot)
int | vehicleid | The ID of the vehicle to check for the component. |
int | vehicleid | The component slot to check for components. |
Return Values:
The ID of the component installed in the specified slot. Returns 0 if no component in specified vehicle's specified slot, or if vehicle doesn't exist.
Examples:
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.
- AddVehicleComponent: Add a component to a vehicle.
- GetVehicleComponentType: Check the type of component via the ID.
Related Callbacks
The following callbacks might be useful as well, as they are related to this callback in one way or another.
- OnVehicleMod: Called when a vehicle is modded.
- OnEnterExitModShop: Called when a vehicle enters or exits a mod shop.