HE

[RESOLVIDO] Trocar Looktype e Ficar sem andar

Por HeelNox, 14 de ago. de 2013 em Scripts

resolvido
script
35
4.1k
HeelNoxH
17 de agosto de 2013 às 11:06

 

tome esse. acho que ele eskeçeu de colocar o hpGain no ultimo rs.

function onSay(cid, words, param)

local hpGain = 5
local vocs = {
    [1] = 538,
    [2] = 585,
    [3] = 536,
}
 
if not vocs[getPlayerVocation(cid)] then
    return true
end

if getPlayerStorageValue(cid, 9329) < 1 then
    heal(cid, hpGain)
    doCreatureSetNoMove(cid, true)
    setPlayerStorageValue(cid, 9329, 1)
    doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1)
    
elseif getPlayerStorageValue(cid, 9329) >= 1 then
    doCreatureSetNoMove(cid, false)
    setPlayerStorageValue(cid, 9329, -1)
    doRemoveCondition(cid, CONDITION_OUTFIT)
end
    return true
end

function heal(uid, hp)

if not isPlayer(uid) then
    return true
end

if getPlayerStorageValue(uid, 9329) < 1 then
    return true
end

doCreatureAddHealth(uid, hpGain)
    return addEvent(heal, 1 * 1500, uid, hp)
end

 

Não funfou , estou com meu char player e não ta healando

Editado Agosto 17 por DarkHeel

VodkartV
17 de agosto de 2013 às 11:07

isso é um sistema de sentar? já criei isso uma vez


http://www.xtibia.com/forum/topic/187379-sistema-de-sentar-com-recuperacao-automatica/

RoksasR
17 de agosto de 2013 às 11:08

#Obrigado Slicer, não prestei atenção, no caso irá retornar e não irá healar porque não tem o valor da storage ainda, rsrs.

 

#Maelnise

O correto é o "hp" porque é o parâmetro da função criada.

 

Tente!

function onSay(cid, words, param)

local hpGain = 5
local vocs = {
    [1] = 538,
    [2] = 585,
    [3] = 536,
}
 
if not vocs[getPlayerVocation(cid)] then
    return true
end

if getPlayerStorageValue(cid, 9329) < 1 then
    doCreatureSetNoMove(cid, true)
    setPlayerStorageValue(cid, 9329, 1)
    heal(cid, hpGain)
    doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1)
    
elseif getPlayerStorageValue(cid, 9329) >= 1 then
    doCreatureSetNoMove(cid, false)
    setPlayerStorageValue(cid, 9329, -1)
    doRemoveCondition(cid, CONDITION_OUTFIT)
end
    return true
end

function heal(uid, hp)

if not isPlayer(uid) then
    return true
end

if getPlayerStorageValue(uid, 9329) < 1 then
    return true
end

doCreatureAddHealth(uid, hp)
    return addEvent(heal, 1 * 1500, uid, hp)
end

Editado Agosto 17 por Roksas

HeelNoxH
17 de agosto de 2013 às 11:13

 

Sim e um sistema de sentar

 

 

 

#Obrigado Slicer, não prestei atenção, no caso irá retornar e não irá healar porque não tem o valor da storage ainda, rsrs.

 

#Maelnise

O correto é o "hp" porque é o parâmetro da função criada.

 

Tente!

function onSay(cid, words, param)

local hpGain = 5
local vocs = {
    [1] = 538,
    [2] = 585,
    [3] = 536,
}
 
if not vocs[getPlayerVocation(cid)] then
    return true
end

if getPlayerStorageValue(cid, 9329) < 1 then
    doCreatureSetNoMove(cid, true)
    setPlayerStorageValue(cid, 9329, 1)
    heal(cid, hpGain)
    doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1)
    
elseif getPlayerStorageValue(cid, 9329) >= 1 then
    doCreatureSetNoMove(cid, false)
    setPlayerStorageValue(cid, 9329, -1)
    doRemoveCondition(cid, CONDITION_OUTFIT)
end
    return true
end

function heal(uid, hp)

if not isPlayer(uid) then
    return true
end

if getPlayerStorageValue(uid, 9329) < 1 then
    return true
end

doCreatureAddHealth(uid, hp)
    return addEvent(heal, 1 * 1500, uid, hp)
end

 

Funcionou vlw

RoksasR
17 de agosto de 2013 às 11:17

Tópico movido para a seção de dúvidas e pedidos resolvidos.