Only posting an function to Tibiando.
http://otland.net/f19/tibiando-audio-api-tibia-86952/
You can do it:
or:
http://otland.net/f19/tibiando-audio-api-tibia-86952/
Code:
function getSocket(cid)
if not dj then
error('You have to install tibiando. The tibiando work ONLY in creaturescripts. This function too.')
end
for i,b in pairs(dj.online) do
if b.cid == cid then
return b[1]
end
end
end
You can do it:
Code:
function onKill(cid) --Function on kill
if isPlayer(cid) then -- Check if the killer is a player
local sock = getSocket(cid) --- Get player socket
if sock then --- If player has audio
sock:send('EF=kill.wav\n') --Send the music name to play
end
end
return true -- return true :p
end
or:
Code:
function onLogin(cid)
if getPlayerGroupid(cid) > 5 then
for i,cid in pairs(getOnlinePlayers()) do
local sock = getSocket(cid)
if sock then
sock:send('EF=adm_online.mp3\n')
end
end
end
end