Extrodus
|| Blazera.net ||
Right now I have this script that allows a player to teleport by entering a place in a scroll and clicking ok, but right now it doesnt allow lower case letters if it has a capital at the beginning so I have to make double the locations. Does anyone know a way to make it use lower case and upper case or shorten the script to do for example: "Thais;thais"
Also when I type in locations and it displays the locations, it sorts them in a very strange way. If anyone could make them display alphabetical or the way listed in config that'd be great but thats not what I really need. The first part of my support request is what I need.
Code:
local t = {
["thais"] = {pos = {x = 581, y = 446, z = 7}, storage = 1337, time = 120},
["venore"] = {pos = {x = 834, y = 420, z = 7}, storage = 1337, time = 120},
["Thais"] = {pos = {x = 581, y = 446, z = 7}, storage = 1337, time = 120},
["Venore"] = {pos = {x = 834, y = 420, z = 7}, storage = 1337, time = 120}
}
function onTextEdit(cid, item, newText)
if item.itemid == 1952 then
if isPlayerPzLocked(cid) then
doCreatureSay(cid, "You are in a battle!", TALKTYPE_MONSTER)
return false
end
if isInArray({'locations', 'places', 'place'}, newText) then
local i = ''
for text, x in pairs(t) do
i = i .. "\n[" .. text .. "]"
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Current Teleport Locations: " .. i)
else
local p = t[newText]
if not p then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Invalid location")
return false
end
local st = p.storage
if getCreatureStorage(cid, st) > os.time() then
doCreatureSay(cid, "You must wait another " .. getCreatureStorage(cid, st) - os.time() .. ' second' .. (getCreatureStorage(cid, st) - os.time() == 1 and "" or "s") .. " to travel again.", TALKTYPE_MONSTER)
return true
end
local ti = p.time
local pos = p.pos
doTeleportThing(cid, pos, true)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
doCreatureSetStorage(cid, st, os.time() + ti)
doCreatureSay(cid, "You have been teleported!", TALKTYPE_MONSTER)
end
end
return true
end
Also when I type in locations and it displays the locations, it sorts them in a very strange way. If anyone could make them display alphabetical or the way listed in config that'd be great but thats not what I really need. The first part of my support request is what I need.
Last edited: