• 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 5 Bless With 1 Command

kokorec

Tavon Online - Soon
Joined
May 3, 2008
Messages
287
Reaction score
0
Location
Turkey
Hi,
This script for 5 bless with 1 command.it is my scripts(kokorec).
i tried on TFS 0.3+

here is script:
Code:
-<function onSay(cid, words, param)
    if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
        doPlayerSendCancel(cid,'[COLOR="Red"]You have already got one or more blessings![/COLOR]')
    else
        if doPlayerRemoveMoney(cid, [COLOR="Red"]70000[/COLOR]) == TRUE then
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
			doSendMagicEffect(getPlayerPosition(cid), [COLOR="Red"]CONST_ME_HOLYDAMAGE[/COLOR])
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'[COLOR="Red"]You have been blessed by the gods![/COLOR]')
        else
            doPlayerSendCancel(cid, "[COLOR="Red"]You need 70k to get blessed![/COLOR]")
        end
    end    
    return 1
end->

talkactions.xml
Code:
  <talkaction words="!bless" script="bless.lua" />

Note:you can change with red colours words.

Thanks~
 
More advanced but better. :p

Code:
function onSay(cid, words, param)
local fail = 0 -- Do not touch this!
local cost = 10000 -- Price of each bless.

	for i = 1, 5 do
		if getPlayerBlessing(cid, i) then
			fail = fail + 1
		else
			if doPlayerRemoveMoney(cid, cost) == TRUE then
				doPlayerAddBlessing(cid, i)
			else
				doPlayerSendCancel(cid, "You do not have enough money to buy all blessings!')
				break
			end
		end
	end
	if fail == 5 then
		doPlayerSendCancel(cid, "You already got all blessings!')
	end
return TRUE
end
 
Here is my newer version, with magic effect :p
Code:
function onSay(cid, words, param)
local fail = 0
local cost = 10000 -- Price of each bless.

	for i = 1, 5 do
		if getPlayerBlessing(cid, i) then
			fail = fail + 1
		else
			if doPlayerRemoveMoney(cid, cost) == TRUE then
				doPlayerAddBlessing(cid, i)
				if i == 5 and not(fail == 5) then
					doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
				end
			else
				doPlayerSendCancel(cid, "You do not have enough money to buy all blessings!')
				break
			end
		end
	end
	if fail == 5 then
		doPlayerSendCancel(cid, "You already got all blessings!')
	end
return TRUE
end

I hope it wasn't too complicated.... :eek:
 
+sağol kanka güzel oldu bu ;)
-thank brother this is very useful very good job i think :)
 
Last edited:
PHP:
if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
        doPlayerSendCancel(cid,'You have already got one or more blessings!')

hohoho, a long row:p

just do like this,
PHP:
for i = 1, 5 do --and then getPlayerBlessing(cid, i)
 
Hi,
This script for 5 bless with 1 command.it is my scripts(kokorec).
i tried on TFS 0.3+

here is script:
Code:
-<function onSay(cid, words, param)
    if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
        doPlayerSendCancel(cid,'[COLOR="Red"]You have already got one or more blessings![/COLOR]')
    else
        if doPlayerRemoveMoney(cid, [COLOR="Red"]70000[/COLOR]) == TRUE then
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
			doSendMagicEffect(getPlayerPosition(cid), [COLOR="Red"]CONST_ME_HOLYDAMAGE[/COLOR])
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'[COLOR="Red"]You have been blessed by the gods![/COLOR]')
        else
            doPlayerSendCancel(cid, "[COLOR="Red"]You need 70k to get blessed![/COLOR]")
        end
    end    
    return 1
end->

talkactions.xml
Code:
  <talkaction words="!bless" script="bless.lua" />

Note:you can change with red colours words.

Thanks~

Working in RC1.

Thanks for you code :p
 
Here is my newer version, with magic effect :p
Code:
function onSay(cid, words, param)
local fail = 0
local cost = 10000 -- Price of each bless.

	for i = 1, 5 do
		if getPlayerBlessing(cid, i) then
			fail = fail + 1
		else
			if doPlayerRemoveMoney(cid, cost) == TRUE then
				doPlayerAddBlessing(cid, i)
				if i == 5 and not(fail == 5) then
					doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
				end
			else
				doPlayerSendCancel(cid, "You do not have enough money to buy all blessings!')
				break
			end
		end
	end
	if fail == 5 then
		doPlayerSendCancel(cid, "You already got all blessings!')
	end
return TRUE
end

I hope it wasn't too complicated.... :eek:

You have 2 errors in your code. Both of your doPlayerSendCancel start with " and end with ' -- This throws errors. Change the ' to ". I also added into mine so the cost varies based on level (like RL system). I will post it.
 
does somebody have the tfs 0.3.b2 Clean talk action?
and the clean talk action script?


please post here if u got it , much appreciated thank you,

ill repp++! :D
 
Back
Top