Ir para conteúdo

Vodkart

Héroi
  • Registro em

Tudo que Vodkart postou

  1. function onSay(cid, words, param) local t = string.explode(param, ",") if(not t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end local tid = getPlayerByNameWildcard(t[1]) if not tid and not getPlayerGUIDByName(t[1]) then doPlayerSendCancel(cid, "Você deve digitar um Nome Válido.") return true end if tid then setPlayerStorageValue(tid, t[2], t[3]) else local Guid = getPlayerGUIDByName(t[1]) local Query = db.getResult("SELECT `value` FROM `player_storage` WHERE `player_id` = ".. Guid .." AND `key` = ".. t[2]) if (Query:getID() ~= -1) then db.executeQuery("UPDATE `player_storage` SET `value` = "..t[3].." WHERE `player_id` = ".. Guid .." AND `key` = "..t[2]) else db.executeQuery("INSERT INTO `player_storage` (`player_id`, `key`, `value`) VALUES (" .. Guid .. ", " .. t[2] .. ", " .. t[3] .. ");") end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Storage mudada com sucesso.") return true end
  2. @ghunalma Testou o meu?
  3. function onSay(cid, words, param) local t = string.explode(param, ",") if(not t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end local tid = getPlayerByNameWildcard(t[1]) if not tid and not getPlayerGUIDByName(t[1]) then doPlayerSendCancel(cid, "Você deve digitar um Nome Válido.") return true end if tid then setPlayerStorageValue(tid, t[2], t[3]) else local Guid = getPlayerGUIDByName(t[1]) local Query = db.getResult("SELECT `value` FROM `player_storage` WHERE `player_id` = ".. Guid .." AND `key` = ".. t[2]) if (Query:getID() ~= -1) then db.executeQuery("UPDATE `player_storage` SET 'value' = "..t[3].." WHERE `player_id` = ".. Guid .." AND `key` = "..t[2]) else db.executeQuery("INSERT `player_storage` SET `key` = "..t[2]..", 'value' = "..t[3]..", WHERE `player_id` = " .. Guid) end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Storage mudada com sucesso.") return true end
  4. Tanto online quanto offline?
  5. function onUse(cid, item, fromPos, item2, count, toPos) local _ = { [1] = {aid = 1234, item = 2160, amount = 25}, -- Aqui gostaria de colocar a quantidade 25 e colocar mais de um item em um unico bau. [2] = {aid = 1235, item = 2195, amount = 10}, [3] = {aid = 1231, item = 3121, amount = 1}, } for i = 1, #_ do _.storage = 202049 + i end for i, valor in ipairs(_) do if item.actionid == valor.aid then if getPlayerFreeCap(cid) >= getItemWeightById(valor.item, valor.amount) then if getPlayerStorageValue(cid, valor.storage) == -1 then local backpack = doPlayerAddItem(cid, 1999, 1) -- backpackID if isItemStackable(valor.item) or valor.amount == 1 then doAddContainerItem(backpack, valor.item, valor.amount) else for i = 1, valor.amount do doAddContainerItem(backpack, valor.item, 1) end end doPlayerSendTextMessage(cid, 22, 'You have found a '..valor.amount..'x '..getItemNameById(valor.item)..'.') setPlayerStorageValue(cid, valor.storage, 1) else doPlayerSendTextMessage(cid, 22, 'It is empty.') end else doPlayerSendTextMessage(cid, 22, 'You have found a '..getItemNameById(valor.item)..'. It weighs '..getItemWeightById(valor.item, valor.amount)..'.00 and it is too heavy.') end break end end return true end
  6. Que estranho, parece que não existe essa coluna.
  7. executa essa query: CREATE TABLE npc_quest ( create INT NOT NULL DEFAULT 0, PRIMARY KEY ( id ) ); e usa o script assim: local pos = {x=875,y=398,z=7} -- Local do NPC local npc = "GoblinAssustadoOesteCidade" function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if isPlayer(cid) and getPlayerAccess(cid) < 3 then if db.getResult("SELECT `create` FROM `npc_quest`;"):getDataInt("create") <= 0 then doCreateNpc(npc, pos) db.executeQuery("UPDATE `npc_quest` SET `create` = 1;") end end return true end futuramente, quando for "remover o npc usa esta linha para voltar para 0 db.executeQuery("UPDATE `npc_quest` SET `create` = 0;") ------------------------------------------------------------- ai para dar sequencia a sua quest, e se ele tiver aparecido alguma vez na vida, você usa assim: if db.getResult("SELECT `create` FROM `npc_quest`;"):getDataInt("create") > 0 then -- sim o npc ja foi criado alguma vez end ----------------------------------------------------------------------------------------------- @Tadelho Conseguiu? fiz exatamente o que descreveu... aguardo respostas!
  8. local time = 600 -- tempo em segundos para usar local monster = "Demon" -- "Monstro" entre aspas local pos = {x=805, y=568, z=7} -- Posição que irá nascer. local from,to = {x=790, y=550, z=7},{x=820, y=575, z=7} -- area total da area onde o monstro vai estar function CheckArea(area) local var = 0 for x = area[1].x - 1, area[2].x + 1 do for y = area[1].y - 1, area[2].y + 1 do local pos = {x=x, y=y, z=area[1].z} local m = getTopCreature(pos).uid if m ~= 0 and isMonster(m) then var = var +1 end end end return var end function onUse(cid, item, frompos, itemex, topos) if getStorage(2111) - os.time() < 1 then if CheckArea({from,to}) == 0 then doSetStorage(2111, os.time() + time) addEvent(function() doCreateMonster(monster, pos) end, 10000) doCreatureSay(cid, "Demon Invocado ! Prepare-se !", TALKTYPE_MONSTER) else doPlayerSendCancel(cid, "ja existe um monstro na area") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) return true end else doPlayerSendCancel(cid, "Voce precisa esperar ".. getStorage(2111) - os.time() .." Segundos restantes") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) return true end doTransformItem(item.uid, item.itemid % 2 == 1 and item.itemid + 1 or item.itemid + -1) return true end
  9. Não precisa usar global storage, pega o cid do npc: local pos = {x=875,y=398,z=7} -- Local do NPC local npc = "GoblinAssustadoOesteCidade" function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if isPlayer(cid) and getPlayerAccess(cid) < 3 then local creature = getCreatureByName(npc) if creature ~= nil then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "O NPC ja esta andando por este mapa!.") else doCreateNpc(npc, pos) end end return true end
  10. UÉ, aumenta a chance de dar certo. por exemplo onde está chance 5, troca por 60 por exemplo kk só ir aumentando
  11. pode usar assim: DELETE FROM player_items WHERE itemtype IN ('2494', '2495', '2646'); ali dentro vc coloca o ID dos itens.
  12. Vodkart postou uma resposta no tópico em Ouvidoria
    @Matk @Bruno Carvalho
  13. Vodkart postou uma resposta no tópico em Ouvidoria
    Gostaria de estar resgatando as imagens, código e texto de alguns tópicos no MERCADO mas me aparece isso: Algo deu errado! Não conseguimos localizar o item que você está tentando visualizar Código do erro: 2D161/2 Links do tópico: só quero copiar o que está ali
  14. function getResets(cid) local check = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..getPlayerGUID(cid)) return check:getDataInt("reset") <= 0 and 0 or check:getDataInt("reset") end function onUse(cid, item, frompos, item2, topos) local reset_need = 5 if getResets(cid) < reset_need then return doPlayerSendTextMessage(cid, 22, "Voce precisa de " .. reset_need .. " resets ou mais para entrar.") end pos = getPlayerPosition(cid) if pos.x == topos.x then if pos.y < topos.y then pos.y = topos.y + 1 else pos.y = topos.y - 1 end elseif pos.y == topos.y then if pos.x < topos.x then pos.x = topos.x + 1 else pos.x = topos.x - 1 end else doPlayerSendTextMessage(cid,22,"Fique na frente da porta.") return true end doTeleportThing(cid,pos) doSendMagicEffect(topos,12) return true end
  15. coloca pra quando o monstro morrer na hora que virar o "tile", seja dado um AID e faz um movements para o player n poder passar por cima dele.
  16. vc quer que seja obrigado a entrar 2 players? e ambos com level 420 +?
  17. @Brunds esqueci a função main kkk function getPlayersInArea(from, to) local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), from, to) then t[#t+1] = pid end end return t end local config = { limit = 1, -- limite de jogador na area from = {x = 1518, y = 1159, z = 15}, --começo da area to = {x = 1534, y = 1174, z = 15}, -- final da area playerDestiny = {x = 1077, y = 783, z = 6} -- para onde o player vai } function onUse(cid, item, frompos, item2, topos) if #getPlayersInArea(config.from, config.to) >= config.limit then doPlayerSendCancel(cid, 'Alguem Ja Esta Na Area.') doSendMagicEffect(getThingPos(cid), 2) return true end doTeleportThing(cid, config.playerDestiny) doPlayerSendTextMessage(cid, 20, "Boa Sorte!") doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end
  18. function getPlayersInArea(from, to) local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), from, to) then t[#t+1] = pid end end return t end local config = { limit = 1, -- limite de jogador na area from = {x = 1518, y = 1159, z = 15}, --começo da area to = {x = 1534, y = 1174, z = 15}, -- final da area playerDestiny = {x = 1077, y = 783, z = 6} -- para onde o player vai } if #getPlayersInArea(config.from, config.to) >= config.limit then doPlayerSendCancel(cid, 'Alguem Ja Esta Na Area.') doSendMagicEffect(getThingPos(cid), 2) return true end doTeleportThing(cid, config.playerDestiny) doPlayerSendTextMessage(cid, 20, "Boa Sorte!") doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end vc pega o X,Y,Z do "from" até o "to"! obs: é do MENOR pro MAIOR, exemplo aqui: from = {x = 1518, y = 1159, z = 15}, to = {x = 1534, y = 1174, z = 15} nunca assim: to = {x = 1518, y = 1159, z = 15}, from = {x = 1534, y = 1174, z = 15}
  19. local c = { limit = 1, -- Limite de jogadores msgCancel = 'Ainda tem gente la dentro', -- Mensagem quando o limite de jogadores estiver atingido area = { From = {x = 1826, y = 1834, z = 7}, -- Coordenada maxima superior esquerda To = {x = 1832, y = 1840, z = 7}, -- Coordenada minima inferior direita }, pos = {x = 1825, y = 1837, z = 7}, -- Coordenada onde será teletransportado pos1 = {x = 1834, y = 1837, z = 7}, -- Coordenada onde será teletransportado } local function getPlayersInArea(fromPos, toPos) local t = {} for _, cid in ipairs(getPlayersOnline()) do if isInRange(getThingPos(cid), fromPos, toPos) then table.insert(t, cid) end end return t end local function DoKickPlayerFromArea(cid, delay) local exit = {x = 154, y = 160, z = 7} -- defina para onde ele vai if not isCreature(cid) or not isInRange(getThingPos(cid), c.area.From, c.area.To) then return LUA_ERROR end if delay > 0 then doSendAnimatedText(getThingPos(cid), delay, 145) addEvent(DoKickPlayerFromArea, 1000, cid, delay-1) else doTeleportThing(cid, exit) end return true end function onUse(cid, item, fromPos, itemEx, toPos) if table.getn(getPlayersInArea(c.area.From, c.area.To)) < c.limit then doSendMagicEffect(fromPos, CONST_ME_TELEPORT) doTeleportThing(cid, c.pos) DoKickPlayerFromArea(cid, 5) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) else doPlayerSendCancel(cid, c.msgCancel) end return true end
  20. nesse caso não precisa colocar nada na linha da box, porque o script vai checar se ele está dentro da sala ainda... :D
  21. Ao meu ver você é o meu vagalume, sempre mostrando o brilho e piscando a sua bunda pra mim
  22. local config = { cooldown = 20, -- tempo entre uma magia e outra duration = 10, --- duração storage = 3482101, effect = 34 --- efeito que vai sair } local function effect(cid) if not isCreature(cid) or getPlayerStorageValue(cid, config.storage) - os.time() <= 0 then return LUA_ERROR end local pos = {x=getPlayerPosition(cid).x+2, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} doSendMagicEffect(pos, config.effect) addEvent(effect, 400, cid) end function onCastSpell(cid, var) if os.time() - getPlayerStorageValue(cid, 55695) >= config.cooldown then setPlayerStorageValue(cid, 55695, os.time()) doPlayerSendTextMessage(cid, 27, "Seu kaiten vai durar ".. config.duration .." segundos.") setPlayerStorageValue(cid, config.storage, os.time() + config.duration) effect(cid) else doPlayerSendChannelMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce tem que esperar "..(config.cooldown - (os.time() - getPlayerStorageValue(cid, 55695))).." segundos para usar novamente.", TALKTYPE_CHANNEL_O, CHANNEL_SPELL) return false end return true end
  23. local c = { limit = 1, -- Limite de jogadores msgCancel = 'Ainda tem gente la dentro', -- Mensagem quando o limite de jogadores estiver atingido area = { From = {x = 1826, y = 1834, z = 7}, -- Coordenada maxima superior esquerda To = {x = 1832, y = 1840, z = 7}, -- Coordenada minima inferior direita }, pos = {x = 1825, y = 1837, z = 7}, -- Coordenada onde será teletransportado pos1 = {x = 1834, y = 1837, z = 7}, -- Coordenada onde será teletransportado } local function getPlayersInArea(fromPos, toPos) local t = {} for _, cid in ipairs(getPlayersOnline()) do if isInRange(getThingPos(cid), fromPos, toPos) then table.insert(t, cid) end end return t end local function DoKickPlayerFromArea(cid) local exit = {x = 154, y = 160, z = 7} -- defina para onde ele vai if not isCreature(cid) then return LUA_ERROR end if isInRange(getThingPos(cid), c.area.From, c.area.To) then doTeleportThing(cid, exit) end return true end function onUse(cid, item, fromPos, itemEx, toPos) if table.getn(getPlayersInArea(c.area.From, c.area.To)) < c.limit then doSendMagicEffect(fromPos, CONST_ME_TELEPORT) doTeleportThing(cid, c.pos) addEvent(DoKickPlayerFromArea, 5000, cid) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) else doPlayerSendCancel(cid, c.msgCancel) end return true end
  24. Sim, justamente por isso que perguntei qual seria a ideia dele, ou poderia colocar a storage -1 para qndo entrasse na sala, etc... É esboço;

Informação Importante

Confirmação de Termo