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

TalkAction Buy All blessings

Ninkobi

Owner /Founder of Syphera
Joined
Apr 5, 2008
Messages
206
Reaction score
1
Location
England
I made a talkaction on my server to buy all blessings for 60k and with a little help from Rizz I got it working, heres the 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,'You have already got one or more blessings!')
    else
        if doPlayerRemoveMoney(cid, 60000) == 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 6 crystal coin to get blessed!")
        end
    end    
    return 1
end

Give me reptutation if you liked it :thumbup:
 
Last edited:
if doPlayerRemoveItem(cid,2160,6) == 1 then
=
if doPlayerRemoveMoney(cid, 60000) == TRUE then
 
But your script will just remove 6 crystal...

Example: if you have 60000 gp...(many backpack) or 600 platinum coins... The script wont remove the money...

So use...
PHP:
if doPlayerRemoveMoney(cid, 60000) == TRUE then

Instead of...
PHP:
if doPlayerRemoveItem(cid,2160,6) == 1 then

:w00t:
 
But your script will just remove 6 crystal...

Example: if you have 60000 gp...(many backpack) or 600 platinum coins... The script wont remove the money...

So use...
PHP:
if doPlayerRemoveMoney(cid, 60000) == TRUE then

Instead of...
PHP:
if doPlayerRemoveItem(cid,2160,6) == 1 then

:w00t:

oO I understand now, thanks for explaining it
 
Code:
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
=
Code:
for i = 1,5 do
    doPlayerAddBlessing(cid, [i])
end
 
Code:
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
=
Code:
for i = 1,5 do
    doPlayerAddBlessing(cid, [i])
end
maybe...
Code:
for i = 1,5 do
    doPlayerAddBlessing(cid, [COLOR=Red]i[/COLOR])
end
 
I made a talkaction on my server to buy all blessings for 60k and with a little help from Rizz I got it working, heres the 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,'You have already got one or more blessings!')
    else
        if doPlayerRemoveMoney(cid, 60000) == 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 6 crystal coin to get blessed!")
        end
    end    
    return 1
end

Give me reptutation if you liked it :thumbup:

Its not your script.
Piotrek1447 make this script :)
 
I think this would work, try it :)
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,'You have already got one or more blessings!')
    else
        if doPlayerRemoveMoney(cid, 60000) == TRUE then
			if isPremium(cid) == TRUE then
		
				for i = 1,5 do
				doPlayerAddBlessing(cid, i)
				end

				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
				doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
			
			else
			doPlayerSendCancel(cid, "You need a premium account!")
			end
        else
            doPlayerSendCancel(cid, "You need 6 crystal coin to get blessed!")
        end
    end    
    return 1
end
 
