Hiho If someone would like to help me to update this script to 0.3.5 tfs would be great ;> there is problem with getplayerSkullTicks and doPlayerSetRedSkullTicks
:>
edit:
CLOSE TOPIC, THANKS
:>
Code:
local fragTime = getConfigInfo('timeToDecreaseFrags')
function onKill(cid, target, lastHit)
local team = 0
local id = 0
if isPlayer(target) == TRUE and getPlayerGuildId(cid) > 0 and getPlayerGuildId(target) > 0 then
local inWar_team1 = db.getResult("SELECT * FROM `wars_list` WHERE `team_1` like '%,".. getPlayerGuildId(cid) ..",%' AND `team_2` like '%,".. getPlayerGuildId(target) ..",%';")
if(inWar_team1:getID() ~= -1) then
id = tonumber(inWar_team1:getDataInt("id"))
team = 1
inWar_team1:free()
else
local inWar_team2 = db.getResult("SELECT * FROM `wars_list` WHERE `team_1` like '%,".. getPlayerGuildId(target) ..",%' AND `team_2` like '%,".. getPlayerGuildId(cid) ..",%';")
if(inWar_team2:getID() ~= -1) then
id = tonumber(inWar_team2:getDataInt("id"))
team = 2
inWar_team2:free()
end
end
if team > 0 then
db.executeQuery("INSERT INTO `war_deaths` (`war_id`, `team`, `from_guild`, `to_guild`, `player_id`, `killed_by`) VALUES (" .. id .. ", " .. team .. ", " .. getPlayerGuildId(cid) .. ", " .. getPlayerGuildId(target) .. ", " .. getPlayerGUID(target) .. ", " .. getPlayerGUID(cid) .. ");")
doPlayerSetRedSkullTicks(cid, getPlayerSkullTicks(cid, SKULL_RED) -fragTime)
end
end
return TRUE
end
edit:
CLOSE TOPIC, THANKS
Last edited: