• 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 AOL and Bless

Seq

Banned User
Joined
May 6, 2009
Messages
87
Reaction score
0
Location
Poland
I'll show you hot to make comands on AOL and bless.

AOL!
1. Open /your-ots-directory/data/talkactions/scripts/

create aol.lua

and paste that:

Lua:
local cost = 50000 -- How much does it cost?
local item = 2173 -- What item do you get?
local quantity = 1 -- How many do you get?
 
function onSay(cid, words, param)
    if doPlayerRemoveMoney(cid, cost) == 1 then
        doPlayerAddItem(cid, item, quantity)
    else
        doPlayerSendCancel(cid, "You have not enough gold.")
    end
    return 1
end

2. Open /your-ots-directory/data/talkactions
edit talkactions.php
and paste there that :
Lua:
	<talkaction words="!aol" script="aol.lua" />

Bless!
1. Open /your-ots-directory/data/talkactions/scripts/

create bless.lua

and paste that:

Lua:
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,'You have already got one or more blessings!')
    else
        if doPlayerRemoveMoney(cid, 50000) == TRUE then
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
        else
            doPlayerSendCancel(cid, "You need 50k to get blessed!")
        end
    end    
    return 1
end

2. Open /your-ots-directory/data/talkactions
edit talkactions.php
and paste there that:
Lua:
	<talkaction words="!bless" script="bless.lua" />


Now you can use !aol to buy aol, and !bless to buy bless!
 
Last edited:
It wont work as it should. Now returns are returning booleans (that mean only "TRUE" or "FALSE") not integers.
Lua:
function onSay(cid, words, param)
local cost = 50000
local item = 2173
local quantity = 1
	if doPlayerRemoveMoney(cid, cost) == TRUE then
		doPlayerAddItem(cid, item, quantity)
	else
		doPlayerSendCancel(cid, "You have not enough gold.")
	end
return TRUE
end
Lua:
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,'You have already got one or more blessings!')
	else
		if doPlayerRemoveMoney(cid, 50000) == TRUE then
			doPlayerAddBlessing(cid, 1)
			doPlayerAddBlessing(cid, 2)
			doPlayerAddBlessing(cid, 3)
			doPlayerAddBlessing(cid, 4)
			doPlayerAddBlessing(cid, 5)
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
			doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE, 'You have been blessed by the gods!')
		else
			doPlayerSendCancel(cid, "You need 50k to get blessed!")
		end
	end
return TRUE
end
:D
 
It wont work as it should. Now returns are returning booleans (that mean only "TRUE" or "FALSE") not integers.
Lua:
function onSay(cid, words, param)
local cost = 50000
local item = 2173
local quantity = 1
	if doPlayerRemoveMoney(cid, cost) == TRUE then
		doPlayerAddItem(cid, item, quantity)
	else
		doPlayerSendCancel(cid, "You have not enough gold.")
	end
return TRUE
end
Lua:
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,'You have already got one or more blessings!')
	else
		if doPlayerRemoveMoney(cid, 50000) == TRUE then
			doPlayerAddBlessing(cid, 1)
			doPlayerAddBlessing(cid, 2)
			doPlayerAddBlessing(cid, 3)
			doPlayerAddBlessing(cid, 4)
			doPlayerAddBlessing(cid, 5)
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
			doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE, 'You have been blessed by the gods!')
		else
			doPlayerSendCancel(cid, "You need 50k to get blessed!")
		end
	end
return TRUE
end
:D

You're work's perfectly, thank you. and thank you to the guy who made the thread aswell i guess.
 
Back
Top