• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

New teleport style

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
I want a script which is based in the new banning system.
In which the options appear in a window. But the system will work if I use an item with ACTIONID: 11120

EDIT:
Now I started the script, but I can't use the statue with actionid 11120
Appear a message:
You can't use this object.

Script:
Code:
configurar =
{
    amazonPos = {x=7448, y=7414, z=7},
    amazonCost = 5,

    cyclopsPos = {x=7620, y=7568, z=7},
    cyclopsCost = 7,
}

modaldialog =
{
    title = "Camps",
    message = "Teleport you to a camp that you choice.",
    buttons =
{
    { id = 1, value = "okay" },
    { id = 2, value = "cancel" },
},
    buttonEnter = 1,
    buttonEscape = 2,
choices =
{
    { id = 1, value = "Amazon Camp - ".. configurar.amazonCost .." scarab coins." },
    { id = 2, value = "Cyclops Camp - ".. configurar.cyclopsCost .." scarab coins." }
},
    popup = true
}


function callback(cid, button, choice)
    if (button == 1) then
        if getPlayerStorageValue(cid, RACE) == ELF or getPlayerStorageValue(cid, RACE) == HUMAN then
            if (choice == 1) then
                if getPlayerItemCount(cid, 2159) >= configurar.amazonCost then
                  doPlayerRemoveItem(cid, 2159, configurar.amazonCost)
                  doTeleportThing(cid, configurar.amazonPos, 1)
                else
                  doPlayerSendCancel(cid, "You don't have ".. configurar.amazonCost .." scarab coins.")
                end
            end
            if (choice == 2) then
                if getPlayerItemCount(cid, 2159) >= configurar.cyclopsCost then
                  doPlayerRemoveItem(cid, 2159, configurar.cyclopsCost)
                  doTeleportThing(cid, configurar.cyclopsPos, 1)
                else
                  doPlayerSendCancel(cid, "You don't have ".. configurar.cyclopsCost .." scarab coins.")
                end
            end
        else
          doPlayerSendCancel(cid, "You aren't an elf or a human.")
        end
    end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerPremiumDays(cid) >= 1 then
      addDialog(modaldialog, 2345, cid, callback);
    else
      doPlayerSendCancel(cid, "You need to be a vip account to use.")
      doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
    end
end
 
Last edited:
I've started the script, but don't work and don't show any error:
Code:
configurar =
{
    amazonPos = {x=7448, y=7414, z=7},
    amazonCost = 5,

    cyclopsPos = {x=7620, y=7568, z=7},
    cyclopsCost = 7,
}

modaldialog =
{
    title = "Camps",
    message = "Teleport you to a camp that you choice.",
    buttons =
{
    { id = 1, value = "okay" },
    { id = 2, value = "cancel" },
},
    buttonEnter = 1,
    buttonEscape = 2,
choices =
{
    { id = 1, value = "Amazon Camp - ".. configurar.amazonCost .." scarab coins." },
    { id = 2, value = "Cyclops Camp - ".. configurar.cyclopsCost .." scarab coins." }
},
    popup = true
}


function callback(cid, button, choice)
    if (button == 1) then
        if getPlayerStorageValue(cid, RACE) == ELF or getPlayerStorageValue(cid, RACE) == HUMAN then
            if (choice == 1) then
                if getPlayerItemCount(cid, 2159) >= configurar.amazonCost then
                  doPlayerRemoveItem(cid, 2159, configurar.amazonCost)
                  doTeleportThing(cid, configurar.amazonPos, 1)
                else
                  doPlayerSendCancel(cid, "You don't have ".. configurar.amazonCost .." scarab coins.")
                end
            end
            if (choice == 2) then
                if getPlayerItemCount(cid, 2159) >= configurar.cyclopsCost then
                  doPlayerRemoveItem(cid, 2159, configurar.cyclopsCost)
                  doTeleportThing(cid, configurar.cyclopsPos, 1)
                else
                  doPlayerSendCancel(cid, "You don't have ".. configurar.cyclopsCost .." scarab coins.")
                end
            end
        else
          doPlayerSendCancel(cid, "You aren't an elf or a human.")
        end
    end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerPremiumDays(cid) >= 1 then
      addDialog(modaldialog, 2345, cid, callback);
    else
      doPlayerSendCancel(cid, "You need to be a vip account to use.")
      doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
    end
end

If I try to use the statue a msg appear:
You can't use this object.
 
Last edited:
Back
Top