-- ***********************************************************
-- **                    bikinihorst                        **
-- ***********************************************************
Panzer = Panzer or {};
Panzer.Armor = Panzer.Armor or {};
Panzer.Armor.Commands = Panzer.Armor.Commands or {};

function Panzer.Armor.Commands.setPartModData(playerObj, args)
    local vehicle = getVehicleById(args.vehicle);
    if vehicle and args.data then
        local part = vehicle:getPartById(args.part);
        if part then
            local modData = part:getModData();
            for key, value in pairs(args.data) do
                modData[key] = value;
            end
            vehicle:transmitPartModData(part);
        end
    end
end

Events.OnClientCommand.Add(function(moduleName, command, playerObj, args)
    if moduleName == "Panzer_armor" and Panzer.Armor.Commands[command] then
        Panzer.Armor.Commands[command](playerObj, args);
    end
end);
