Ir para conteúdo

[Talk] Adc E Remover Mana/hp (By Vodkart)


hique86

Posts Recomendados

Estou querendo colocar esse script no meu ot, mas quando fui testar, quando vou adicionar o hp, não importa a quantidade, sempre é adicionado 20000, não sei porque, isso acontece só pra adicionar o hp, para adicionar a mana está porfeitin...

 

Script:

 

--[[ Script by 10% Vodkart and 90% Devilmoon ]]--

--[[ para o Xtibia.com ]]--

 

function onSay(cid, words, param)

 

if(words == "/addmana") then

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

if not t[2] then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")

return

end

local player = getPlayerByName(t[1])

local quanty = t[2]

local pid = getPlayerByNameWildcard(t[1])

mana = getCreatureMana(player)+quanty

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

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")

return TRUE

end

setCreatureMaxMana(player, mana)

doCreatureAddMana(player, getCreatureMaxMana(player))

doPlayerSendTextMessage(player, 19, "Foram adicionados "..quanty.." de mana do seu character agora você tem " .. getCreatureMana(cid) .. "/" .. getCreatureMaxMana(cid) .. " de Mana.")

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você adicionou "..quanty.." de mana ao jogador " .. t[1] .. " ")

 

elseif(words == "/delmana") then

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

if not t[2] then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")

return

end

local player = getPlayerByName(t[1])

local quanty = t[2]

local pid = getPlayerByNameWildcard(t[1])

mana = getCreatureMana(player)-quanty

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

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")

return TRUE

end

setCreatureMaxMana(player, mana)

doCreatureAddMana(player, getCreatureMaxMana(player))

doPlayerSendTextMessage(player, 19, "Foram removidos "..quanty.." de mana do seu character agora você tem " .. getCreatureMana(cid) .. "/" .. getCreatureMaxMana(cid) .. " de Mana.")

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você Removeu "..quanty.." de mana do jogador " .. t[1] .. " ")

 

elseif(words == "/addhp") then

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

if not t[2] then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")

return

end

local player = getPlayerByName(t[1])

local quanty = t[2]

local pid = getPlayerByNameWildcard(t[1])

health = getCreatureMaxHealth(player)+quanty

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

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")

return TRUE

end

setCreatureMaxHealth(player, health)

doCreatureAddHealth(player, getCreatureMaxHealth(player))

doPlayerSendTextMessage(player, 19, "Foram adicionados "..quanty.." de hp do seu character agora você tem " .. getCreatureHealth(cid) .. "/" .. getCreatureMaxHealth(cid) .. " de HP.")

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você adicionou "..quanty.." de health do jogador " .. t[1] .. " ")

 

elseif(words == "/delhp") then

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

if not t[2] then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")

return

end

local player = getPlayerByName(t[1])

local quanty = t[2]

local pid = getPlayerByNameWildcard(t[1])

health = getCreatureHealth(player)-quanty

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

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")

return TRUE

end

setCreatureMaxHealth(player, health)

doCreatureAddHealth(player, getCreatureMaxHealth(player))

doPlayerSendTextMessage(player, 19, "Foram Removidos "..quanty.." de hp do seu character agora você tem " .. getCreatureHealth(cid) .. "/" .. getCreatureMaxHealth(cid) .. " de HP.")

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você Removeu "..quanty.." de health do jogador " .. t[1] .. " ")

end

return TRUE

end

 

 

Ss de quando adiciono o hp:

 

semttulo2fx.png

 

 

Ss de quando adiciono a mana:

 

semttulo2ch.png

 

 

Da uma ajuda ai quem souber, por favor e obrigado!!!

Link para o comentário
Compartilhar em outros sites

Estranho funcionar certinho com mana e bugar com hp... de qualquer forma, tenta isso:

 

--[[ Script by 10% Vodkart and 90% Devilmoon ]]--
--[[ para o Xtibia.com ]]--

function onSay(cid, words, param)
if(words == "/addmana") then
	local t = string.explode(param, ",")
	if not t[2] then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
		return true
	end
	local player = getPlayerByName(t[1])
	local quanty = t[2]
	local pid = getPlayerByNameWildcard(t[1])
	mana = getCreatureMana(player)+quanty
	if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")
		return true
	end
	setCreatureMaxMana(player, mana)
	doCreatureAddMana(player, getCreatureMaxMana(player))
	doPlayerSendTextMessage(player, 19, "Foram adicionados "..quanty.." de mana do seu character agora você tem " .. getCreatureMana(cid) .. "/" .. getCreatureMaxMana(cid) .. " de Mana.")
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você adicionou "..quanty.." de mana ao jogador " .. t[1] .. " ")

elseif(words == "/delmana") then
	local t = string.explode(param, ",")
	if not t[2] then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
		return true
	end
	local player = getPlayerByName(t[1])
	local quanty = t[2]
	local pid = getPlayerByNameWildcard(t[1])
	mana = getCreatureMana(player)-quanty
	if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")
		return true
	end
	setCreatureMaxMana(player, mana)
	doCreatureAddMana(player, getCreatureMaxMana(player))
	doPlayerSendTextMessage(player, 19, "Foram removidos "..quanty.." de mana do seu character agora você tem " .. getCreatureMana(cid) .. "/" .. getCreatureMaxMana(cid) .. " de Mana.")
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você Removeu "..quanty.." de mana do jogador " .. t[1] .. " ")

