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

[Request] BROADCAST ADVANCE LEVEL!

I found something like it.

Code:
--[[
<event type="advance" name="PlayerAdvance" event="script" value="mine/advance.lua"/>
Script made by Pitufo/Haifurer
Modified and pimped by mastah Keraxel
God bless ya
]]
local data = {
    [0] = { "Fist skill UP", 30}, -- 30 = variable[2]  -- Animation effect
    [1] = { "Club skill UP", 30}, -- 30 = variable[2]  -- Animation effect
    [2] = { "Sword skill UP", 30}, -- 30 = variable[2]  -- Animation effect
    [3] = { "Axe skill UP", 30}, -- 30 = variable[2]  -- Animation effect
    [4] = { "Distance skill UP", 30}, -- 30 = variable[2]  -- Animation effect
    [5] = { "Shield skill UP", 30}, -- 30 = variable[2]  -- Animation effect
    [6] = { "Fishing skill UP", 30}, -- 30 = variable[2]  -- Animation effect
    [7] = { "Magic level UP", 30}, -- 30 = variable[2]  -- Animation effect
    [8] = { "Level UP", 30} -- 30 = variable[2]  -- Animation effect
}
local config = {
showAllAdvances = true, --(true/false) // czy ma pokazywac napis nad postacia przy kazdym awansie? // YES == tak, NO == nie
broadcastOnLevels = {100, 200, 300, 400, 500} -- wpisz poziomy, na ktorych ma oglaszac awans kazdemu graczowi // aby wylaczyc wpisz samo 0
}
function onAdvance(cid, skill, oldlevel, newlevel)
local pos = getPlayerPosition(cid)
local positions = {
        {x=pos.x+1,y=pos.y-1,z=pos.z},
        {x=pos.x-1,y=pos.y-1,z=pos.z},
        {x=pos.x+1,y=pos.y+1,z=pos.z},
        {x=pos.x-1,y=pos.y+1,z=pos.z},
        {x=pos.x+1,y=pos.y,z=pos.z},
        {x=pos.x-1,y=pos.y,z=pos.z},
        {x=pos.x,y=pos.y+1,z=pos.z},
        {x=pos.x,y=pos.y-1,z=pos.z}
}


    if skill == 8 then
        if config.showAllAdvances and isInArray(config.broadcastOnLevels, getPlayerLevel(cid)) then
            broadcastMessage(getPlayerName(cid).." has been advanced on ".. newlevel .." level. Congratulations!", MESSAGE_EVENT_ADVANCE)
        end
    end
        doCreatureSay(cid, ""..data[skill][1].." ["..newlevel.."]", TALKTYPE_ORANGE_1)
        for i = 1, table.maxn(positions) do
                    doSendMagicEffect(positions[i],data[skill][2])
        end
return TRUE
end

I didn't test it, but should work.
If it won't let me know ;)
 
Back
Top