Ir para conteúdo

caotic

Infante
  • Total de itens

    1599
  • Registro em

  • Última visita

  • Dias Ganhos

    7

Tudo que caotic postou

  1. Crie um arquivo lua em actions chamado de itens e coloque isto local config = { pos = {x=1497, y=1488, z=5}, ---- A posição aonde vai ser teleportado item = 33821 ---- Item que ele vai ganhar } function onUse(cid, item, fromPosition, itemEx, toPosition) doPlayerAddItem(cid, config.item) doTeleportThing(cid, config.pos) return true end Tag: <action uniqueid="82124" event="script" value="itens.lua"/> Agora basta colocar o uniqueid na alavanca.
  2. Sim. Coloque a tag em actions.xml: <action itemid="2146" event="script" value="sum.lua"/>
  3. function onUse(cid, item, frompos, item2, topos) if #getCreatureSummons(cid) > 0 then doPlayerSendCalcel(cid, "Você já sumono um monstro.") return true end local MyCreature = doSummonCreature("super mac",topos) doConvinceCreature(cid, MyCreature) if item.type > 1 then doChangeTypeItem(item.uid,item.type-1) else doRemoveItem(item.uid,1) end return 1 end
  4. Que legal
  5. caotic

    NPC DE NATAL

    Para ficar mais bonito. Eu fiz um npc de natal que da 1 item da array. E so você ir adiciona o item. Para ganhar um presente diga "natal". Para ver a lista dos itens que pode ganhar diga "itens" local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) local x = {2122, 2123, 2387, 2462} ---- Itens que ele PODE ganhar ou seja ele so ganhara 1 item desta array(Se quiser adicionar mais itens coloque aki) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid function getValueRandomArray(x) local random = math.random(1, #x) return x[random] end function getValuersArray(cid, x) k = 0 str = "Itens do natal oh oh:\n\n" while k < #x do k = k+1 local array = x[k] local itens = getItemNameById(array) str = str .. itens.. "\n" end return str end if msgcontains(msg, 'itens') then local array = getValuersArray(cid, x) doShowTextDialog(cid, 1397, array) return true end if msgcontains(msg, 'natal') then if getPlayerStorageValue(cid, 22166) >= 1 then selfSay('Oh oh você ja ganhou o presente mais te desejo FELIZ NATAL', cid) return true end local item = getValueRandomArray(x) doPlayerSendTextMessage(cid,22,"Toma seu presente Feliz Natal oh oh.") doPlayerAddItem(cid, item) setPlayerStorageValue(cid, 22166, 1) else selfSay('Oh fale natal que te darei seu presente ou itens para saber que itens pode ganhar', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  6. Tópico movido para a seção de dúvidas e pedidos resolvidos.
  7. Cometi um pequeno erro. Deixei a verificação por igualdade sendo que e diferença :S. Já editei pega o script que postei
  8. Hahaha vo banir vcs tudo. Eu so ameaço
  9. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) local pos = {x=1039, y=1072, z=7} -- Local da hunt local posreturn = {x=1039, y=1072, z=7} -- Posiçao onde o player sera teleportado quando acabar o tempo local money = 400000 --- Quanto de dinheiro sera removido config = { time = 1, ---Tempo que ele vai ficar na hunt sabendo que cada numeral equivale a um minuto----- str = 2124, --- Storage que ele necessita msg = "Você não pode entrar" --- Mensagem que irá aparecer se ele não tiver a storage } function doReturnPos() doTeleportThing(cid, posreturn) setGlobalStorageValue(24688, 0) setGlobalStorageValue(24686, none) setPlayerStorageValue(cid, 28680, 0) end if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'chuunin') then if getPlayerStorageValue(cid, config.str) ~= 1 then doPlayerSendTextMessage(cid,22, config.msg) return true end if getGlobalStorageValue(24688) == 1 then doPlayerSendTextMessage(cid,22,"O player "..getGlobalStorageValue(24686).." esta fazendo o teste") return true end if not doPlayerRemoveMoney(cid, money) then doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." precisa de "..money.." para fazer o chuunin teste") return true end doPlayerRemoveMoney(cid, money) doPlayerSendTextMessage(cid,22,"Obrigado "..getPlayerName(cid).." foi teleportado.") doTeleportThing(cid, pos) setGlobalStorageValue(24688, 1) setGlobalStorageValue(24686, getPlayerName(cid)) setPlayerStorageValue(cid, 28680, 1) addEvent(doReturnPos, config.time*60*1000) else selfSay('Diga chuunin', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  10. Deixa eu aumentar a lista. Pera ae.
  11. @Slicer. Também da para fazer while. Só que vai consumir mais linhas k = 0 player = getPlayersOnline() storage = 2123 setPlayerStorageValue(cid, 2123, 1) while k < #player do k = k+1 if getPlayerStorageValue(player[k], storage) >= 1 then doTeleportThing(cid, getPlayerPosition(player[k])) doSendMagicEffect(getPlayerPosition(cid), 21) break end end return true end Enfim Cada um com sua preferencia
  12. Muito bom luckOake Pelo menos desta vez não uso a bosta de MODS. OneShot e sobrenatural mesmo ehauehuaheaueha'
  13. Tonynh e uma ótima pessoa e tenho certeza que ele irá fazer um excelente trabalho. Parabéns Tonynh.
  14. Sei la velho. Acho que vai funcionar 8.54. Tenta ai.
  15. Sim. Ele ta bem limitadinho como eu disse. Pretendo fazer uma versão melhor
  16. Vamos ler a as regras HeelSpy. Esta seção serve para postar scripts. Tópico Movido a PEDIDOS E DUVIDAS DE SCRIPTS
  17. Área Incorreta. Tópico Movido
  18. Olha o flood meu amigo. Leia as Regras
  19. Os scripts do luckOake são muito bem elaborados. A única coisa que não entendo. E essa paixão que o luck tem com MODS.
  20. Ola pessoal do ekstibiana. Versões para cima de 9.x foi retirado o sistema de banimento que e muito necessario em ots. Então resolvi desenvolver uma versão "beta" para vocês O sistema ta bem limitadinho mais e funcional. Para banir uma pessoa diga /ban(nome da pessoa,dias,comentario) depois a personagem sera banida e seu ip sera banido. Para ver a lista de banidos fale /banidos Limitações do sistema Vamos a instalar o sistema. GO! Execute o seguinte comando na sua database: CREATE TABLE "ban" ( "player" INT NOT NULL, "ip" INT NOT NULL, "time" INT NOT NULL ); Agora vá em lib e crie um arquivo lua chamado de ban e coloque isto: function doPlayerBan(cid, time, coment) exhaustion.set(cid, 24546, time*3600*24*1000) db.executeQuery("INSERT INTO `ban` VALUES (".. getPlayerGUID(cid) ..", ".. getPlayerIp(cid) ..", ".. time ..")") setPlayerStorageValue(cid, 42622, tostring(coment)) doBroadcastMessage(""..getPlayerName(cid).." foi banido em "..time.." dia(s) por "..coment.."") end function getPlayerBan(cid) return exhaustion.check(cid, 24546) end function getPlayerIPbyBan(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `player` = ".. getPlayerGUID(cid) ..";") return ban:getDataInt("ip") end function getBanTimeByIp(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `ip` = ".. getPlayerIp(cid) ..";") return ban:getDataInt("time") end function getPlayerBanDb(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `player` = ".. getPlayerGUID(cid) ..";") if ban:getID() == -1 then return true end return false end function getPlayerBanIpDb(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `ip` = ".. getPlayerIp(cid) ..";") if ban:getID() == -1 then return true end return false end function getPlayerTimeBan(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `player` = ".. getPlayerGUID(cid) ..";") return ban:getDataInt("time") end function getPlayerIpBan(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `player` ORDER BY `time`") if ban:getID() == -1 then return false end while true do local ips = ban:getDataInt("ip") if getPlayerIp(cid) == ips then return true end if not ban:next() then return false end end end function doShowTextBans(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `player` ORDER BY `time`") str = "Players Banidos:\n\n" if ban:getID() == -1 then doShowTextDialog(cid, 1387, "Não existe nenhum player Banido") return true end while true do local name = ban:getDataInt("player") local time = ban:getDataInt("time") local player = getPlayerNameByGUID(name) str = str .. player .. " - Banido por "..time.." dia(s) \n\n" if not ban:next() then doShowTextDialog(cid, 1397, str) break end end end function doShowTextBansForGroupUp(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `player` ORDER BY `time`") str = "Players Banidos:\n\n" if ban:getID() == -1 then doShowTextDialog(cid, 1387, "Não existe nenhum player Banido") return true end while true do local name = ban:getDataInt("player") local time = ban:getDataInt("time") local ip = ban:getDataInt("ip") local player = getPlayerNameByGUID(name) local ip = doConvertIntegerToIp(ip) str = str .. player .. " - Banido por "..time.." dia(s) Ip "..ip.." \n\n" if not ban:next() then doShowTextDialog(cid, 1397, str) break end end end Agora vá em talkactions e crie um arquivo lua chamado de ban e coloque este codigo: function onSay(cid, words, param, channel) local t = string.explode(param, ",") if param == " " or param == "" or not param or isNumeric(param) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Coloque o nome do player dizendo /ban(nome do player,dias de ban,por que ele foi banido)") end if t[2] == " " or t[2] == "" or not t[2] then return doPlayerSendCancel(cid, "Coloque os dias de ban para o player dizendo /ban(nome do player,dias de ban,por que ele foi banido)") end if t[3] == " " or t[3] == "" or not t[3] then return doPlayerSendCancel(cid, "Coloque os comentarios do player dizendo /ban(nome do player,dias de ban,por que ele foi banido)") end local player = getPlayerByNameWildcard(t[1], false) if not player then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este player "..t[1].." não existe") end doPlayerBan(player, t[2], t[3]) doRemoveCreature(player) return true end Continue em talkactions e crie outra arquivo lua chamado de banidos: function onSay(cid, words, param, channel) if getPlayerGroupId(cid) >= 3 then return doShowTextBansForGroupUp(cid) end doShowTextBans(cid) return true end Coloque as seguintes tags em talkactions.xml: Agora vá em creaturescripts e crie um arquivo lua chamado de ban e coloque isto: function onLogin(cid) if getPlayerBan(cid) then doPlayerPopupFYI(cid, "Você esta banido") return addEvent(doRemoveCreature, 180, cid) end if getPlayerIpBan(cid) then doPlayerPopupFYI(cid, "Foi dectado um ip banido character banido") return addEvent(doRemoveCreature, 180, cid) end return true end Registre o evento em login.lua colocando isto antes do ultimo RETURN: registerCreatureEvent(cid, "ban") Terminado coloque esta tag em creaturescripts.xml:
  21. Tirando os ultimos bugs do banimento system para servidor 9.x
  22. Pelo que Caotic me disse, ele pega a partir do 8.2. Pelo que eu disse? Bem eu testei em 9.1. Acredito eu que vai pegar em 8.6
  23. Eu também me incomodo com os comentários. Na hora de refazer o script fica mais difícil a organização.
  24. caotic

    Alok LF

    Gogo Prezyoso. Começa a banir Ehauheuaheuaheuahe'
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...