• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Fixxed /makesay for TFS 0.3.5 PL1

Cazar

Ph0t0sh0p abus3r
Joined
Mar 9, 2009
Messages
407
Reaction score
1
Location
Cologne
Hey there,
i just fixxed the script for TFS 0.3.5 PL1

Tested and it works!
So don't tell me that it would't work!

Let's start!

talkactions > talkactions.xml

Code:
<talkaction access="5" words="/makesay" event="script" value="makesay.lua"/>

and then

talkactions > scripts

create a new file called "makesay.lua"
and add this

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
      doCreatureSay(pname, text, TALKTYPE_SAY)
    else
      doPlayerSendCancel(cid, "Failed. Please try again.")
    end
    return TRUE

end

Then you just have to type inGame!

Code:
/makesay Player,Text



Credits

SamDaMan 65%(**fans.net)
SantyCool 25& (**fans.net)
Cazar 10% /For fixing the Script)


Feel free to add a rep++ :D

//Cazar
 
If player no login or doesn't exist then my TFS trows error:
Code:
[27/08/2009 19:02:59] Lua Script Error: [TalkAction Interface] 
[27/08/2009 19:02:59] data/talkactions/scripts/makesay.lua:onSay

[27/08/2009 19:02:59] luaDoCreatureSay(). Creature not found
:( fix plx it
 
If player no login or doesn't exist then my TFS trows error:
Code:
[27/08/2009 19:02:59] Lua Script Error: [TalkAction Interface] 
[27/08/2009 19:02:59] data/talkactions/scripts/makesay.lua:onSay

[27/08/2009 19:02:59] luaDoCreatureSay(). Creature not found
:( fix plx it

Whut TFS version do ya use?

Cuz i fixxed the script for 0.3.5 PL1

//Cazar
 
My edition:
Code:
local speakClasses = {
	["normal"] = TALKTYPE_SAY,
	["whisper"] = TALKTYPE_WHISPER,
	["yell"] = TALKTYPE_YELL,
	["monster"] = TALKTYPE_ORANGE_1
}

function onSay(cid, words, param, channel)
	local masterExploder = string.explode(param, ",")
	local player = getPlayerByName(masterExploder[1])
	local text = masterExploder[2]
	local type = speakClasses[masterExploder[3]]

	if (not player) then
		doPayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.")
		return true
	end

	if (not text) then
		text = "Example"
	end

	if (not type) then
		type = TALKTYPE_SAY
	end

	doCreatureSay(player, text, type)
	return true
end
:x
 
I'm have TFS 0.3.5pl1 :)
@edit
Script by Chojrak is good but i got the same error ):
 
Last edited:
If I use the command /makesay PLAYERNAME,TEXT is good but if player not found or
does not exist, it throws an error:
Code:
[30/08/2009 10:20:40] data/talkactions/scripts/makesay.lua:15: attempt to call global 'doPayerSendTextMessage' (a nil value)
[30/08/2009 10:20:40] stack traceback:
[30/08/2009 10:20:40] 	data/talkactions/scripts/makesay.lua:15: in function <data/talkactions/scripts/makesay.lua:8>
. If /makesay "PLAYERNAME,TEXT it throws an error
Code:
[30/08/2009 10:27:44] data/talkactions/scripts/makesay.lua:15: attempt to call global 'doPayerSendTextMessage' (a nil value)
[30/08/2009 10:27:44] stack traceback:
[30/08/2009 10:27:44] 	data/talkactions/scripts/makesay.lua:15: in function <data/talkactions/scripts/makesay.lua:8>
. :(
 
If I use the command /makesay PLAYERNAME,TEXT is good but if player not found or
does not exist, it throws an error:
Code:
[30/08/2009 10:20:40] data/talkactions/scripts/makesay.lua:15: attempt to call global 'doPayerSendTextMessage' (a nil value)
[30/08/2009 10:20:40] stack traceback:
[30/08/2009 10:20:40] 	data/talkactions/scripts/makesay.lua:15: in function <data/talkactions/scripts/makesay.lua:8>
. If /makesay "PLAYERNAME,TEXT it throws an error
Code:
[30/08/2009 10:27:44] data/talkactions/scripts/makesay.lua:15: attempt to call global 'doPayerSendTextMessage' (a nil value)
[30/08/2009 10:27:44] stack traceback:
[30/08/2009 10:27:44] 	data/talkactions/scripts/makesay.lua:15: in function <data/talkactions/scripts/makesay.lua:8>
. :(


HAHA Chojrak, i found your Bug in the Script ;D

Just try this one:

Lua:
cal speakClasses = {
	["normal"] = TALKTYPE_SAY,
	["whisper"] = TALKTYPE_WHISPER,
	["yell"] = TALKTYPE_YELL,
	["monster"] = TALKTYPE_ORANGE_1
}

function onSay(cid, words, param, channel)
	local masterExploder = string.explode(param, ",")
	local player = getPlayerByName(masterExploder[1])
	local text = masterExploder[2]
	local type = speakClasses[masterExploder[3]]

	if (not player) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.")
		return true
	end

	if (not text) then
		text = "Example"
	end

	if (not type) then
		type = TALKTYPE_SAY
	end

	doCreatureSay(player, text, type)
	return true
end

//Cazar
 
i dont like this lol, why dont you make it for the sources? then you can make it for lower versions if your good to, i want this for my server ;] but i use my moded 0.2 :p

-- Necronia.mine.nu
 
I haven't never tested, just wrote it in "Quick Reply Box".
 
Back
Top