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

Npc's msgcontains function

Tarielle

New Member
Joined
Nov 4, 2007
Messages
214
Reaction score
0
Location
Sweden
Uhm, I heard that the msgcontain function is replaced.. IF it id then what should be used from now on? :'o

Thanks xD
 
Ah empty.. you should more read post and try to understand, not only post post and post ^^

@OnTopic
I'm still using it, so I believe its still working. More info more info ;o
 
Oh, right. Sorry about that.

The msgcontains function hasn't been changed as far as I know, and it still works for me too... What distro are you using?
 
Im using the latest offical release

Here's my whole base code..
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)     npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                         npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)
    if(npcHandler.focus ~= cid) then
        return false
    end
 
 
 
	if msgcontains(msg, 'text') then
	selfSay("text")

 
            end
 
        return true
           end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

And while Im writing I should take the opportunity to ask how do I activate the NPC log window? I mean so they talk at the NPC log instead of the deafault channel..

Thanks in advance:)
 
try

Code:
selfSay('text',cid)

i use this one on my server and works great :p

Also
Code:
npcHandler:selfSay("text",cid)
should work too....

and the
'' or "" really dosen't really mean much you can use "" or ''...
 
Could you look at the base script that I posted above, maybe it's something wrong there.. Like the reply function or something, thanks in advance..

The keywod parameters at the xml doesn't work either..
 
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)     npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                         npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)
	[FONT="Arial Black"]if(not npcHandler:isFocused(cid)) [/FONT]then
		return FALSE
	end
 
 
	if msgcontains(msg, 'text') then
	[FONT="Arial Black"]selfSay("text",cid)[/FONT]

 
            end
 
        return true
           end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())


not tested it but should work
 
Back
Top