elseif(words == "/addhp") then
	local t = string.explode(param, ",")
	if not t[2] then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
	return true
	end
	local player = getPlayerByName(t[1])
	local quanty = t[2]
	local pid = getPlayerByNameWildcard(t[1])
	health = getCreatureMaxHealth(player)+quanty
	if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")
	return true
	end
	setCreatureMaxHealth(player, getCreatureMaxHealth(player) + quanty)
	doCreatureAddHealth(player, getCreatureMaxHealth(player))
	doPlayerSendTextMessage(player, 19, "Foram adicionados "..quanty.." de hp do seu character agora você tem " .. getCreatureHealth(cid) .. "/" .. getCreatureMaxHealth(cid) .. " de HP.")
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você adicionou "..quanty.." de health do jogador " .. t[1] .. " ")

elseif(words == "/delhp") then
	local t = string.explode(param, ",")
	if not t[2] then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
	return true
	end
	local player = getPlayerByName(t[1])
	local quanty = t[2]
	local pid = getPlayerByNameWildcard(t[1])
	health = getCreatureHealth(player)-quanty
	if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")
	return true
	end
	setCreatureMaxHealth(player, health)
	doCreatureAddHealth(player, getCreatureMaxHealth(player))
	doPlayerSendTextMessage(player, 19, "Foram Removidos "..quanty.." de hp do seu character agora você tem " .. getCreatureHealth(cid) .. "/" .. getCreatureMaxHealth(cid) .. " de HP.")
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você Removeu "..quanty.." de health do jogador " .. t[1] .. " ")
end
return true
end

Link para o comentário
Compartilhar em outros sites

--[[ Script by 10% Vodkart and 90% Devilmoon ]]--
--[[ para o Xtibia.com ]]--

function onSay(cid, words, param)

if(words == "/addmana") then
local t = string.explode(param, ",")
if not t[2] then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
return
end
local player = getPlayerByName(t[1])
local quanty = t[2]
local pid = getPlayerByNameWildcard(t[1])
mana = getCreatureMana(player)+quanty
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")
return TRUE
end
setCreatureMaxMana(player, mana)
doCreatureAddMana(player, getCreatureMaxMana(player))
doPlayerSendTextMessage(player, 19, "Foram adicionados "..quanty.." de mana do seu character agora você tem " .. getCreatureMana(cid) .. "/" .. getCreatureMaxMana(cid) .. " de Mana.")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você adicionou "..quanty.." de mana ao jogador " .. t[1] .. " ")

elseif(words == "/delmana") then
local t = string.explode(param, ",")
if not t[2] then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
return
end
local player = getPlayerByName(t[1])
local quanty = t[2]
local pid = getPlayerByNameWildcard(t[1])
mana = getCreatureMana(player)-quanty
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")
return TRUE
end
setCreatureMaxMana(player, mana)
doCreatureAddMana(player, getCreatureMaxMana(player))
doPlayerSendTextMessage(player, 19, "Foram removidos "..quanty.." de mana do seu character agora você tem " .. getCreatureMana(cid) .. "/" .. getCreatureMaxMana(cid) .. " de Mana.")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você Removeu "..quanty.." de mana do jogador " .. t[1] .. " ")

elseif(words == "/addhp") then
local t = string.explode(param, ",")
if not t[2] then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
return
end
local player = getPlayerByName(t[1])
local quanty = t[2]
local pid = getPlayerByNameWildcard(t[1])
health = getCreatureHealth(player)+quanty
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")
return TRUE
end
setCreatureMaxHealth(player, health)
doCreatureAddHealth(player, getCreatureMaxHealth(player))
doPlayerSendTextMessage(player, 19, "Foram adicionados "..quanty.." de hp do seu character agora você tem " .. getCreatureHealth(cid) .. "/" .. getCreatureMaxHealth(cid) .. " de HP.")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você adicionou "..quanty.." de health do jogador " .. t[1] .. " ")

elseif(words == "/delhp") then
local t = string.explode(param, ",")
if not t[2] then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
return
end
local player = getPlayerByName(t[1])
local quanty = t[2]
local pid = getPlayerByNameWildcard(t[1])
health = getCreatureHealth(player)-quanty
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")
return TRUE
end
setCreatureMaxHealth(player, health)
doCreatureAddHealth(player, getCreatureMaxHealth(player))
doPlayerSendTextMessage(player, 19, "Foram Removidos "..quanty.." de hp do seu character agora você tem " .. getCreatureHealth(cid) .. "/" .. getCreatureMaxHealth(cid) .. " de HP.")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você Removeu "..quanty.." de health do jogador " .. t[1] .. " ")
end
return TRUE
end

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...