Its not your script.
Piotrek1447 make this script :)
No, this is no mine script, mine script is this:
Code:
[COLOR=#007700]-- ![/COLOR][COLOR=#0000BB]buyBless by Piotrek1447 (Razer)

local bless [/COLOR][COLOR=#007700]= {[/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]2[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]3[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]4[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]5[/COLOR][COLOR=#007700]} -- [/COLOR][COLOR=#0000BB]Don't touch this.[/COLOR][COLOR=#007700]
[/COLOR][COLOR=#0000BB]local cost [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1 [/COLOR][COLOR=#007700]-- [/COLOR][COLOR=#0000BB]Price in gp.[/COLOR][COLOR=#007700]

function [/COLOR][COLOR=#0000BB]onSay[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]words[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]param[/COLOR][COLOR=#007700])
    for [/COLOR][COLOR=#0000BB]i [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]table[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]maxn[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]bless[/COLOR][COLOR=#007700]) do
        if([/COLOR][COLOR=#0000BB]getPlayerBlessing[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]bless[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]i[/COLOR][COLOR=#007700]])) [/COLOR][COLOR=#0000BB]then
            doPlayerSendCancel[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#DD0000]"You have already all blessings."[/COLOR][COLOR=#007700])
            return
        [/COLOR][COLOR=#0000BB]end
    end
    
    [/COLOR][COLOR=#007700]if([/COLOR][COLOR=#0000BB]doPlayerRemoveMoney[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]cena[/COLOR][COLOR=#007700]) == [/COLOR][COLOR=#0000BB]TRUE[/COLOR][COLOR=#007700]) [/COLOR][COLOR=#0000BB]then
        [/COLOR][COLOR=#007700]for [/COLOR][COLOR=#0000BB]i [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]table[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]maxn[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]bless[/COLOR][COLOR=#007700]) do
            [/COLOR][COLOR=#0000BB]doPlayerAddBlessing[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]bless[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]i[/COLOR][COLOR=#007700]])
        [/COLOR][COLOR=#0000BB]end
        doPlayerSendCancel[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#DD0000]"You bought all blessing."[/COLOR][COLOR=#007700])
    else
        [/COLOR][COLOR=#0000BB]doPlayerSendCancel[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#DD0000]"You don\'t have enough money."[/COLOR][COLOR=#007700])
    [/COLOR][COLOR=#0000BB]end
end

Yours,
Piotrek1447
[/COLOR]
 
No, this is no mine script, mine script is this:
Code:
[COLOR=#007700]-- ![/COLOR][COLOR=#0000bb]buyBless by Piotrek1447 (Razer)

local bless [/COLOR][COLOR=#007700]= {[/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]2[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]3[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]4[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]5[/COLOR][COLOR=#007700]} -- [/COLOR][COLOR=#0000bb]Don't touch this.[/COLOR][COLOR=#007700]
[/COLOR][COLOR=#0000bb]local cost [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1 [/COLOR][COLOR=#007700]-- [/COLOR][COLOR=#0000bb]Price in gp.[/COLOR][COLOR=#007700]

function [/COLOR][COLOR=#0000bb]onSay[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]words[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]param[/COLOR][COLOR=#007700])
    for [/COLOR][COLOR=#0000bb]i [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]table[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]maxn[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]bless[/COLOR][COLOR=#007700]) do
        if([/COLOR][COLOR=#0000bb]getPlayerBlessing[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]bless[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]i[/COLOR][COLOR=#007700]])) [/COLOR][COLOR=#0000bb]then
            doPlayerSendCancel[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]"You have already all blessings."[/COLOR][COLOR=#007700])
            return
        [/COLOR][COLOR=#0000bb]end
    end
    
    [/COLOR][COLOR=#007700]if([/COLOR][COLOR=#0000bb]doPlayerRemoveMoney[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]cena[/COLOR][COLOR=#007700]) == [/COLOR][COLOR=#0000bb]TRUE[/COLOR][COLOR=#007700]) [/COLOR][COLOR=#0000bb]then
        [/COLOR][COLOR=#007700]for [/COLOR][COLOR=#0000bb]i [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]table[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]maxn[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]bless[/COLOR][COLOR=#007700]) do
            [/COLOR][COLOR=#0000bb]doPlayerAddBlessing[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]bless[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]i[/COLOR][COLOR=#007700]])
        [/COLOR][COLOR=#0000bb]end
        doPlayerSendCancel[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]"You bought all blessing."[/COLOR][COLOR=#007700])
    else
        [/COLOR][COLOR=#0000bb]doPlayerSendCancel[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]"You don\'t have enough money."[/COLOR][COLOR=#007700])
    [/COLOR][COLOR=#0000bb]end
end[/COLOR]


Yours,
Piotrek1447
Wow...
if(doPlayerRemoveMoney(cid, cena) == TRUE) then
WTF is "cena"? ;O
maybe .. cost?

Nice script...
 
Yes yes, i forget to update this, because i edit this script for international members. :D<font color="#0000bb">

PHP:
-- !buyBless by Piotrek1447 (Razer)

local bless = {1, 2, 3, 4, 5} -- Don't touch this.
local cost = 1 -- Price in gp.

function onSay(cid, words, param)
    for i = 1, table.maxn(bless) do
        if(getPlayerBlessing(cid, bless[i])) then
            doPlayerSendCancel(cid, "You have already all blessings.")
            return
        end
    end
    
    if(doPlayerRemoveMoney(cid, cost) == TRUE) then
        for i = 1, table.maxn(bless) do
            doPlayerAddBlessing(cid, bless[i])
        end
        doPlayerSendCancel(cid, "You bought all blessing.")
    else
        doPlayerSendCancel(cid, "You don\'t have enough money.")
    end
end
 
Last edited:
I think this would work, try it :)
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,'You have already got one or more blessings!')
    else
        if doPlayerRemoveMoney(cid, 60000) == TRUE then
			if isPremium(cid) == TRUE then
		
				for i = 1,5 do
				doPlayerAddBlessing(cid, i)
				end

				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
				doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
			
			else
			doPlayerSendCancel(cid, "You need a premium account!")
			end
        else
            doPlayerSendCancel(cid, "You need 6 crystal coin to get blessed!")
        end
    end    
    return 1
end

If I use this script, what is the command in-game?
 
Back
Top