cell AMX_NATIVE_CALL Natives::RemoveDynamicVehicleComponent(AMX *amx, cell *params) { CHECK_PARAMS(2, "RemoveDynamicVehicleComponent"); boost::unordered_map<int, Item::SharedVehicle>::iterator v = core->getData()->vehicles.find(static_cast<int>(params[1])); if (v != core->getData()->vehicles.end()) { int componentid = static_cast<int>(params[2]); if (Utility::isInContainer(v->second->carmods, componentid)) { Utility::removeFromContainer(v->second->carmods, componentid); } boost::unordered_map<int, int>::iterator i = core->getData()->internalVehicles.find(v->first); if (i != core->getData()->internalVehicles.end()) { RemoveVehicleComponent(i->second, componentid); } return 1; } return 0; }
bool RemoveComponent(int componentid) const { return RemoveVehicleComponent(id_, componentid); }