AddVehicleComponent Sk
From SA-MP Wiki
Description:
Pri použití tejto funkcie si môžete pridávať komponenty do vašeho auta, ktoré ste vytvorili funkciou AddStaticVehicle, AddStaticVehicleEx alebo CreateVehicle. ID komponentov môžete nájsť tu.
(vehicleid, componentid)
vehicleid | ID vytvoreného vozidla, nie ID modelu vozidla. |
componentid | ID Komponentu ktorý chcete pridať do vašeho vozidla. |
Important | Ak použijete neexistujúce ID Komponentu, spadne vám hra. |
Return Values:
This function does not return any specific values.
new vozidlo; public OnGameModeInit( ) { vozidlo = AddStaticVehicle(420,-2482.4937,2242.3936,4.6225,179.3656,6,1); // Taxi return 1; } public OnPlayerEnterVehicle (playerid, vehicleid) { if (vehicleid == vozidlo) { AddVehicleComponent(vozidlo, 1010); // Nitro SendClientMessage(playerid, 0xFFFFFFAA, "Do vašeho Taxi bolo pridané Nitro."); } return 1; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- RemoveVehicleComponent: Remove a component from a vehicle.
- GetVehicleComponentInSlot: Check what components a vehicle has.
- GetVehicleComponentType: Check the type of component via the ID.
Related Callbacks
The following callbacks might be useful, as they're related to this function in one way or another.
- OnVehicleMod: Called when a vehicle is modded.
- OnEnterExitModShop: Called when a vehicle enters or exits a mod shop.