• 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!

One script, that gives honor_point to database

squidy

Member
Joined
May 18, 2009
Messages
508
Reaction score
23
Location
Gorzów Wielkopolski
Hello, I have one problem with Shawak's PVP arena. Everything works great, but i'd like leader to get honor_point in database.
I tried to make it my own, but it didn't work.

Script:
Code:
config = {
    pvpParcent = 2, -- how many exp(player killed exp parcent) killers gain for kill.
    -- arena must be square!!
    arenaFrom = {1780, 650, 7}, -- pvp arena from x,y,z position
    arenaTo = {1880, 720, 7}, -- pvp arena to x,y,z position 

}


function gainExperience(cid,lastHitKiller, mostDamageKiller)
    if (isPlayer(lastHitKiller) and isPlayer(mostDamageKiller)) and (lastHitKiller ~= mostDamageKiller) then
        doPlayerAddExp(lastHitKiller, (getPlayerExperience(cid)/200)*config.pvpParcent)
        doSendAnimatedText(getPlayerPosition(lastHitKiller), (getPlayerExperience(cid)/200)*config.pvpParcent, TEXTCOLOR_WHITE)
        doPlayerAddExp(mostDamageKiller, (getPlayerExperience(cid)/200)*config.pvpParcent)
        doSendAnimatedText(getPlayerPosition(mostDamageKiller), (getPlayerExperience(cid)/200)*config.pvpParcent, TEXTCOLOR_WHITE)
    elseif (isPlayer(lastHitKiller) and not(isPlayer(mostDamageKiller))) then
        doPlayerAddExp(lastHitKiller, (getPlayerExperience(cid)/100)*config.pvpParcent)
        doSendAnimatedText(getPlayerPosition(lastHitKiller), (getPlayerExperience(cid)/100)*config.pvpParcent, TEXTCOLOR_WHITE)
    elseif (not(isPlayer(lastHitKiller)) and isPlayer(mostDamageKiller)) then    
        doPlayerAddExp(mostDamageKiller, (getPlayerExperience(cid)/100)*config.pvpParcent)
        doSendAnimatedText(getPlayerPosition(mostDamageKiller), (getPlayerExperience(cid)/100)*config.pvpParcent, TEXTCOLOR_WHITE)
    end
end

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

    local playerPos = getPlayerPosition(cid)
    local killerPos = getPlayerPosition(lastHitKiller)
    if isPlayer(cid) then
        if (playerPos.x >= config.arenaFrom[1] and playerPos.x <= config.arenaTo[1]) and (playerPos.y >= config.arenaFrom[2] and playerPos.y <= config.arenaTo[2]) and (playerPos.z >= config.arenaFrom[3] and playerPos.z <= config.arenaTo[3]) then
            if (killerPos.x >= config.arenaFrom[1] and killerPos.x <= config.arenaTo[1]) and (killerPos.y >= config.arenaFrom[2] and killerPos.y <= config.arenaTo[2]) and (killerPos.z >= config.arenaFrom[3] and killerPos.z <= config.arenaTo[3]) then
                gainExperience(cid,lastHitKiller, mostDamageKiller)
            end
        end
    end
        return TRUE
end

If someone can add that line to this script it would be great :D
Rep ++ inc. ofc : P
 

Similar threads

Back
Top