rudger
Active Member
Hello,
My broadcast message doesn't work properly. This is the in-game output:
17:52 -1 was killed at level -1 by Sanchez. (unjustified)
it should be:
17:52 Tekof was killed at level 87 by Sanchez. (unjustified)
code:
error:
My broadcast message doesn't work properly. This is the in-game output:
17:52 -1 was killed at level -1 by Sanchez. (unjustified)
it should be:
17:52 Tekof was killed at level 87 by Sanchez. (unjustified)
code:
Code:
local function broadcast_player_death(cid, target, lastHit, unjustified)
broadcastMessage(getCreatureName(target) .. " was killed at level " .. getPlayerLevel(target) .. " by " ..
getCreatureName(cid) .. ". (unjustified)")
end
function onKill(cid, target, lastHit, unjustified)
if (isPlayer(cid) and isPlayer(target) and unjustified) then
addEvent(broadcast_player_death, 10000, cid)
end
return 1
end
error:
Code:
Lua Script Error: [CreatureScript Interface]
in a timer event called from:
data/creaturescripts/scripts/kill.lua:onKill
luaGetCreatureName(). Creature not found
Lua Script Error: [CreatureScript Interface]
in a timer event called from:
data/creaturescripts/scripts/kill.lua:onKill
internalGetPlayerInfo(). Player not found. info = 2