• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Guild war script

Status
Not open for further replies.

Matre

NewLineOts.com
Joined
Sep 13, 2009
Messages
58
Reaction score
0
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
:>

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:
Status
Not open for further replies.
Back
Top