/*
文件名:SetUserMaxLevel.nut
路径:Dps_A/CallBack/SetUserMaxLevel.nut
创建日期:2024-06-19	19:36
文件用途:
*/
if (!("Cb_user_setusermaxlevel_Level" in getroottable())) Cb_user_setusermaxlevel_Level <- 70;

function Cb_user_setusermaxlevel(C_User, Level) {
    print(Level);
    local SUser = User(C_User);
    if (!SUser) return;
    if (Level <= Cb_user_setusermaxlevel_Level) {
        if (Level > 0) {
            SUser.SetCharacLevel(Level);
        } else {
            SUser.SetCharacLevel(1);
        }
    } else {
        SUser.SetCharacLevel(Cb_user_setusermaxlevel_Level);
    }
}