Does anyone help me with this error?
top guild effects
thanks !!!
top guild effects
thanks !!!
--<globalevent name="topguild" interval="10000" event="script" value="topguild.lua"/>--
local function getTopGuild()
local query = "SELECT
local queryResult = db.storeQuery(query)
if queryResult then
local guildID = result.getDataInt(queryResult, "id")
result.free(queryResult)
return guildID
end
return false
end
function onThink(interval, lastExecution, toPosition, fromPosition, cid)
local topGuild = getTopGuild()
for _, cid in ipairs(Game.getPlayers()) do
if getPlayerGuildId(cid) == topGuild then
targetPlayer:sendTextMessage(MESSAGE_EVENT_ADVANCE, "top guild")
end
end
return true
end
local function getTopGuild()
local query = "SELECT
g.id AS id, g.name AS name, COUNT(g.name) as frags FROM players p LEFT JOIN player_deaths pd ON pd.killed_by = p.name LEFT JOIN guild_membership gm ON p.id = gm.player_id LEFT JOIN guilds g ON gm.guild_id = g.id WHERE g.id > 0 AND pd.unjustified = 1 GROUP BY name ORDER BY frags DESC, name ASC LIMIT 4;"local queryResult = db.storeQuery(query)
if queryResult then
local guildID = result.getDataInt(queryResult, "id")
result.free(queryResult)
return guildID
end
return false
end
function onThink(interval, lastExecution, toPosition, fromPosition, cid)
local topGuild = getTopGuild()
for _, cid in ipairs(Game.getPlayers()) do
if getPlayerGuildId(cid) == topGuild then
targetPlayer:sendTextMessage(MESSAGE_EVENT_ADVANCE, "top guild")
end
end
return true
end
Attachments
-
capture-20190301-185132.png15.9 KB · Views: 13 · VirusTotal