SpiderOT
™ツʂριԃҽɾσƚ➽ ٩(•‿•)۶★彡
hello all
my server had a problem when ppl get the frag to ban/black skull
they didnt get ban or black skull
some ppl told me to compile it with last source so i did and still have the same problem
my config is
i want player get red skull after 5 frags and black skull after 7 frag
maybe this problem due to a script in creaturevent?
i have add 2 creaturevents
script
player death
bounty hunter
please help
my server had a problem when ppl get the frag to ban/black skull
they didnt get ban or black skull
some ppl told me to compile it with last source so i did and still have the same problem
my config is
LUA:
redSkullLength = 24 * 60 * 60
blackSkullLength = 2 * 24 * 60 * 60
dailyFragsToRedSkull = 5
weeklyFragsToRedSkull = 9
monthlyFragsToRedSkull = 14
dailyFragsToBlackSkull = dailyFragsToRedSkull
weeklyFragsToBlackSkull = weeklyFragsToRedSkull
monthlyFragsToBlackSkull = monthlyFragsToRedSkull
dailyFragsToBanishment = 7
weeklyFragsToBanishment = 10
monthlyFragsToBanishment = 15
blackSkulledDeathHealth = 100
blackSkulledDeathMana = 100
useBlackSkull = "yes"
advancedFragList = "no"
maybe this problem due to a script in creaturevent?
i have add 2 creaturevents
LUA:
<event type="death" name="PlayerDeath" event="script" value="playerdeath.lua"/>
<event type="kill" name="BountyHunter" script="kill.lua"/>
script
player death
LUA:
local config = {
deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')),
sqlType = getConfigInfo('sqlType'),
maxDeathRecords = getConfigInfo('maxDeathRecords')
}
config.sqlType = config.sqlType == "sqlite" and DATABASE_ENGINE_SQLITE or DATABASE_ENGINE_MYSQL
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
if(config.deathListEnabled ~= TRUE) then
return
end
local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";")
if(rows:getID() ~= -1) then
local amount = rows:getRows(true) - config.maxDeathRecords
if(amount > 0) then
if(config.sqlType == DATABASE_ENGINE_SQLITE) then
for i = 1, amount do
db.executeQuery("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);")
end
else
db.executeQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `date` LIMIT " .. amount .. ";")
end
end
end
end
LUA:
function onKill(cid, target)
if isPlayer(target) == TRUE then
---- BOUNTY HUNTERS START -----
pid = cid
pid2 = getPlayerGUID(target)
local result_plr = db.getResult("SELECT * FROM `bounty_hunters` WHERE `sp_id` = "..pid2.." AND `killed` = 0;")
if(result_plr:getID() ~= -1) then
prize = tonumber(result_plr:getDataInt("prize"))
bid = tonumber(result_plr:getDataInt("id"))
result_plr:free()
else
prize = 0
bid = 0
end
if (bid ~= 0 and prize ~= 0 and not(getTileInfo(getCreaturePosition(cid)).pvp)) then
db.executeQuery("UPDATE `bounty_hunters` SET `killed` = 1, `k_id`="..getPlayerGUID(cid)..", `kill_time` = " .. os.time() .. " WHERE `id` = "..bid..";")
doPlayerAddMoney(cid,prize*1000)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'[BOUNTY HUNTERS] You killed hunted player, so you gained the reward!')
end
---- BOUNTY HUNTERS END -----
end
return TRUE
end
please help