找回密码
 register

QQ登录

只需一步,快速开始

搜索
查看: 629|回复: 0

[游戏教程] 金币检查 优化金币扣除:从只扣除金币,改为优先扣除交子再扣金币

[复制链接]
  • 打卡等级:热心大叔
  • 打卡总天数:270
  • 打卡月天数:20
  • 打卡总奖励:268
  • 最近打卡:2025-08-21 12:09:08
Waylee 发表于 2022-12-13 08:28 | 显示全部楼层 |阅读模式

马上注册,查看网站隐藏内容!!

您需要 登录 才可以下载或查看,没有账号?register

×
测试人@:雪舞
测试时间:2022-12-13

原始代码:
只扣除金币,有交子也没办法用哦
        local reply = CostMoney(sceneId, selfId, 2000000)
        if reply == -1 then
            x895111_NotifyTips(sceneId, selfId, "金钱不足,扣取失败")
            return
        end



新代码,优先扣除交子,再扣除金币:
--优先扣除交子 *雪舞优化:优先扣除交子,推广交子金币兼容 2022-12-13 08:23:58
                local HumanMoney = LuaFnGetMoney( sceneId, selfId )
                local HumanMoneyJZ = GetMoneyJZ( sceneId, selfId );
                if HumanMoney + HumanMoneyJZ  <  2000000 then
                        x895111_NotifyTips(sceneId, selfId, "你携带的金钱不足,转移需要200金")
                        return
                end
                local nDelJZ, nDelMoney = LuaFnCostMoneyWithPriority(sceneId, selfId, 2000000);
                if (nDelJZ == -1) then
                        x895111_NotifyTips(sceneId, selfId, "金钱不足,扣取失败")
                        return
                end

您需要登录后才可以回帖 登录 | register

本版积分规则

雪舞知识库 ( 浙ICP备15015590号-1 | 萌ICP备20232229号|浙公网安备33048102000118号 ) |网站地图|天天打卡

GMT+8, 2025-8-22 09:54 , Processed in 0.129379 second(s), 7 queries , Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表