questStorage - is player storage key used in maaaany things, example: in quests ;s
questStorageId - is value of questStorage
goodPos - if player have done quest then will be teleported to this postions
badPos - if player haven't done quest then will be teleported to this positions
sign -:
0 - if you want to pass players which haven't got quest
1 - if you want to pass players which have special questStorageId (if player have bigger storage then required then he would'nt pass)
2 - if you want to pass players which have bigger storage then questStorageId
0 - pass if player have < questStorageId
1 - pass if player have == questStorageId
2 - pass if player have > questStorageId
questStorageId - is value of questStorage
goodPos - if player have done quest then will be teleported to this postions
badPos - if player haven't done quest then will be teleported to this positions
sign -:
0 - if you want to pass players which haven't got quest
1 - if you want to pass players which have special questStorageId (if player have bigger storage then required then he would'nt pass)
2 - if you want to pass players which have bigger storage then questStorageId
0 - pass if player have < questStorageId
1 - pass if player have == questStorageId
2 - pass if player have > questStorageId
Lua:
function doTeleportPlayerIfHasSpecialStorageIDofQuest(cid, questStorage, questStorageId, sign, goodPos, badPos, fromPosition)
if sign < 1 then
if getPlayerStorageValue(cid, questStorage) < quesStorageId then
doTeleportThing(cid, goodPos)
doSendMagicEffect(goodPos, CONST_ME_TELEPORT)
else
if (badPos == 0 or nil) then
doTeleportThing(cid, fromPosition)
else
doTeleportThing(cid, badPos)
end
end
elseif sign == 1 then
if getPlayerStorageValue(cid, questStorage) == quesStorageId then
doTeleportThing(cid, goodPos)
doSendMagicEffect(goodPos, CONST_ME_TELEPORT)
else
if (badPos == 0 or nil) then
doTeleportThing(cid, fromPosition)
else
doTeleportThing(cid, badPos)
end
end
elseif sign > 1 then
if getPlayerStorageValue(cid, questStorage) > quesStorageId then
doTeleportThing(cid, goodPos)
doSendMagicEffect(goodPos, CONST_ME_TELEPORT)
else
if (badPos == 0 or nil) then
doTeleportThing(cid, fromPosition)
else
doTeleportThing(cid, badPos)
end
end
end
return true
end