|
local QJPaySdb = '.\\131Data\\131Pay.sdb'; --全局充值文件路径
删除QJPaySdb 路径下的Player.GetAccount(PlayP) 的充值记录
Manager.DelNameInSdb(QJPaySdb, Player.GetAccount(PlayP));
local PaySdb = '.\\tgsplus\\冲值记录.sdb'; --充值记录
Manager.SetSdbInfo(PaySdb, tostring(Player.GetCharId(PlayP)),'lj',tostring(tonumber(lj) + tonumber(pay)));
得到131Pay.sdb这个文件下的用户充值记录
local pay = Manager.GetSdbInfo(QJPaySdb, Player.GetAccount(PlayP),'payMoney');
得到累计的累计记录
local lj = Manager.GetSdbInfo('.\\tgsplus\\冲值记录.sdb', tostring(Player.GetCharId(PlayP)),'lj');
窗口提示得信息!并返回
Player.ShowWindowByStr(PlayP, PlayP, string.format(HelpIndex1, '当前未领取:'..pay..'个'..wup_Name..'\n\n 已累计领取:'..lj..'个'..wup_Name), 0);
return;
一个简单的判断语句
if tonumber(pay) == nil or tonumber(pay) < 1 then
Player.ShowWindowByStr(PlayP, PlayP, string.format(HelpIndex1, '您本次没有充值\n\n 您共累计充值过:'..lj..'个'..wup_Name), 0);
return;
end;
两种窗口信息
PlayerList.SendTopMessage('感谢玩家 ['..Player.GetName(PlayP)..'] 对本服务器的支持', 2);
PlayerList.SendNoticeMessageByCol('[系统提示:]感谢土豪['..Player.GetName(PlayP)..']对本服务器的支持' , 31744, 1024);
写入数据
Manager.SetSdbInfo(PaySdb, tostring(Player.GetCharId(PlayP)),'lj',tostring(tonumber(lj) + tonumber(pay)));
窗口的另一种
local HelpIndex1 =
[[<start>
<head>
<title>充值系统</title>
</head>
<text>
</text>
<command send='close'>关闭</command>
<body>
%s
</body>
</start>
]];
str = str .. '\n\n 累计充值:'..tostring(tonumber(lj) + tonumber(pay))..'个'..wup_Name;
Player.ShowWindowByStr(PlayP, PlayP, string.format(HelpIndex1, str), 0);
|
|