Postado Julho 13, 2014 10 anos Ola a todos Estou precisando mt da ajuda de vocês então quem poder ajuda ve ai. Entao eu to usando no meu ot esse sistema mas tem uma parte que n consigo configurar. o Script aqui eu não sei onde devo colocar esse script : esse script serve pra remover os trap para inicia o evento Onde devo colocar esse script pq em talkations que n e local config = { palavra = '/ctftrap', storage = 121250, -- Não mexa aqui! time = 5, pos = {x=1015,y=709,z=7}, pos2 = {x=1016,y=709,z=7}, pos3 = {x=1017,y=709,z=7}, pos4 = {x=1015,y=708,z=6}, pos5 = {x=1016,y=708,z=6}, pos6 = {x=1014,y=732,z=6}, pos7 = {x=1015,y=732,z=6}, pos8 = {x=1016,y=732,z=6}, pos9 = {x=1014,y=730,z=7}, pos10 = {x=1015,y=730,z=7}, pos11 = {x=1016,y=730,z=7}, paredeid = 9213, -- id da parede parede2id = 9213, -- id da parede parede3id = 9213, -- id da parede parede4id = 9213, -- id da parede parede5id = 9213, -- id da parede parede6id = 9213, -- id da parede parede7id = 9213, -- id da parede parede8id = 9213, -- id da parede parede9id = 9213, -- id da parede parede10id = 9213, -- id da parede parede11id = 9213, -- id da parede } local position = { x = 1080,y = 713,z = 7 -- pos em que o jogador precisa estar para falar } function onSay(cid, words, param, channel) local parede = getTileItemById(config.pos, config.paredeid) local parede2 = getTileItemById(config.pos2, config.parede2id) local parede3 = getTileItemById(config.pos3, config.parede3id) local parede4 = getTileItemById(config.pos4, config.parede4id) local parede5 = getTileItemById(config.pos5, config.parede5id) local parede6 = getTileItemById(config.pos6, config.parede6id) local parede7 = getTileItemById(config.pos7, config.parede7id) local parede8 = getTileItemById(config.pos8, config.parede8id) local parede9 = getTileItemById(config.pos9, config.parede9id) local parede10 = getTileItemById(config.pos10, config.parede10id) local parede11 = getTileItemById(config.pos11, config.parede11id) local pos,area = getCreaturePosition(cid) local pos2,area = getCreaturePosition(cid) local pos3,area = getCreaturePosition(cid) local pos4,area = getCreaturePosition(cid) local pos5,area = getCreaturePosition(cid) local pos6,area = getCreaturePosition(cid) local pos7,area = getCreaturePosition(cid) local pos8,area = getCreaturePosition(cid) local pos9,area = getCreaturePosition(cid) local pos10,area = getCreaturePosition(cid) local pos11,area = getCreaturePosition(cid) if (pos.z == position.z) and (pos.x == position.x) and (pos.y == position.y) and (pos2.z == position.z) and (pos2.x == position.x) and (pos2.y == position.y) and (pos3.z == position.z) and (pos3.x == position.x) and (pos3.y == position.y) and (pos4.z == position.z) and (pos4.x == position.x) and (pos4.y == position.y) and (pos5.z == position.z) and (pos5.x == position.x) and (pos5.y == position.y) and (pos6.z == position.z) and (pos6.x == position.x) and (pos6.y == position.y) and (pos7.z == position.z) and (pos7.x == position.x) and (pos7.y == position.y) and (pos8.z == position.z) and (pos8.x == position.x) and (pos8.y == position.y) and (pos9.z == position.z) and (pos9.x == position.x) and (pos9.y == position.y) and (pos10.z == position.z) and (pos10.x == position.x) and (pos10.y == position.y) and (pos11.z == position.z) and (pos11.x == position.x) and (pos11.y == position.y) then if words == config.palavra then if parede and parede2 and parede3 and parede4 and parede5 and parede6 and parede7 and parede8 and parede9 and parede10 and parede11 then if getGlobalStorageValue(config.storage) <= os.time() then doRemoveItem(parede.uid, 1) doRemoveItem(parede2.uid, 1) doRemoveItem(parede3.uid, 1) doRemoveItem(parede4.uid, 1) doRemoveItem(parede5.uid, 1) doRemoveItem(parede6.uid, 1) doRemoveItem(parede7.uid, 1) doRemoveItem(parede8.uid, 1) doRemoveItem(parede9.uid, 1) doRemoveItem(parede10.uid, 1) doRemoveItem(parede11.uid, 1) else doPlayerSendCancel(cid, "A entrada já foi removida.") return TRUE end end end end end Entao oq eu quero sabe como arruma pra Quando eu der o comando /ctf open Remover as paredes mas ai n consigo configurar certo ======================================================================================================= esse aqui Serve pra o comando /ctf open funcionar mas /ctf open funciona mas os trap n são removidos --[[ Capture The Flag System Author: Maxwell Denisson(MaXwEllDeN) Version: 1.0 ]] function onSay(cid, words, param) local CTF = _CTF_LIB if not(CTF.nopen) then return false end if (param == "open") then if (getGlobalStorageValue(CTF.CTFSto) > 0) then return doPlayerSendTextMessage(cid, 27, "O Evento RB já está aberto!") end doBroadcastMessage("[Evento] Roube a Bandeira foi aberto!") setGlobalStorageValue(CTF.CTFSto, 1) doPlayerSendTextMessage(cid, 27, "Evento Roube a Bandeira foi aberto com sucesso!") elseif (param == "close") then if (getGlobalStorageValue(CTF.CTFSto) < 1) then return doPlayerSendTextMessage(cid, 27, "O Evento Roube a Bandeira já está fechado!") end doBroadcastMessage("[Evento] Roube a Bandeira foi fechado!") for a, _ in pairs(CTF.flags) do setGlobalStorageValue(a, 0) setGlobalStorageValue(a-15, 0) end for _, cid in pairs (getOnlinePlayers()) do local cid = getPlayerByNameWildcard(b) if (getPlayerStorageValue(cid, CTF.teamssto) > 0) then doPlayerSendTextMessage(cid, 22, "[Evento] Roube a Bandeira foi fechado e você saiu do evento!") if (getPlayerStorageValue(cid, CTF.Flagsto) > 0) then local bant = getPlayerStorageValue(cid, CTF.Flagsto) devolverFlag(cid, bant) end setPlayerStorageValue(cid, CTF.teamssto, -1) setPlayerStorageValue(cid, CTF.Flagsto, -1) doPlayerSetTown(cid, CTF.TownExit) doTeleportThing(cid, getTownTemplePosition(CTF.TownExit)) end end setGlobalStorageValue(CTF.CTFSto, -1) doPlayerSendTextMessage(cid, 27, "Evento RB foi fechado com sucesso!") end return true end ============================================================================================================= Esse eo meu CTF Lib : --[[ Capture The Flag System Author: Maxwell Denisson(MaXwEllDeN) Version: 1.0 ]] _CTF_LIB = { redid = 17530, greenid = 17531, Flagsto = 13221, teamssto = 17530, winp = 15, recompCTF = {{2160, 2}}, nopen = true, -- Precisa usar o comando para abrir? false não true sim CTFSto = 95712, TownExit = 1, -- Templo que o player será teletransportado quando acabar o evento ou ele sair dele. price = false, -- Preço para entrar no Evento, caso não precise Digite false. teamsOUT = {} } _CTF_LIB.flags = { [_CTF_LIB.redid] = {pos = {x = 1013, y = 707, z = 6}, posEflag = {x = 1011, y = 707, z = 7}, id = 1435, color = 180, na = "Madara", temple = 5, color = 180, out = { [1] = {lookType = 244, lookHead = 0, lookBody = 132, lookLegs = 113, lookFeet = 94}, [2] = {lookType = 244, lookHead = 0, lookBody = 94, lookLegs = 113, lookFeet = 113}, [3] = {lookType = 244, lookHead = 0, lookBody = 132, lookLegs = 113, lookFeet = 94, lookAddons = 3}} }, [_CTF_LIB.greenid] = {pos = {x = 1012, y = 735, z = 6}, posEflag = {x = 1010, y = 734, z = 7}, id = 1437, color = 30, na = "Hashirama", temple = 6, color = 31, out = { [1] = {lookType = 370, lookHead = 0, lookBody = 121, lookLegs = 101, lookFeet = 101}, [2] = {lookType = 370, lookHead = 0, lookBody = 121, lookLegs = 101, lookFeet = 101, lookAddons = 1}, [3] = {lookType = 370, lookHead = 0, lookBody = 121, lookLegs = 101, lookFeet = 101, lookAddons = 3}} } } for a, b in pairs(_CTF_LIB.flags) do local condition = createConditionObject(CONDITION_OUTFIT) setConditionParam(condition, CONDITION_PARAM_TICKS, 180000*1000) addOutfitCondition(condition, b.out[1]) local condition2 = createConditionObject(CONDITION_OUTFIT) setConditionParam(condition2, CONDITION_PARAM_TICKS, 180000*1000) addOutfitCondition(condition2, b.out[2]) local other = createConditionObject(CONDITION_OUTFIT) setConditionParam(other, CONDITION_PARAM_TICKS, 180000*1000) addOutfitCondition(other, b.out[3]) _CTF_LIB.teamsOUT[a] = {} _CTF_LIB.teamsOUT[a][0] = condition2 _CTF_LIB.teamsOUT[a][1] = condition _CTF_LIB.teamsOUT[a][2] = other end function MsgToCTFM(class, msg) for _, b in pairs (getOnlinePlayers()) do local b = getPlayerByNameWildcard(b) if (getPlayerStorageValue(b, _CTF_LIB.teamssto) > 0) then doPlayerSendTextMessage(b, class, msg) end end end function getTeamLivre() local teams = {} for a, b in pairs(_CTF_LIB.flags) do table.insert(teams, {getGlobalStorageValue(a), a}) end if (teams[1][1] < teams[2][1]) then return teams[1][2] elseif (teams[1][1] > teams[2][1]) then return teams[2][2] end local team = teams[math.random(#teams)][2] return team end function doFindItemInPos(ids,pos) -- By Undead Slayer local results = {} for _ = 0, 255 do local findPos = {x = pos.x, y = pos.y, z = pos.z, stackpos = _} if isInArray(ids, getThingFromPos(findPos).itemid) then table.insert(results, getThingFromPos(findPos)) end end return results end function CTF_createFlags() for a, b in pairs(_CTF_LIB.flags) do local item = doCreateItem(b.id, 1, b.pos) doItemSetAttribute(item, "uid", a) doItemSetAttribute(item, "aid", 67189) b.posEflag.stackpos = 0 local item = getThingFromPos(b.posEflag).uid doItemSetAttribute(item, "uid", a) doItemSetAttribute(item, "aid", 15312) setGlobalStorageValue(a-15, 0) setGlobalStorageValue(a, 0) end end function ComparePosition(pos1, pos2) if (((pos1.x ~= pos2.x) or (pos1.y ~= pos2.y) or (pos1.z ~= pos2.z))) then return false end return true end function CreateFlag(pos, id) if (#doFindItemInPos({id}, pos) < 1) then return doCreateItem(id, 1, pos) end return true end function RemoveFlag(pos, id) local iteims = doFindItemInPos({id}, pos) if (#iteims > 0) then for _, b in pairs(iteims) do doRemoveItem(b.uid, 1) end end return true end function WalkFlag(uid, team, pos, bant) local function Alert(pos) if (isCreature(uid)) then if (getPlayerStorageValue(uid, _CTF_LIB.Flagsto) < 1) or (getPlayerStorageValue(uid, _CTF_LIB.teamssto) < 1) then return RemoveFlag(getPPos(uid), _CTF_LIB.flags[bant].id) end if (getPlayerStorageValue(uid, _CTF_LIB.Flagsto) == 17001) then RemoveFlag(getPPos(uid), _CTF_LIB.flags[bant].id) return setPlayerStorageValue(uid, _CTF_LIB.Flagsto, -1) end if not(ComparePosition(getThingPos(uid), getPPos(uid))) then RemoveFlag(getPPos(uid), _CTF_LIB.flags[bant].id) setPPos(uid, getThingPos(uid)) CreateFlag(getThingPos(uid), _CTF_LIB.flags[bant].id) end addEvent(Alert, 250, pos) end end Alert(pos) return true end function setPPos(uid, pos) return setPlayerStorageValue(uid, 50117, "{x = ".. pos.x ..", y = ".. pos.y ..", z = ".. pos.z .."}") end function getPPos(uid) return loadstring('return ' .. getPlayerStorageValue(uid, 50117))() end function getFlag(uid, team, bant) setPPos(uid, getThingPos(uid)) CreateFlag(getThingPos(uid), _CTF_LIB.flags[bant].id) setPlayerStorageValue(uid, _CTF_LIB.Flagsto, bant) MsgToCTFM(22, getCreatureName(uid) .. " roubou a bandeira do time ".. _CTF_LIB.flags[bant].na .. "!") return WalkFlag(uid, team, getThingPos(uid), bant) end function devolverFlag(uid, team) if (#doFindItemInPos({_CTF_LIB.flags[team].id}, _CTF_LIB.flags[team].pos) < 1) then local item = doCreateItem(_CTF_LIB.flags[team].id, 1, _CTF_LIB.flags[team].pos) doItemSetAttribute(item, "uid", team) doItemSetAttribute(item, "aid", 67189) end return setPlayerStorageValue(uid, _CTF_LIB.Flagsto, 17001) end function addPoint(uid, team, bant) if (getGlobalStorageValue(team-15) < 0) then setGlobalStorageValue(team-15, 0) end RemoveFlag(getPPos(uid), _CTF_LIB.flags[bant].id) addEvent(devolverFlag, 2000, uid, bant) setGlobalStorageValue(team-15, getGlobalStorageValue(team-15)+1) msgi = "Capture The Flag by MaXwellDeN:\n" doSendAnimatedText(getThingPos(uid), "+POINT+", _CTF_LIB.flags[bant].color) for a, b in pairs (_CTF_LIB.flags) do if (getGlobalStorageValue(a-15) < 0) then setGlobalStorageValue(a-15, 0) end msgi = msgi .. "\n Time ".. b.na .." -> ".. getGlobalStorageValue(a-15) .. " point(s)." end for _, b in pairs (getOnlinePlayers()) do local b = getPlayerByNameWildcard(b) if (getPlayerStorageValue(b, _CTF_LIB.teamssto) > 0) then doPlayerSendTextMessage(b, 22, getCreatureName(uid) .. " entregou a bandeira do time ".. _CTF_LIB.flags[bant].na .. " e obteve 1 ponto para seu time!") doPlayerSendTextMessage(b, 27, msgi) end end for a, b in pairs(_CTF_LIB.flags) do if (getGlobalStorageValue(a-15) >= _CTF_LIB.winp) then for c, _ in pairs(_CTF_LIB.flags) do setGlobalStorageValue(c-15, 0) end for _, cid in pairs (getOnlinePlayers()) do local cid = getPlayerByNameWildcard(cid) if (getPlayerStorageValue(cid, _CTF_LIB.teamssto) > 0) then doPlayerSendTextMessage(cid, 27, "O Time ".. _CTF_LIB.flags[team].na .." venceu o Capture The Flag, por tanto todos os membros dessa equipa ganharam uma recompensa. Parabéns!") if (getPlayerStorageValue(cid, _CTF_LIB.teamssto) == a) then for _, y in pairs(_CTF_LIB.recompCTF) do doPlayerAddItem(cid, y[1], y[2]) end end doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doPlayerSetTown(cid, _CTF_LIB.TownExit); doTeleportThing(cid, getTownTemplePosition(_CTF_LIB.TownExit)) doCreatureSetSkullType(cid, 0) doRemoveCondition(cid, CONDITION_PARAM_OUTFIT) setPlayerStorageValue(cid, _CTF_LIB.teamssto, -1) end end break end end return true end UP UPPPPPPPPPPPPPPPP Editado Julho 13, 2014 10 anos por cocazul (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.