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

Djinns Scrolls

Dogrinha

New Member
Joined
Oct 6, 2019
Messages
206
Solutions
1
Reaction score
2
I would like to know how I do for those who use one scroll do not use the other, these two scrolls have the storages of the quest.
tfs0.4

Lua:
function onUse(cid, item, itemEx, toPosition)
 
local pos = getCreaturePosition(cid)
    if (getTilePzInfo(getPlayerPosition(cid)) == TRUE) then
        if getPlayerStorageValue(cid, 101149) == -1 then
            doPlayerSendTextMessage(cid, 22, "You already have permission to use the Green Djinn!")
        else
            doRemoveItem(item.uid, 1)
            doSendMagicEffect(getCreaturePosition(cid), 14)
            setPlayerStorageValue(cid, 9032, 8)
            setPlayerStorageValue(cid, 100061, 1)
            setPlayerStorageValue(cid, 100064, 14)
            setPlayerStorageValue(cid,100159, 6)
            setPlayerStorageValue(cid,100099, 1)
            setPlayerStorageValue(cid,11152, 1)     -- nao poder falar umar
            
            doPlayerSendTextMessage(cid, 22, "You just received permission to use the Green Djinn!")
        end
    else
        doPlayerSendTextMessage(cid, 22, "You can only use this item inside protection zone!")
    end
return true
end

Lua:
function onUse(cid, item, itemEx, toPosition)
 
local pos = getCreaturePosition(cid)
    if (getTilePzInfo(getPlayerPosition(cid)) == TRUE) then
        if getPlayerStorageValue(cid, 101150) == 1 then
            doPlayerSendTextMessage(cid, 22, "You already have permission to use the Green Djinn!")
        else
            doRemoveItem(item.uid, 1)
            doSendMagicEffect(getCreaturePosition(cid), 14)
            setPlayerStorageValue(cid, 10159, 1)    -- porta storage
            setPlayerStorageValue(cid, 10160, 1)     -- lagrima agua
            setPlayerStorageValue(cid,11153, 1)        -- lampada
            setPlayerStorageValue(cid, 100159, 6)
            setPlayerStorageValue(cid, 100061, 1)
            setPlayerStorageValue(cid, 100062, 12)
            setPlayerStorageValue(cid, 100032, -1)    -- alesar,yaman storage
            setPlayerStorageValue(cid,101149, 1)     -- nao poder falar umar
            
            doPlayerSendTextMessage(cid, 22, "You just received permission to use the Green Djinn!")
        end
    else
        doPlayerSendTextMessage(cid, 22, "You can only use this item inside protection zone!")
    end
return true
end
 
Try
Lua:
function onUse(cid, item, itemEx, toPosition)
 
local pos = getCreaturePosition(cid)
    if (getTilePzInfo(getPlayerPosition(cid)) == TRUE) then
        if getPlayerStorageValue(cid, 101149) == 1 then
            doPlayerSendTextMessage(cid, 22, "You already have permission to use the Green Djinn!")
        else
            doRemoveItem(item.uid, 1)
            doSendMagicEffect(getCreaturePosition(cid), 14)
            setPlayerStorageValue(cid, 9032, 8)
            setPlayerStorageValue(cid, 100061, 1)
            setPlayerStorageValue(cid, 101150, 1)
            setPlayerStorageValue(cid, 100064, 14)
            setPlayerStorageValue(cid,100159, 6)
            setPlayerStorageValue(cid,100099, 1)
            setPlayerStorageValue(cid,11152, 1)     -- nao poder falar umar
            
            doPlayerSendTextMessage(cid, 22, "You just received permission to use the Green Djinn!")
        end
    else
        doPlayerSendTextMessage(cid, 22, "You can only use this item inside protection zone!")
    end
return true
end
Lua:
function onUse(cid, item, itemEx, toPosition)
 
