warriorfrog
Active Member
- Joined
- Jul 29, 2015
- Messages
- 334
- Reaction score
- 35
Im looking on web, i found this desert quest script
But im looking on code, and dont have conditional if someone have lvl 19-
Right?
if not, how to do it? need a for (using pid) and check pid players?
But im looking on code, and dont have conditional if someone have lvl 19-
Right?
Code:
local config = {
items = {
{position = {x = 1552, y = 1678, z = 10}, itemid = 2175},
{position = {x = 1542, y = 1678, z = 10}, itemid = 2674},
{position = {x = 1547, y = 1673, z = 10}, itemid = 2455},
{position = {x = 1547, y = 1682, z = 10}, itemid = 2376},
--etc
},
players = {
{position = {x = 1550, y = 1678, z = 10}, toPos = {x = 1588, y = 1635, z = 8}, vocation = {1, 5, 9}},
{position = {x = 1544, y = 1678, z = 10}, toPos = {x = 1589, y = 1635, z = 8}, vocation = {2, 6, 10}},
{position = {x = 1547, y = 1675, z = 10}, toPos = {x = 1589, y = 1636, z = 8}, vocation = {3, 7, 11}},
{position = {x = 1547, y = 1681, z = 10}, toPos = {x = 1588, y = 1636, z = 8}, vocation = {4, 8, 12}},
--etc
}
}
function onUse(cid)
local items, quest_players = {}, {}
for _, item in pairs(config.items) do
local position_item = getTileItemById(item.position, item.itemid).uid
if position_item > 0 then
table.insert(items, position_item)
else
return doPlayerSendCancel(cid, "There's missing some item(s).")
end
end
for _, player in pairs(config.players) do
local pid = getTopCreature(player.position).uid
if isPlayer(pid) and isInArray(player.vocation, getPlayerVocation(pid)) then
table.insert(quest_players, pid)
else
return doPlayerSendCancel(cid, "There's some player(s) missing or there's some wrong vocation(s).")
end
end
for i = 1, #items do
doRemoveItem(items[i])
end
for i = 1, #quest_players do
doPlayerSendTextMessage(quest_players[i], MESSAGE_INFO_DESCR, "Good luck at the quest!")
doTeleportThing(quest_players[i], config.players[i].toPos)
end
return true
end
if not, how to do it? need a for (using pid) and check pid players?