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

/makesay dont work help!

TKO

Syphero Owner!
Joined
Mar 10, 2008
Messages
2,252
Reaction score
27
Location
Sweden
hey my script /makesay dosent work i need help to fix this error.
This command do like /makesay admin tko, im gay
Then my char say that with out me writing im gay!
error:
Code:
[08/12/2009 11:25:53] [Error - TalkAction Interface] 
[08/12/2009 11:25:53] data/talkactions/scripts/makesay.lua:onSay
[08/12/2009 11:25:53] Description: 
[08/12/2009 11:25:54] (luaDoCreatureSay) Creature not found

script:
Code:
  function onSay(cid, words, param)
   
    local param2 = string.explode(param, ",")
    if(param2[1] ~= nil) then
      local pname = getPlayerByNameWildcard(param2[1])
      if(param2[2] ~= nil) then
        text = param2[2]
      end
      doCreatureSay(pname, text, TALKTYPE_SAY)
    else
      doPlayerSendCancel(cid, "Failed. Please try again.")
    end
    return TRUE

end
 
idk
luaDoCreatureSay is the bug;



LUA:
  function onSay(cid, words, param)
    local param2 = string.explode(param, ",")
    	    if(param2[1] ~= nil) then
         local pname = getPlayerByNameWildcard(param2[1])
      	if(param2[2] ~= nil) then
        text = param2[2]
      end
    	  doPlayerSay(pname, text, TALKTYPE_SAY)
   	 else
   	   doPlayerSendCancel(cid, "Failed. Please try again.")
   	 end
    return TRUE

end
 
rachaw you cant fix it you coulnt fix spells so i dont think you can fix this... but i test and send feedback!
 
