caquinha
Member
- Joined
- Aug 8, 2016
- Messages
- 248
- Solutions
- 1
- Reaction score
- 24
I'm trying to do a desert quest for my custom server (it is not a default desert quest)
but when i try to pull the lever print this errors on console
why?
Code:
-- table based on base vocations
local p = {
[1] = { -- knight
player = {
position = {x = 1550, y = 1678, z = 10},
toPos = {x = 1589, y = 1636, z = 8}
},
item = {
position = {x = 1551, y = 1678, z = 10},
itemid = 2376
}
},
[2] = { -- archer
player = {
position = {x = 1547, y = 1675, z = 10},
toPos = {x = 1589, y = 1635, z = 8}
},
item = {
position = {x = 1547, y = 1674, z = 10},
itemid = 2456
}
},
[3] = { --mage
player = {
position = {x = 1544, y = 1678, z = 10},
toPos = {x = 1588, y = 1635, z = 8}
},
item = {
position = {x = 1573, y = 1678, z = 10},
itemid = 2175
}
}
}
local playerMinimumLevel = 50
-- get a vocation's base vocation
function getBaseVocation(cid)
local voc = getPlayerVocation(cid)
if isInArray({1, 4, 5, 6, 7}, voc) then
return 1
elseif isInArray({2, 8, 9, 10}, voc) then
return 2
elseif isInArray({3, 11, 12, 13, 14, 15, 16, 17}, voc) then
return 3
elseif voc == 0 then
return 0
end
end
function onUse(cid)
local questItems, questPlayers = {}, {}
for i = 1, #p do
local pid = getTopCreature(p[i].player.position).uid
if isPlayer(pid) then
if getPlayerLevel(pid) >= playerMinimumLevel then
local j = getBaseVocation( getPlayerVocation(pid))
if getBaseVocation( getPlayerVocation(pid) ) == i then
local neededItem = getTileItemById(p[i].item.position, p[i].item.itemid).uid
if neededItem > 0 then
table.insert(questItems, neededItem)
table.insert(questPlayers, pid)
else
doPlayerSendCancel(cid, "Some items are missing.")
return false
end
else
doPlayerSendCancel(cid, "A vocation is on the wrong spot.")
return false
end
else
doPlayerSendCancel(cid, getCreatureName(pid) .. ", is not high enough in level, they must be atleast level " .. playerMinimumLevel .. ".")
return false
end
else
doPlayerSendCancel(cid, "A player is missing.")
return false
end
end
for x = 1, #questPlayers do
doRemoveItem(questItems[x])
doTeleportThing(questPlayers[x], p[x].player.toPos)
end
doTeleportThing(cid, {x = 1588, y = 1636, z = 8})
return true
end
but when i try to pull the lever print this errors on console
Code:
[21:55:12.188] [Error - Action Interface]
[21:55:12.188] data/actions/scripts/desertquest_lever.lua:onUse
[21:55:12.188] Description:
[21:55:12.188] (internalGetPlayerInfo) Player not found when requesting player info #6
[21:55:12.188] [Error - Action Interface]
[21:55:12.188] data/actions/scripts/desertquest_lever.lua:onUse
[21:55:12.188] Description:
[21:55:12.188] (internalGetPlayerInfo) Player not found when requesting player info #6
why?