• 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!

Broadcast when killed on Latest TFS alpha 4 - Spells animation color

mamon_2

Banned User
Joined
Jul 2, 2007
Messages
424
Reaction score
0
Like topic name says, if anyone knows how to do a broadcast when killed and make spells to be told like a animation when monsters talks, in orange, so they doesnt disturb at default channel.

Anyone?
 
Goto data/creaturescripts/scripts/playerdeath.lua, under doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You are dead.") put doBroadcastMessage(message, type) (of course change the message and type to what you want).

I think the second thing would have to be done in the source, not sure though.

Jo3
 
Spells animation color will be in beta, 4 days to go.


Broadcast when killed :

data\creaturescripts\scripts\kill.lua :

function onKill(cid, target)
if isPlayer(cid) == 1 and isPlayer(target) == 1 then
doBroadcastMessage(getCreatureName(target).." was killed by "..getCreatureName(cid).." at level " ..getPlayerLevel(target).., MESSAGE_STATUS_WARNING)
end

data\creaturescripts\scripts\login.lua, add line
registerCreatureEvent(cid, "PlayerDeath")
after
function onLogin(cid)
, it must be like:
function onLogin(cid)
registerCreatureEvent(cid, "kill")
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "FirstItems")
return TRUE
end

and in \data\creaturescripts\creaturescripts.xml, add line:
<event type="kill" name="kill" script="kill.lua" />
 
Damn, I dont know why, but it still doesnt working... And deathlist isnt working too :S
It requires a phpmyadmin version or something like that?
 
Damn, I dont know why, but it still doesnt working... And deathlist isnt working too :S
It requires a phpmyadmin version or something like that?

What I told you works for me, are you using xampp? If so, make sure you have the newest version of PHPMyAdmin. As I'm not a big fan of xampp, I use the newest version of just MySQL (which I believe is 5.0) and SQLyog to control the database. If you do have the newest version of PHPMyAdmin, post here again and hopefully someone can help you.

Jo3
 
Hmm.... gonna check it... btw

PHP:
[26/11/2008 15:24:20] Warning: [Event::loadScript] Can not load script. data/creaturescripts/scripts/kill.lua
[26/11/2008 15:24:20] data/creaturescripts/scripts/kill.lua:3: unexpected symbol near ','
 
Hmm.... gonna check it... btw

PHP:
[26/11/2008 15:24:20] Warning: [Event::loadScript] Can not load script. data/creaturescripts/scripts/kill.lua
[26/11/2008 15:24:20] data/creaturescripts/scripts/kill.lua:3: unexpected symbol near ','
In the broadcast message at:
Code:
getPlayerLevel(target)[B]..[/B]
Remove those two periods.

Jo3
 
o.0, my mistake, wasdrunked..or wtf :<
here it is, kill.lua:

function onKill(cid, target)
if isPlayer(cid) == 1 and isPlayer(target) == 1 then
doBroadcastMessage(""..getCreatureName(target).." was killed by "..getCreatureName(cid).." at level " ..getPlayerLevel(target).."", MESSAGE_STATUS_WARNING)
end
end
 
o.0, my mistake, wasdrunked..or wtf :<
here it is, kill.lua:

Why make a whole new file when you can just add
Code:
doBroadcastMessage(getCreatureName(cid).." was killed by "..getCreatureName(killer).." at level "..getPlayerLevel(cid), MESSAGE_STATUS_WARNING)
before doPlayerSendTextMessage in the onDeath function in playerdeath.lua?

Jo3
 
true ;>
doBroadcastMessage(""..getCreatureName(target).." was killed by "..getCreatureName(cid).." at level " ..getPlayerLevel(target).."", MESSAGE_STATUS_WARNING)
in playerdeath.lua, will be more better ;D
 
ahh, yea :> anyway, it works with onKill ;]
with onDeath must be:

doBroadcastMessage(""..getCreatureName(cid).." was killed by "..getCreatureName(killer).." at level " ..getPlayerLevel(cid).."", MESSAGE_STATUS_WARNING)
 
Back
Top