local vocation = {0} -- vocações que vai poder usar o teleport
local pos = {x = 32005, y = 32363, z = 5} -- local para onde sera teleportado
function onStepIn(cid, player, position, FromPosition)
if getPlayerFreeCap(cid) <= 400 then
if isInArray(vocation, getPlayerVocation(cid)) then
doTeleportThing(cid, pos)
else
doTeleportThing(cid,FromPosition)
doPlayerSendCancel(cid,"Only no Vocations!")
end
else
doTeleportThing(cid,FromPosition)
doPlayerSendCancel(cid,"Your cap must be lower than 400!")
end
return true
function getPlayerMaxCap(cid) -- Function by darkhaos
local query = db.getResult("SELECT `cap` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";")
if query:getID() ~= -1 then
return query:getDataInt("cap")
end
query:free()
return LUA_ERROR
end
function onStepIn(cid, item, position, fromPosition)
if getPlayerMaxCap(cid) < 400 then
return true
end
return false
end
Can you give us a bone?doesn't works![]()
local vocation = {0} -- vocações que vai poder usar o teleport
local pos = {x = 32005, y = 32363, z = 5} -- local para onde sera teleportado
function onStepIn(cid, player, position, FromPosition)
if getPlayerFreeCap(cid) <= 400 then
if isInArray(vocation, getPlayerVocation(cid)) then
doTeleportThing(cid, pos)
else
doTeleportThing(cid,FromPosition)
doPlayerSendCancel(cid,"Only no Vocations!")
end
else
doTeleportThing(cid,FromPosition)
doPlayerSendCancel(cid,"Your cap must be lower than 400!")
end
return true
That's not what you asked for.
>.>
Only thing that script accomplishes is forcing players to pick up trash loot until they have no cap left, then drop it the moment they get through the portal