local pos = getCreaturePosition(cid)
    if (getTilePzInfo(getPlayerPosition(cid)) == TRUE) then
        if getPlayerStorageValue(cid, 101150) == 1 then
            doPlayerSendTextMessage(cid, 22, "You already have permission to use the Green Djinn!")
        else
            doRemoveItem(item.uid, 1)
            doSendMagicEffect(getCreaturePosition(cid), 14)
            setPlayerStorageValue(cid, 10159, 1)    -- porta storage
            setPlayerStorageValue(cid, 10160, 1)     -- lagrima agua
            setPlayerStorageValue(cid,11153, 1)        -- lampada
            setPlayerStorageValue(cid, 100159, 6)
            setPlayerStorageValue(cid, 100061, 1)
            setPlayerStorageValue(cid, 101149, 1)
            setPlayerStorageValue(cid, 100062, 12)
            setPlayerStorageValue(cid, 100032, -1)    -- alesar,yaman storage
            setPlayerStorageValue(cid,101149, 1)     -- nao poder falar umar
            
            doPlayerSendTextMessage(cid, 22, "You just received permission to use the Green Djinn!")
        end
    else
        doPlayerSendTextMessage(cid, 22, "You can only use this item inside protection zone!")
    end
return true
end
 
you do not understand, the script it works, but are 2 different items, I need an item to be used not freedom for the other to use, in case you changed the storages, but these storages are the ones that block djin npc. I just don't want my players to be able to use 2 so there's no problem spending it unintentionally....
 
I still don't understand what you want to do exactly, Explain more.
 
I have two djins scrolls, they work, but I wish that when using one player can not use the other, the localized storages are already correct. they serve to block opposing djin storages, and give the player access to the chosen djin, the problem is that I wish the player couldn't accidentally use 2 scrolls and lose one of them.
 
I think that is what I did?
Script says
Lua:
 if getPlayerStorageValue(cid, 101150) == 1 then
            doPlayerSendTextMessage(cid, 22, "You already have permission to use the Green Djinn!")
Lua:
  if getPlayerStorageValue(cid, 101149) == 1 then
            doPlayerSendTextMessage(cid, 22, "You already have permission to use the Green Djinn!")
So I made when players use scrolls for first time they get those storages added.
Lua:
setPlayerStorageValue(cid, 101149, 1)
setPlayerStorageValue(cid, 101150, 1)
then when trying to use it once more it will check for the storages and send text saying "You already have permission to use the Green Djinn!" which means you used the Green Djinn scroll before.
 
yes if you use the same scroll, what I want is that if you use a scroll, ID 10, you can't use the scroll ID 20, because you already have access to ID 10.
to avoid unintentionally spending
 
add return true after the message that he already used one of the scrolls

Lua:
if getPlayerStorageValue(cid, 101150) == 1 then
            doPlayerSendTextMessage(cid, 22, "You already have permission to use the Green Djinn!")
        else

Lua:
if getPlayerStorageValue(cid, 101150) == 1 then
            doPlayerSendTextMessage(cid, 22, "You already have permission to use the Green Djinn!")
            return true
        else

in both files
 
I hope that this is what you want, try this:
(Your first script)
Lua:
function onUse(cid, item, itemEx, toPosition)
 
local pos = getCreaturePosition(cid)
    if (getTilePzInfo(getPlayerPosition(cid)) == TRUE) then
        if getPlayerStorageValue(cid, 101198) == 1 then
            doPlayerSendTextMessage(cid, 22, "You already have permission to use the access ID 20!")
            return true
        end
        if getPlayerStorageValue(cid, 101149) == 1 then
            doPlayerSendTextMessage(cid, 22, "You already have permission to use the Green Djinn!")
            return true
        else
            doRemoveItem(item.uid, 1)
            doSendMagicEffect(getCreaturePosition(cid), 14)
            setPlayerStorageValue(cid, 9032, 8)
            setPlayerStorageValue(cid, 100061, 1)
            setPlayerStorageValue(cid, 100064, 14)
            setPlayerStorageValue(cid, 100159, 6)
            setPlayerStorageValue(cid, 100099, 1)
            setPlayerStorageValue(cid, 11152, 1)
            setPlayerStorageValue(cid, 101149, 1)
            setPlayerStorageValue(cid, 101199, 1) -- Added
            doPlayerSendTextMessage(cid, 22, "You just received permission to use the Green Djinn! (acces ID 10)")
        end
    else
        doPlayerSendTextMessage(cid, 22, "You can only use this item inside protection zone!")
    end
