Lakh
Banned User
Hello, I am wondering if there is a way to only make a certain portal available when a player has completed 7 missions?
local storages {
[1] storage = "xxx",
[2] storage = "xxx",
[3] storage = "xxx",
[4] storage = "xxx",
[5] storage = "xxx",
[6] storage = "xxx",
[7] storage = "xxx",
}
function onStepIn(cid,frompos,topos)
if getPlayerStorageValue isinArray 1,2,3,4,5,6,7 then
etc..
so like.. ??
LUA:local storages { [1] storage = "xxx", [2] storage = "xxx", [3] storage = "xxx", [4] storage = "xxx", [5] storage = "xxx", [6] storage = "xxx", [7] storage = "xxx", } function onStepIn(cid,frompos,topos) if getPlayerStorageValue isinArray 1,2,3,4,5,6,7 then etc..
local storage = xxxx
local pStorage = getPlayerStorageValue(cid, storage)
local nPos = {x = aaa, y = bbb, z= ccc}
function onStepIn(cid, item, pos, fromPos)
if (isPlayer(cid)) then
if pStorage < 1 then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "In order to enter this portal, first you have to do the 7 fuckin missions")
elseif pStorage >= 1 and pStorage < 2 then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 1 mission done there are 6 left")
elseif pStorage >= 2 and pStorage < 3 then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 2 mission done there are 5 left")
elseif pStorage >= 3 and pStorage < 4 then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 3 mission done there are 4 left")
elseif pStorage >= 4 and pStorage < 5 then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 4 mission done there are 3 left")
elseif pStorage >= 5 and pStorage < 6 then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 5 mission done there are 2 left")
elseif pStorage >= 6 and pStorage < 7 then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You almost finish you already have done 6 missions, go and find the final one and you'll be able to enter the telepor")
elseif pStorage >= 7 then
doTeleportThing(cid, nPos)
doSendMagicEffect(nPos, CONST_ME_ENERGYAREA)
doPlayerSendTextMessage(nPos, MESSAGE_EVENT_ADVANCE, "You are now inside")
end
else
return TRUE
end
return TRUE
end
Looks like you are doing it betteranyways...
LUA:local storage = xxxx local pStorage = getPlayerStorageValue(cid, storage) local nPos = {x = aaa, y = bbb, z= ccc} function onStepIn(cid, item, pos, fromPos) if (isPlayer(cid)) then if pStorage < 1 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "In order to enter this portal, first you have to do the 7 fuckin missions") elseif pStorage >= 1 and pStorage < 2 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 1 mission done there are 6 left") elseif pStorage >= 2 and pStorage < 3 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 2 mission done there are 5 left") elseif pStorage >= 3 and pStorage < 4 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 3 mission done there are 4 left") elseif pStorage >= 4 and pStorage < 5 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 4 mission done there are 3 left") elseif pStorage >= 5 and pStorage < 6 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You just have 5 mission done there are 2 left") elseif pStorage >= 6 and pStorage < 7 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You almost finish you already have done 6 missions, go and find the final one and you'll be able to enter the telepor") elseif pStorage >= 7 then doTeleportThing(cid, nPos) doSendMagicEffect(nPos, CONST_ME_ENERGYAREA) doPlayerSendTextMessage(nPos, MESSAGE_EVENT_ADVANCE, "You are now inside") end else return TRUE end return TRUE end
I don't know if it workstry it out
local storage = xxxx
local nPos = {x = aaa, y = bbb, z= ccc}
function onStepIn(cid, item, pos, fromPos)
return isPlayer(cid) and (getPlayerStorageValue(cid, storage) == 7 and (doTeleportThing(cid, nPos) and doSendMagicEffect(nPos, CONST_ME_TELEPORT)) or doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, (getPlayerStorageValue(cid, storage) > 0 and "You've done only " .. getPlayerStorageValue(cid, storage) .. " missions, there " .. (getPlayerStorageValue(cid, storage) == 6 and "is " or "are ") .. 7 - (getPlayerStorageValue(cid, storage) .. " missions left.") or "You haven't done any mission at all, there are 7 missions left."))) or true
end
Down?Alright thanks, but what storage do I put down? o.0
Shortened:
LUA:local storage = xxxx local nPos = {x = aaa, y = bbb, z= ccc} function onStepIn(cid, item, pos, fromPos) return isPlayer(cid) and (getPlayerStorageValue(cid, storage) == 7 and (doTeleportThing(cid, nPos) and doSendMagicEffect(nPos, CONST_ME_TELEPORT)) or doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, (getPlayerStorageValue(cid, storage) > 0 and "You've done only " .. getPlayerStorageValue(cid, storage) .. " missions, there " .. (getPlayerStorageValue(cid, storage) == 6 and "is " or "are ") .. 7 - (getPlayerStorageValue(cid, storage) .. " missions left.") or "You haven't done any mission at all, there are 7 missions left."))) or true end
local storage = {
123, 456, 789
}
function onStepIn(cid, fromPosition, toPosition)
if getPlayerStorageValue(cid, table.maxn(storage)) < 1 then
doTeleportThing(cid, fromPosition, true)
end
end
local storage = {
123, 456, 789
}
function onStepIn(cid, fromPosition, toPosition)
for i = 1, #storage do
if getPlayerStorageValue(cid, storage[i]) < 1 then
doTeleportThing(cid, fromPosition, true)
end
end
end