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

!bless command (OTHire)

Vantoria

www.ClassicOT.us
Joined
Jun 6, 2014
Messages
186
Reaction score
16
Location
USA
hello people, i have one little problem with this command i want it to be used only by premium accounts ive tried to add this
Code:
if isPremium(cid) then
somewhere around line 19-20 in the script but i dont get it work this is my bless script
Code:
local bless = {1, 2, 3, 4, 5}
local cost = 50000 -- Cost in gp.
local maxlevel = 1000
function onSay(cid, words, param)
local lvl = getPlayerLevel(cid)
local new_cost = (lvl * cost) / 500
local target = getPlayerGUID(cid)
for i = 1, table.maxn(bless) do
if(getPlayerBless(cid, bless[i])) then
doPlayerSendCancel(cid, "You already have been blessed.")
return TRUE
end
end
if (getPlayerLevel(cid) >= maxlevel) then
if(doPlayerRemoveMoney(cid, new_cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBless(cid, bless[i])
doPlayerSendTextMessage(cid,19,"You have successfully all Bless , now do not need aol.")
end
else
doPlayerSendTextMessage(cid,19,"You need to have "..new_cost.."gp to buy Blesss.")
end
elseif(getPlayerLevel(cid) < maxlevel) then
if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBless(cid, bless[i])
end
doPlayerSendTextMessage(cid,19,"You have successfully been blessed.")
else
doPlayerSendTextMessage(cid,19,"You need to have "..cost.."gp to buy Blesss.")
end
end
return FALSE
end
if someone can help me with this please, Thanks in advance
 
hello people, i have one little problem with this command i want it to be used only by premium accounts ive tried to add this
Code:
if isPremium(cid) then
somewhere around line 19-20 in the script but i dont get it work this is my bless script
Code:
local bless = {1, 2, 3, 4, 5}
local cost = 50000 -- Cost in gp.
local maxlevel = 1000
function onSay(cid, words, param)
local lvl = getPlayerLevel(cid)
local new_cost = (lvl * cost) / 500
local target = getPlayerGUID(cid)
for i = 1, table.maxn(bless) do
if(getPlayerBless(cid, bless[i])) then
doPlayerSendCancel(cid, "You already have been blessed.")
return TRUE
end
end
if (getPlayerLevel(cid) >= maxlevel) then
if(doPlayerRemoveMoney(cid, new_cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBless(cid, bless[i])
doPlayerSendTextMessage(cid,19,"You have successfully all Bless , now do not need aol.")
end
else
doPlayerSendTextMessage(cid,19,"You need to have "..new_cost.."gp to buy Blesss.")
end
elseif(getPlayerLevel(cid) < maxlevel) then
if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBless(cid, bless[i])
end
doPlayerSendTextMessage(cid,19,"You have successfully been blessed.")
else
doPlayerSendTextMessage(cid,19,"You need to have "..cost.."gp to buy Blesss.")
end
end
return FALSE
end
if someone can help me with this please, Thanks in advance
this one will work fine, Already tested on 0.4
Code:
function onSay(cid, words, param)
local bless = {1, 2, 3, 4, 5}
local cost = 50000 -- Cost in gp.
local maxlevel = 1000
local lvl = getPlayerLevel(cid)
local new_cost = (lvl * cost) / 500
local target = getPlayerGUID(cid)
if isPremium(cid) == false then
doPlayerSendCancel(cid, "You need to be premium at first")
return true
end
for i = 1, table.maxn(bless) do
                if(getPlayerBlessing(cid, bless[i])) then
                        doPlayerSendCancel(cid, "You have already have been blessed.")
                        return TRUE
                end
        end
if (getPlayerLevel(cid) >= maxlevel) then
if(doPlayerRemoveMoney(cid, new_cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
doPlayerSendTextMessage(cid,19,"You have successfully all Bless , now do not need aol.")
end
else
doPlayerSendTextMessage(cid,19,"You need to have "..new_cost.."gp to buy Blesss.")
end
elseif(getPlayerLevel(cid) < maxlevel) then
if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBless(cid, bless[i])
end
doPlayerSendTextMessage(cid,19,"You have successfully been blessed.")
else
doPlayerSendTextMessage(cid,19,"You need to have "..cost.."gp to buy Blesss.")
end
end
return FALSE
end
 
this one will work fine, Already tested on 0.4
Code:
function onSay(cid, words, param)
local bless = {1, 2, 3, 4, 5}
local cost = 50000 -- Cost in gp.
local maxlevel = 1000
local lvl = getPlayerLevel(cid)
local new_cost = (lvl * cost) / 500
local target = getPlayerGUID(cid)
if isPremium(cid) == false then
doPlayerSendCancel(cid, "You need to be premium at first")
return true
end
for i = 1, table.maxn(bless) do
                if(getPlayerBlessing(cid, bless[i])) then
                        doPlayerSendCancel(cid, "You have already have been blessed.")
                        return TRUE
                end
        end
if (getPlayerLevel(cid) >= maxlevel) then
if(doPlayerRemoveMoney(cid, new_cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
doPlayerSendTextMessage(cid,19,"You have successfully all Bless , now do not need aol.")
end
else
doPlayerSendTextMessage(cid,19,"You need to have "..new_cost.."gp to buy Blesss.")
end
elseif(getPlayerLevel(cid) < maxlevel) then
if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBless(cid, bless[i])
end
doPlayerSendTextMessage(cid,19,"You have successfully been blessed.")
else
doPlayerSendTextMessage(cid,19,"You need to have "..cost.."gp to buy Blesss.")
end
end
return FALSE
end
Thank you man it worked :D another thing this creaturescript can be done like that too? i mean only for premium players
Code:
-- Loot Message
MessageSent = {}

function getContentDescription(uid, comma)
    local ret, i, containers = '', 0, {}

    while i < getContainerSize(uid) do
        local v, s = getContainerItem(uid, i), ''
        local k = getItemDescriptions(v.itemid)
        if k.name ~= '' then
            if isContainer(v.uid) and getContainerSize(v.uid) > 0 then
                table.insert(containers, v.uid)
            else
                if v.type > 1 and isItemStackable(v.itemid) and k.showCount then
                    s = v.type .. ' ' .. getItemDescriptions(v.itemid).plural
                else
                    local article = k.article
                    s = (article == '' and '' or article .. ' ') .. k.name
                end
                ret = ret .. (i == 0 and not comma and '' or ', ') .. s
            end
        else
            ret = ret .. (i == 0 and not comma and '' or ', ') .. 'an item of type ' .. v.itemid .. ', please report it to gamemaster'
        end
        i = i + 1
    end

    for i = 1, #containers do
        ret = ret .. getContentDescription(containers[i], true)
    end

    return ret
end

local function send(cid, lastHit, pos, name, party, target)
    local corpse = getTileItemByType(pos, ITEM_TYPE_CONTAINER).uid
    local ret = isContainer(corpse) and getContentDescription(corpse)

    if party then
        local leaderid
        for _, pid in ipairs(getPartyMembers(cid)) do
            if isPartyLeader(pid) then
                leaderid = pid
            end
        end
        local hash = ("%d:%d"):format(leaderid, target)
        if not MessageSent[hash] then
            for _, pid in ipairs(getPartyMembers(cid)) do
                local send = getPlayerStorageValue(pid,STORAGE_LOOTMESSAGE)
                if send == 1 then
                    doPlayerSendTextMessage(pid, MESSAGE_INFO_DESCR, 'Loot of '.. getArticleByWord(name) .. ' ' .. string.lower(name) .. ': ' .. (ret ~= '' and ret or 'nothing'))
                end
            end
            MessageSent[hash] = true
            addEvent(function() MessageSent[hash] = nil end, 1000)
        end
    else
        local send = getPlayerStorageValue(cid,STORAGE_LOOTMESSAGE)
        if send == 1 then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Loot of '.. getArticleByWord(name) .. ' ' .. string.lower(name) .. ': ' .. (ret ~= '' and ret or 'nothing'))
        end
    end
   
end

function onKill(cid, target, lastHit)
    if not isPlayer(target) then
        addEvent(send, 0, cid, lastHit, getThingPos(target), getCreatureName(target), getPartyMembers(cid), target)
    end
    return true
end
 
Back
Top