• 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 Animated Smiles [Simple]

RunarM

Finally back
Joined
Jul 17, 2008
Messages
1,636
Reaction score
32
Location
Norway/Tromsø
Im not sure if it is released so i made a thread =)
*Tested on Tfs 0.3.4.

[Data -> Talkaction -> Scripts]
Animated_smiles.lua
Lua:
function onSay(cid, words, param, channel)
	local hearts = {":*", ";*", "=*"}

	if (isInArray(hearts, words)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HEARTS)
	end

	doCreatureSay(cid, words, TALKTYPE_ORANGE_1)
	return true
end
Notice, i don't think you dont need the
local hearts = {":*", ";*", "=*"}
script =)
It's just another way to add the text you want to be animated =)


in the Talkaction.xml
Code:
	<talkaction words=";[" script="animated_smiles.lua" log="no"/>
	<talkaction words=";]" script="animated_smiles.lua" log="no"/>
	<talkaction words=":[" script="animated_smiles.lua" log="no"/>

This is how it works:
When you say, for example :[ it comes up animated [Orange Text, easy to edit]


Well hope you like it :wub:
Regards, Runarm.
 
Last edited:
simply:
PHP:
function onSay(cid, words, param, channel)
    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HEARTS)
    doCreatureSay(cid, words, TALKTYPE_ORANGE_1)
    return true
end

not both smiles adding. :D
only in talkactions.xml : )
 
Im using this script on my server, except i removed the annoying hearths =)
btw..
Thanks Azi for improving the script ;)
 
I can't believe that you taken something from donators board, removed few things and released it here. Its impossible that you *imagined* same effect with hearts, and putted it here just creating new variable. Anyway its simply script, but idea was mine.
 
I think thats pretty cool, it reminds me of an old server that had something similar so I remade the script (with help of some other scripts aswell) as an alternative idea for this, but still it is poorly coded and it can be probably done much cleaner, so if anyone wants to clean this go ahead!

I posted here cause the idea is yours, so I dont think its necessary to make another thread but if you want me to get out of here, tell me :)

Talkactions.xml:
PHP:
<talkaction log="no" words="/smiley" filter="word" event="script" value="Smiles.lua"/>

Smiles.lua:
Lua:
function onSay(cid, words, param, channel)
pos = getCreaturePosition(cid)
par = string.explode(param, " ")

local av = {
	s1 = ":)",
	s2 = ":(",
	s3 = ";)",
	s4 = ":D",
	s5 = ":/"
}

    if param == "" then
        doPlayerSendTextMessage(cid, 22, "Please write a smiley after the command.\nExample:\n/smiley :)\n\nTo know all available smileys use /smiley all")
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        return TRUE
    end

	if param == "all" then

        local text = "List of available smileys:\n" .. av.s1 .. "\n" .. av.s2 .. "\n" .. av.s3 .. "\n" .. av.s4 .. "\n" .. av.s5 .. ""	-- Anyone knows if there is a way to make this automatically take everything from the av table?
			doPlayerPopupFYI(cid, text)
			return TRUE
	end

	if param == av.s1 then
	doSendAnimatedText(pos, ':)', 210)
	elseif param == av.s2 then
	doSendAnimatedText(pos, ':(', 5)
	elseif param == av.s3 then
	doSendAnimatedText(pos, ';)', 35)
	elseif param == av.s4 then
	doSendAnimatedText(pos, ':D', 215)
	elseif param == av.s5 then
	doSendAnimatedText(pos, ':/', 156)
	else
		doPlayerSendTextMessage(cid, 22, "This is not an available smiley.\n\nTo know all available smileys use /smiley all")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	end
return TRUE
end

As I said, its just an alternative idea for it, I like it better this way but the code is horrible and not easy for newbies to add more smileys so if any pr0s out there can clean it up and shorten it, please do so! I want to learn about it aswell ^_^

Cheers.
 
Last edited:
You fucking idiot i wrote this script for Paxton, go to hell bitch! He has sold server but not credits to my scripts so go away :D

I can't believe that you taken something from donators board, removed few things and released it here. Its impossible that you *imagined* same effect with hearts, and putted it here just creating new variable. Anyway its simply script, but idea was mine.

I've re-writed yours orginal to 0.3.4 for Paxton's request. Anyway you have 100% right, idea is your! :D
 
Last edited:
Seems alot like Slawkens :p shouldn't release similar scripts on donators board. But if you didn't know and made yourself I suppose its fine
 
Back
Top