guildmotd
function onJoinChannel(cid, channelId, users) if(channelId == CHANNEL_GUILD) then local guildId = getPlayerGuildId(cid) if(guildId ~= LUA_ERROR) then local guildMotd = getGuildMotd(guildId) if(guildMotd ~= "") then addEvent(doPlayerSendChannelMessage, 150, cid, "", "Message of the Day: " .. guildMotd, TALKTYPE_CHANNEL_W, CHANNEL_GUILD) end end end return TRUE end
agora o mail.lua
function onReceiveMail(cid, sender, item, openBox) if(openBox == TRUE) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "New mail has arrived.") end return TRUE end




info
Grupo: Conde
Registrado: 30/11/11
Posts: 696
Reputação: +71
Gênero: Masculino
Char no Tibia: treinador de lobo
Tem dois erros que ocorrem quando eu abro meu ot, quero arruma-los mas nao entendo nada de script, se alguem pode me ajudar
>Loading creaturescripts... [Error - CreatureEvent::configureEvent] No valid type for creature event: joinchannel.
[Warning - BaseEvents::loadFromXml] Cannot configure an event
[Error - CreatureEvent::configureEvent] No valid type for creature event: receivemail.
[Warning - BaseEvents::loadFromXml] Cannot configure an event
Aqui estao os sciprts:
SCRIPT DO RECEIVEMAIL:
function onReceiveMail(cid, sender, item, openBox)
if(openBox) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "New mail has arrived.")
end
return true
end
JOINCHANNEL:
function onJoinChannel(cid, channelId, users)
if(channelId == CHANNEL_GUILD) then
local guildId = getPlayerGuildId(cid)
if(guildId and guildId ~= 0) then
local guildMotd = getGuildMotd(guildId)
if(guildMotd and guildMotd ~= "") then
addEvent(doPlayerSendChannelMessage, 150, cid, "", "Comand for Leaders: /guid - Message of the Day: " .. guildMotd, TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
end
end
end
return true
end
E aqui estao as tags no craturescript.xml:
<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
<event type="receivemail" name="Mail" event="script" value="mail.lua"/>