president vankk
Web Developer & AuraOT Owner
- Joined
- Jul 10, 2009
- Messages
- 5,719
- Solutions
- 9
- Reaction score
- 339
Code:
[B]Name[/B]: Auto-Message System
[B]Version[/B]: 8.4
[B]Type of script[/B]: Talkaction
[B]Server Tested[/B]: Was tested in all, create operating
[B]Author[/B]: BEON
Comment: This talkaction allows the player can communicate with those who are around him that he is absent at the time, remembering that you can set the beginning of the script such phrases by the player and the time of self-message.
Installation: Save the following code in the data / talkactions / scripts as automessage.lua
Code:
--- Sistema de Auto-Mensagem, Criado por Beon ---
local FRASES = {"Online Now!","Back","MISSING","AFK ","OFF-LINE! "} -- Auto-Mensagens.
local TEMPO = 30 -- Time interval in seconds.
local function doSendAutoMessage(cid, pos)
if (isCreature(cid) == TRUE) then
npos = getThingPos(cid)
if (pos.x == npos.x) and (pos.y == npos.y) and (pos.z == npos.z) then
doSendAnimatedText(pos, FRASES[math.random(#FRASES)], 215)
doSendMagicEffect(pos, 2)
addEvent(doSendAutoMessage, TEMPO*1000, cid, npos)
end
end
end
function onSay(cid, words, param)
pos = getThingPos(cid)
doSendAnimatedText(pos, FRASES[math.random(#FRASES)], 215)
doSendMagicEffect(pos, 2)
doPlayerSendCancel(cid, "Sytem by Beon")
addEvent(doSendAutoMessage, TEMPO*1000, cid, pos)
return TRUE
end
Then open date / talkactions / talkactions.xml and add this code:
Code:
<talkaction words="/ausente" script="automessage.lua"/>
Usage: When you need to leave the game for a while, say / player will be absent and their self-sending messages alerting the other players.
I hope you enjoy,
Note: This script was done in a quick bug report