Hugofasima
Website: thenosegang.servegame.com
- Joined
- Jun 24, 2015
- Messages
- 206
- Reaction score
- 23
The following script is for TFS 1.0, and my TFS is 1.1. I can't see what is wrong with the script, heeelp :/
Problems:
-Distro error
- I can't send broadcast msgs with GOD account (debug error)
This error show up:
events.lua
Thanks OT Land!
Problems:
-Distro error
- I can't send broadcast msgs with GOD account (debug error)
This error show up:
Code:
Lua Script Error: [Chat Interface]
data/chatchannels/scripts/events.lua:onJoin
LuaScriptInterface::luaAddEvent(). Argument #3 is unsafe
stack traceback:
[C]: in function 'addEvent'
data/chatchannels/scripts/events.lua:10: in function <data/chatchannels/
scripts/events.lua:9>
events.lua
Code:
local muted = createConditionObject(CONDITION_CHANNELMUTEDTICKS)
setConditionParam(muted, CONDITION_PARAM_SUBID, 32)
setConditionParam(muted, CONDITION_PARAM_TICKS, 1000)
function send_d_motd(cid)
return Creature(cid):sendChannelMessage("", "[Channel]: Welcome to the event channel. Here you may talk about in-game events and receive news about their status.", TALKTYPE_CHANNEL_O, 32)
end
function onJoin(cid)
addEvent(send_d_motd, 100, cid)
return true
end
function onSpeak(cid, type, message)
if getCreatureCondition(cid, CONDITION_CHANNELMUTEDTICKS, 32) then
Creature(cid):sendChannelMessage("", "Please do not spam.", TALKTYPE_CHANNEL_O, 32)
return false
end
doAddCondition(cid, muted)
if getPlayerAccountType(cid) > 2 then
if getPlayerGroupId(cid) > 2 then
local groupnames = {[2] = "Mod", [3] = "Admin"}
sendChannelMessage(32, TALKTYPE_CHANNEL_R1, getCreatureName(cid) .. " [" .. (groupnames[getPlayerGroupId(cid)] or "GM") .. "]: ".. message)
return false
end
end
return TALKTYPE_CHANNEL_Y
end
Thanks OT Land!
Last edited: