tuduras
Well-Known Member
- Joined
- Jun 4, 2017
- Messages
- 340
- Solutions
- 2
- Reaction score
- 58
Hello Otlanders.. Can someone repair me script of metin stone.
As a reward is 5 premium points but for Gesior not for Znote . I'm already using Znote ACC and there is another code line for "points" not "premium_points". Here post metin scirpt :
I change line account to znote_account and premium_points to points.
and get The error :
As a reward is 5 premium points but for Gesior not for Znote . I'm already using Znote ACC and there is another code line for "points" not "premium_points". Here post metin scirpt :
LUA:
local config = {
points = 5, -- how many points winner get?
}
local names = {'earth stone', 'icy stone', 'fire stone', 'wind stone'}
function onDeath(cid, corpse, deathList)
if (isInArray(names, getCreatureName(cid):lower())) then
--local mostdmg = deathList[2] ~= nil and deathList[2] or deathList[1]
local mostdmg = isPlayer(deathList[1]) and deathList[1] or (deathList[2] ~= nil and deathList[2])
if isPlayer(mostdmg) then
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` +" .. config.points .. " WHERE `name` = '".. getAccountByName(getCreatureName(mostdmg)) .."';")
doPlayerSendTextMessage(mostdmg, 22, "You have killed " .. getCreatureName(cid) .. ". You won 5 points to sms shop.")
db.executeQuery("INSERT INTO metin_wins (name, reward, reward_id, stone, date) VALUES ('" .. getCreatureName(mostdmg) .. "', '5 points', '2', '" .. getCreatureName(cid) .. "', " .. os.time() .. ")")
else
doBroadcastMessage("No one has destroyed the stone")
end
end
return TRUE
end
LUA:
db.executeQuery("UPDATE `znote_accounts` SET `points` = `points` + " .. addPoints .. " WHERE `account_id` = " .. getPlayerAccountId(cid))
Post automatically merged:
I change line account to znote_account and premium_points to points.
and get The error :

Last edited:

