stoneage8.5/服务器端lua文件/ablua/magic/addvippoint.lua

30 lines
1.2 KiB
Lua
Raw Normal View History

2020-06-22 17:49:02 +08:00
function addvip(charaindex, data)
local value = other.atoi(other.getString(data, " ", 1))
local cdkey = other.getString(data, " ", 2)
if cdkey == "" then
local oldvalue = sasql.getVipPoint(charaindex)
sasql.setVipPoint(charaindex, sasql.getVipPoint(charaindex) + value)
char.TalkToCli(charaindex, -1, "<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>[" .. char.getChar(charaindex, "<EFBFBD>˺<EFBFBD>") .. "]<5D><><EFBFBD><EFBFBD>[" .. char.getChar(charaindex, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>") .. "]<5D><><EFBFBD>˻<EFBFBD>Ա<EFBFBD><D4B1>ԭ" .. oldvalue .. "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" .. sasql.getVipPoint(charaindex), "<EFBFBD><EFBFBD>ɫ")
else
local maxplayer = char.getPlayerMaxNum()
local cimelia = other.atoi(data)
for i = 0, maxplayer - 1 do
if char.check(i) == 1 then
if char.getChar(i, "<EFBFBD>˺<EFBFBD>") == cdkey then
local oldvalue = sasql.getVipPoint(i)
sasql.setVipPoint(i, sasql.getVipPoint(i) + value)
char.TalkToCli(charaindex, -1, "<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>[" .. char.getChar(i, "<EFBFBD>˺<EFBFBD>") .. "]<5D><><EFBFBD><EFBFBD>[" .. char.getChar(i, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>") .. "]<5D><><EFBFBD>˻<EFBFBD>Ա<EFBFBD><D4B1>ԭ" .. oldvalue .. "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" .. sasql.getVipPoint(i), "<EFBFBD><EFBFBD>ɫ")
char.TalkToCli(i, -1, "GM[" .. char.getChar(charaindex, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>") .. "]<5D><><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><C4B8>˻<EFBFBD>Ա<EFBFBD><D4B1>ԭ" .. oldvalue .. "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ" .. sasql.getVipPoint(i), "<EFBFBD><EFBFBD>ɫ")
return
end
end
end
end
end
function main()
minute = 0
magic.addLUAListFunction("<EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD>", "addvip", "", 1, "[]")
end