XU

poblema na soucer ou outro lugar talvez

Por xugrude456, 13 de abr. de 2019 em Programação

11
1.6k
xugrude456X
13 de abril de 2019 às 11:03

olá galera, queria uma ajuda pra solucionar um poblema meu servidor nao ta funcionando o comando /addskill 

nao sei onde poderia ser o poblema ja tentei por o script denovo e pegar um ai pa testa mas nao funcionou .

obrigado pela atenção se puder ajuda deis de ja dou REP++

gabriel28G
13 de abril de 2019 às 16:03
4 horas atrás, xugrude456 disse:

olá galera, queria uma ajuda pra solucionar um poblema meu servidor nao ta funcionando o comando /addskill 

nao sei onde poderia ser o poblema ja tentei por o script denovo e pegar um ai pa testa mas nao funcionou .

obrigado pela atenção se puder ajuda deis de ja dou REP++

O que tem em .lua é meio bugado. Sempre que adiciona, trava em 99%, dai tem que atacar alguma coisa pra subir a skill.
Só alterando a source pra fazer com que funcione normal.

xugrude456X
13 de abril de 2019 às 16:13
6 minutos atrás, gabriel28 disse:

O que tem em .lua é meio bugado. Sempre que adiciona, trava em 99%, dai tem que atacar alguma coisa pra subir a skill.
Só alterando a source pra fazer com que funcione normal.

então vamos o poblema e na soucer mesmo ?

tem esse erro aki no forgothe

1a1b.png

gabriel28G
13 de abril de 2019 às 16:14
1 minuto atrás, xugrude456 disse:

então vamos o poblema e na soucer mesmo ?

tem esse erro aki no forgothe

Manda a tag e o script.

xugrude456X
13 de abril de 2019 às 16:17
1 minuto atrás, gabriel28 disse:

essa aki e a tag 

<talkaction log="yes" words="/skill;/addskill" access="5" event="script" value="addskill.lua"/>

 

 

 

 

 

local function getSkillId(skillName)
    if skillName == "club" then
        return SKILL_CLUB
    elseif skillName == "sword" then
        return SKILL_SWORD
    elseif skillName == "axe" then
        return SKILL_AXE
    elseif skillName:sub(1, 4) == "dist" then
        return SKILL_DISTANCE
    elseif skillName:sub(1, 6) == "shield" then
        return SKILL_SHIELD
    elseif skillName:sub(1, 4) == "fish" then
        return SKILL_FISHING
    else
        return SKILL_FIST
    end
end

local function getExpForLevel(level)
    level = level - 1
    return ((50 * level * level * level) - (150 * level * level) + (400 * level)) / 3
end

function onSay(cid, words, param)
    local player = Player(cid)
    if not player:getGroup(5):getAccess(5) then
        return true
    end

    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end

    local split = param:split(",")
    if split[2] == nil then
        player:sendCancelMessage("Insufficient parameters.")
        return false
    end

    local target = Player(split[1])
    if target == nil then
        player:sendCancelMessage("A player with that name is not online.")
        return false
    end

    -- Trim left
    split[2] = split[2]:gsub("^%s*(.-)$", "%1")

    local count = 1
    if split[3] ~= nil then
        count = tonumber(split[3])
    end

    local ch = split[2]:sub(1, 1)
    for i = 1, count do
        if ch == "l" or ch == "e" then
            target:addExperience(getExpForLevel(target:getLevel() + 1) - target:getExperience(), false)
        elseif ch == "m" then
            target:addManaSpent(target:getVocation():getRequiredManaSpent(target:getBaseMagicLevel() + 1) - target:getManaSpent())
        else
            local skillId = getSkillId(split[2])
            target:addSkillTries(skillId, target:getVocation():getRequiredSkillTries(skillId, target:getSkillLevel(skillId) + 1) - target:getSkillTries(skillId))
        end
    end
    return false
end

 

gabriel28G
13 de abril de 2019 às 16:20
2 minutos atrás, xugrude456 disse:

 

Qual a versão do teu TFS?

xugrude456X
13 de abril de 2019 às 16:22
1 minuto atrás, gabriel28 disse:

Qual a versão do teu TFS?

0.4.0.0

 

gabriel28G
13 de abril de 2019 às 16:25
3 minutos atrás, xugrude456 disse:

0.4.0.0

 

Por isso esse script não está funcionando, você está tentando usar um script feito para versões 1.x. Vou ver se acho um script pra essa versão, se conseguir, editarei esse comentário.
EDIT: Já achei, tava fácil numa pasta aberta aqui. hahaha
 

Spoiler
function onSay(cid, words, param, channel)
if(param == '') then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")

return true

end

local t = string.explode(param, ",")

if(not t[2]) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Not enough params.")

return true

end

local pid = getPlayerByNameWildcard(t[1])

if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.")

return true

end

t[2] = t[2]:lower()

local skill = SKILL_IDS[t[2]]

if(not skill) then

local tmp = t[2]:sub(1, 1)

if(tmp == 'l' or tmp == 'e') then

skill = SKILL__LEVEL

elseif(tmp == 'm') then

skill = SKILL__MAGLEVEL

else

skill = tonumber(t[2])

if(not skill or skill < SKILL_FIRST or SKILL > SKILL__LAST) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Such skill does not exists.")

return true

end

end

end

local amount = tonumber(t[3])

if(not amount or amount == 0) then

amount = 1

end

doPlayerAddSkill(pid, skill, amount, true)

return true

end

 

 

Editado Abril 13 por gabriel28

xugrude456X
13 de abril de 2019 às 16:26
Agora, gabriel28 disse:

Por isso esse script não está funcionando, você está tentando usar um script feito para versões 1.x. Vou ver se acho um script pra essa versão, se conseguir, editarei esse comentário.

dmr mano se vc conseguir me ajuda ficarei grato :D

gabriel28G
13 de abril de 2019 às 16:27
Agora, xugrude456 disse:

dmr mano se vc conseguir me ajuda ficarei grato :D

Vê meu comentário anterior, eu tava com a pasta aberta e tinha ele.

xugrude456X
13 de abril de 2019 às 16:30
2 minutos atrás, gabriel28 disse:

Vê meu comentário anterior, eu tava com a pasta aberta e tinha ele.

vlw men vc e meu heroi s2 teda rep :D