return true
end
(Your second script):

Lua:
function onUse(cid, item, itemEx, toPosition)
 
local pos = getCreaturePosition(cid)
    if (getTilePzInfo(getPlayerPosition(cid)) == TRUE) then
        if getPlayerStorageValue(cid, 101199) == 1 then
            doPlayerSendTextMessage(cid, 22, "You already have permission to use the access ID 10!")
            return true
        end
        if getPlayerStorageValue(cid, 101150) == 1 then
            doPlayerSendTextMessage(cid, 22, "You already have permission to use the Green Djinn!")
            return true
        else
            doRemoveItem(item.uid, 1)
            doSendMagicEffect(getCreaturePosition(cid), 14)
            setPlayerStorageValue(cid, 10159, 1)
            setPlayerStorageValue(cid, 10160, 1)
            setPlayerStorageValue(cid, 11153, 1)
            setPlayerStorageValue(cid, 100159, 6)
            setPlayerStorageValue(cid, 100061, 1)
            setPlayerStorageValue(cid, 100062, 12)
            setPlayerStorageValue(cid, 100032, -1)
            setPlayerStorageValue(cid, 101150, 1)
            setPlayerStorageValue(cid, 101198, 1) -- Added
            
            doPlayerSendTextMessage(cid, 22, "You just received permission to use the Green Djinn (access ID 20)!")
        end
    else
        doPlayerSendTextMessage(cid, 22, "You can only use this item inside protection zone!")
    end
return true
end
 
BRO, I was trying to do postman for hours, I did now because of this post, thaaaaaaaaaaank you!




I would like to know how I do for those who use one scroll do not use the other, these two scrolls have the storages of the quest.
tfs0.4

Lua:
function onUse(cid, item, itemEx, toPosition)
 
local pos = getCreaturePosition(cid)
    if (getTilePzInfo(getPlayerPosition(cid)) == TRUE) then
        if getPlayerStorageValue(cid, 101149) == -1 then
            doPlayerSendTextMessage(cid, 22, "You already have permission to use the Green Djinn!")
        else
            doRemoveItem(item.uid, 1)
            doSendMagicEffect(getCreaturePosition(cid), 14)
            setPlayerStorageValue(cid, 9032, 8)
            setPlayerStorageValue(cid, 100061, 1)
            setPlayerStorageValue(cid, 100064, 14)
            setPlayerStorageValue(cid,100159, 6)
            setPlayerStorageValue(cid,100099, 1)
            setPlayerStorageValue(cid,11152, 1)     -- nao poder falar umar
           
            doPlayerSendTextMessage(cid, 22, "You just received permission to use the Green Djinn!")
        end
    else
        doPlayerSendTextMessage(cid, 22, "You can only use this item inside protection zone!")
    end
return true
end

Lua:
function onUse(cid, item, itemEx, toPosition)
 
local pos = getCreaturePosition(cid)
    if (getTilePzInfo(getPlayerPosition(cid)) == TRUE) then
        if getPlayerStorageValue(cid, 101150) == 1 then
            doPlayerSendTextMessage(cid, 22, "You already have permission to use the Green Djinn!")
        else
            doRemoveItem(item.uid, 1)
            doSendMagicEffect(getCreaturePosition(cid), 14)
            setPlayerStorageValue(cid, 10159, 1)    -- porta storage
            setPlayerStorageValue(cid, 10160, 1)     -- lagrima agua
            setPlayerStorageValue(cid,11153, 1)        -- lampada
            setPlayerStorageValue(cid, 100159, 6)
            setPlayerStorageValue(cid, 100061, 1)
            setPlayerStorageValue(cid, 100062, 12)
            setPlayerStorageValue(cid, 100032, -1)    -- alesar,yaman storage
            setPlayerStorageValue(cid,101149, 1)     -- nao poder falar umar
           
            doPlayerSendTextMessage(cid, 22, "You just received permission to use the Green Djinn!")
        end
    else
        doPlayerSendTextMessage(cid, 22, "You can only use this item inside protection zone!")
    end
return true
end
 
Back
Top