Try this:
Code:
function onSay(cid, words, param)
	if(param = '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end
	local t = string.explode(param, ',')
	local pid = getPlayerByNameWildcard(t[1])
	if(not pid) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.")
		return true
	end
	local text = tostring(t[2])
	if(not t[2]) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Second param required.')
		return true
	end
	doPlayerSay(pid, text, TALKTYPE_SAY)
	return true
end
 
Try this:
Code:
function onSay(cid, words, param)
	if(param = '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end
	local t = string.explode(param, ',')
	local pid = getPlayerByNameWildcard(t[1])
	if(not pid) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.")
		return true
	end
	local text = tostring(t[2])
	if(not t[2]) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Second param required.')
		return true
	end
	doPlayerSay(pid, text, TALKTYPE_SAY)
	return true
end

nope dont work i get this error:
Code:
[09/12/2009 06:35:31] [Error - TalkAction Interface] 
[09/12/2009 06:35:31] data/talkactions/scripts/makesay.lua:onSay
[09/12/2009 06:35:31] Description: 
[09/12/2009 06:35:31] (luaDoCreatureSay) Creature not found
 
nope dont work i get this error:
Code:
[09/12/2009 06:35:31] [Error - TalkAction Interface] 
[09/12/2009 06:35:31] data/talkactions/scripts/makesay.lua:onSay
[09/12/2009 06:35:31] Description: 
[09/12/2009 06:35:31] (luaDoCreatureSay) Creature not found

look at my script -.-

LUA:
function onSay(cid, words, param)
    local param2 = string.explode(param, ",")
            if(param2[1] ~= nil) then
         local pname = getPlayerByNameWildcard(param2[1])
        if(param2[2] ~= nil) then
        text = param2[2]
      end
          doPlayerSay(pname, text, TALKTYPE_SAY)
         else
           doPlayerSendCancel(cid, "Failed. Please try again.")
         end
    return TRUE

end

Code:
[B]          doPlayerSay(pname, text, TALKTYPE_SAY[/B]
:$

Code:
[09/12/2009 06:35:31] (luaDoCreatureSay) Creature not found

was ure bug i delted doCreatureSay (cid,)
to doPlayerSay (cid,)
 
look at my script -.-

LUA:
function onSay(cid, words, param)
    local param2 = string.explode(param, ",")
            if(param2[1] ~= nil) then
         local pname = getPlayerByNameWildcard(param2[1])
        if(param2[2] ~= nil) then
        text = param2[2]
      end
          doPlayerSay(pname, text, TALKTYPE_SAY)
         else
           doPlayerSendCancel(cid, "Failed. Please try again.")
         end
    return TRUE

end

Code:
[B]          doPlayerSay(pname, text, TALKTYPE_SAY[/B]
:$

Code:
[09/12/2009 06:35:31] (luaDoCreatureSay) Creature not found

was ure bug i delted doCreatureSay (cid,)
to doPlayerSay (cid,)
dosent work i get error

[09/12/2009 09:03:45] [Error - TalkAction Interface]
[09/12/2009 09:03:45] data/talkactions/scripts/makesay.lua:onSay
[09/12/2009 09:03:45] Description:
[09/12/2009 09:03:45] (luaDoCreatureSay) Creature not found
 
Here is the fixed version:

•¤•Fixes:
•¤•If no text is defined the player says "Hi!"
•¤•You can now write "!say Rhu~" or "!say Rhu" the script would automatically find me ("Rhux"), so you don't need the "~".
•¤•Shows a message if the talkaction is formatted wrong.
•¤•Shows if the player could not be found.
LUA:
  function onSay(cid, words, param)
	if string.explode(param, ",") then
		local param2 = string.explode(param, ",")
		if(getPlayerByNameWildcard(param2[1]) ~= nil or getPlayerByNameWildcard(param2[1].."~")) then
			local pname = getPlayerByNameWildcard(param2[1])
			local text = "Hi!"
			if pname == nil then
				pname = getPlayerByNameWildcard(param2[1].."~")
			end
			if(param2[2] ~= nil) then
				text = param2[2]
			end
			doCreatureSay(pname, text, TALKTYPE_SAY)
		else
			doPlayerSendCancel(cid, "This player was not found.")
		end
		return TRUE
	else
	    doPlayerSendCancel(cid, "This talkaction need a param.")
		return TRUE
	end
end

•¤•Rep+ me please.
 
Last edited:
Here is the fixed version:

•¤•Fixes:
•¤•If no text is defined the player says "Hi!"
•¤•You can now write "!say Rhu~" or "!say Rhu" the script would automatically find me ("Rhux"), so you don't need the "~".
•¤•Shows a message if the talkaction is formatted wrong.
•¤•Shows if the player could not be found.
LUA:
  function onSay(cid, words, param)
	if string.explode(param, ",") then
		local param2 = string.explode(param, ",")
		if(getPlayerByNameWildcard(param2[1]) ~= nil or getPlayerByNameWildcard(param2[1].."~")) then
			local pname = getPlayerByNameWildcard(param2[1])
			local text = "Hi!"
			if pname == nil then
				pname = getPlayerByNameWildcard(param2[1].."~")
			end
			if(param2[2] ~= nil) then
				text = param2[2]
			end
			doCreatureSay(pname, text, TALKTYPE_SAY)
		else
			doPlayerSendCancel(cid, "This player was not found.")
		end
		return TRUE
	else
	    doPlayerSendCancel(cid, "This talkaction need a param.")
		return TRUE
	end
end

•¤•Rep+ me please.

same error:
Code:
[09/12/2009 11:04:38] [Error - TalkAction Interface] 
[09/12/2009 11:04:38] data/talkactions/scripts/makesay.lua:onSay
[09/12/2009 11:04:38] Description: 
[09/12/2009 11:04:38] (luaDoCreatureSay) Creature not found
i use /makesay admin TKO, im gay.
it dosent work...
 
Well which server version do you use?
It works fine for me..

Code:
/makesay Rhu~,Hello
/makesay Rhux,Hello
/makesay Rhu,Hello
/makesay R~,Hello
/makesay R,Hello
/makesay Rhux~,Hello

Everyone of these works for me, if I am the only player online.
 
Yes it works.
Credits Rhux.

Code:
function onSay(cid, words, param)
    if string.explode(param, ",") then
        local param2 = string.explode(param, ",")
        if(getPlayerByNameWildcard(param2[1]) ~= nil or getPlayerByNameWildcard(param2[1].."~")) then
            local player = getPlayerByNameWildcard(param2[1])
            local text = "Hi!"
            if (player == nil) then
                player = getPlayerByNameWildcard(param2[1].."~")
            end
            if(param2[2] ~= nil) then
		text = param2[2]
            end
            doCreatureSay(player, text, TALKTYPE_SAY)
        else
            doPlayerSendCancel(cid, "This player is not online.")
	end
    else
        doPlayerSendCancel(cid, "Command requires param.")
    end
    return true
end
 
Yes I know it is working, but why you posted my script again? So you get the reputations?

LUA:
  function onSay(cid, words, param)
        if string.explode(param, ",") then
                local param2 = string.explode(param, ",")
                if(getPlayerByNameWildcard(param2[1]) ~= nil or getPlayerByNameWildcard(param2[1].."~")) then
                        local pname = getPlayerByNameWildcard(param2[1])
                        local text = "Hi!"
                        if pname == nil then
                                pname = getPlayerByNameWildcard(param2[1].."~")
                        end
                        if(param2[2] ~= nil) then
                                text = param2[2]
                        end
                        doCreatureSay(pname, text, TALKTYPE_SAY)
                else
                        doPlayerSendCancel(cid, "This player was not found.")
                end
                return TRUE
        else
            doPlayerSendCancel(cid, "This talkaction need a param.")
                return TRUE
        end
end
 
here is my script for /makesay for the same version hope it helps ya
Code:
*  function onSay(cid, words, param)
   
    local param2 = string.explode(param, ",")
    if(param2[1] ~= nil) then
      local pname = getPlayerByNameWildcard(param2[1])
      if(param2[2] ~= nil) then
        text = param2[2]
      end
      doCreatureSay(pname, text, TALKTYPE_SAY)
    else
      doPlayerSendCancel(cid, "Failed. Please try again.")
    end
    return TRUE

end
rep me ;)
 
Back
Top