• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Cd Bar error :( Rep

zippy

Member
Joined
Feb 1, 2011
Messages
233
Reaction score
8
Hi

Im trying to fix that cd bar will not display error but i fail :/

Its working good when you dont got the error ball, but when you got the error ball the text come out but i get console error :/

LUA:
[06/07/2012 19:38:54] [Error - TalkAction Interface] 
[06/07/2012 19:38:54] data/talkactions/scripts/cdbar.lua:onSay
[06/07/2012 19:38:54] Description: 
[06/07/2012 19:38:54] data/lib/cooldown bar.lua:39: attempt to perform arithmetic on a nil value
[06/07/2012 19:38:54] stack traceback:
[06/07/2012 19:38:54] 	data/lib/cooldown bar.lua:39: in function 'doUpdatePokemonsBar'
[06/07/2012 19:38:54] 	data/talkactions/scripts/cdbar.lua:17: in function <data/talkactions/scripts/cdbar.lua:3>

LUA:
function onSay(cid, words, param)
if words == "/pokeread" then 
if getArticle(pokename) == "error" then
doPlayerSendTextMessage(cid, 26, "One of your pokes are bugged, the cdbar couldnt update.")
elseif not getArticle(name2) == "error" then
		if #getCreatureSummons(cid) >= 1 then
			local pokemon = getCreatureSummons(cid)[1]
			local pokelife = (getCreatureHealth(pokemon) / getCreatureMaxHealth(pokemon))
			doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "hp", pokelife)
		end
		end
		doUpdatePokemonsBar(cid)
	end
return 0
end

Rep will be given!
 
Here you go:


LUA:
function doUpdatePokemonsBar(cid)
	local ret = "p#,"
	local balls = getPlayerPokeballs(cid)
	local times = 0
	for a = 1, #balls do
		times = times + 1
		local item = balls[a]
		local hp = math.ceil(getItemAttribute(item.uid, "hp") * 100)
		local name = getItemAttribute(item.uid, "poke")
		local foto = fotos[name] - 928
		doItemSetAttribute(item.uid, "ballorder", times)
		ret = ret..""..foto..","..name..""..times..","..hp..","
	end
doPlayerSendCancel(cid, ret)
end
 
Back
Top