-
Total de itens
926 -
Registro em
-
Última visita
-
Dias Ganhos
18
Tudo que Danihcv postou
-
action Talkaction para retirar premium points do Site
pergunta respondeu ao Dennyz Dias de Danihcv em Scripts
Não entendi direito o q vc quis dizer... sahusahu Mas eu já botei pra que o player possa usar: !sacar QUANTIA !saldo !depositar QUANTIA -
action Talkaction para retirar premium points do Site
pergunta respondeu ao Dennyz Dias de Danihcv em Scripts
Então, nesse caso. Aqui vai, @@Dennyz Dias: Vá em data\talkactions e adicione essa tag ao arquivo talkactions.xml: <talkaction words="!sacar;!saldo;!depositar" event="script" value="situationpoints.lua"/> Agora vá em data\talkactions\scripts e crie um arquivo chamado situationpoints.lua e coloque isso dentro: local pointObj = 2160 --id do item "points" function getAccountPoints(cid) local res = db.getResult('SELECT `premium_points` FROM `accounts` WHERE id='..getPlayerAccountId(cid)..'') if(res:getID() == -1) then return false end local ret = res:getDataInt("premium_points") res:free() return tonumber(ret) end function onSay(cid, words, param) if (words == '!sacar') then if param ~= "" then if tonumber(param) <= getAccountPoints(cid) then doPlayerAddItem(cid, pointObj, tonumber(param)) db.executeQuery('UPDATE `accounts` SET `premium_points`='..getAccountPoints(cid) - tonumber(param)..' WHERE id='.. getPlayerAccountId(cid)..'') newPoints = getAccountPoints(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Você ainda possui '..newPoints..' premium points em sua conta.') else doPlayerSendCancel(cid, "Você não tem tantos premium points assim.") end else doPlayerSendCancel(cid, "Você precisa especificar um valor.") end elseif (words == '!saldo') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Seu saldo no shopping atual é de '..getAccountPoints(cid)..' Premium points.') elseif (words == '!depositar') then if param ~= "" then if tonumber(param) <= getPlayerItemCount(cid, pointObj) then doPlayerRemoveItem(cid, pointObj, tonumber(param)) db.executeQuery('UPDATE `accounts` SET `premium_points`='..getAccountPoints(cid) + tonumber(param)..' WHERE id='.. getPlayerAccountId(cid)..'') newPoints = getAccountPoints(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Você acabou de depositar '..param..' premium points no shopping. Seu saldo agora é de '..newPoints..' premium points.') else doPlayerSendCancel(cid, "Você não tem tantos premium points assim.") end else doPlayerSendCancel(cid, "Você precisa especificar um valor.") end end return true end *minha unica duvida é quanto às querys... Vamo ver se desse jeito aí funciona sussa. -
action Talkaction para retirar premium points do Site
pergunta respondeu ao Dennyz Dias de Danihcv em Scripts
@, mano, eu me toquei agr q no teu eu ñ botei todas as funções... Acabei de postar lá o script com todas as 3 talkactions (no seu post). -
Por distração, eu acabei me esquecendo que vc queria 3 talkactions. Por isso, aqui está o script final com as 3 talkactions: *lembrando que ñ tenho como testar, e estou me baseando no q me foi dito sobre o tfs 1.2: local pointObj = 2160 --id do item "points" function getAccountPoints(player) local res = db.getResult('SELECT `premium_points` FROM `accounts` WHERE id='..player:getGuid()..'') if(res:getID() == -1) then return false end local ret = res:getDataInt("premium_points") res:free() return tonumber(ret) end function onSay(player, words, param) if (words == '!sacar') then if param ~= "" then if tonumber(param) ~= nil then if 0 >= tonumber(param) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "O valor precisa ser acima de zero.") elseif tonumber(param) <= player:getAccountPoints() then player:addItem(pointObj, param) db.executeQuery('UPDATE `accounts` SET `premium_points`='..player:getAccountPoints() - param..' WHERE id='.. player:getGuid()..'') newPoints = player:getAccountPoints() player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Você ainda possui '..newPoints..' premium points em sua conta.') else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem tantos premium points assim.") end else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "O valor precisa ser um numero.") end else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa especificar um valor.") end elseif (words == '!saldo') then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Seu saldo no shopping atual é de '..player:getAccountPoints()..' Premium points.') elseif (words == '!depositar') then if param ~= "" then if tonumber(param) ~= nil then if 0 >= tonumber(param) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "O valor precisa ser acima de zero.") elseif tonumber(param) <= player:getItemCount(pointObj) then player:removeItem(pointObj, tonumber(param)) db.executeQuery('UPDATE `accounts` SET `premium_points`='..player:getAccountPoints() + tonumber(param)..' WHERE id='.. player:getGuid()..'') newPoints = player:getAccountPoints() player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Você acabou de depositar '..param..' premium points no shopping. Seu saldo agora é de '..newPoints..' premium points.') else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem tantos premium points assim.") end else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "O valor precisa ser um numero.") end else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa especificar um valor.") end end return true end Basta usar uma só tag em talkactions.xml apenas se atente a isso na tag:
-
Amigo, vc tá usando o script antigo, que estava com erro. O certo a usar é esse ultimo que eu postei: function onStepIn(cid, item, position, fromPosition) local tileConfig = { kickPos = fromPosition, kickEffect = CONST_ME_POFF, kickMsg = "Only the worthy may pass.", enterMsg = "Welcome!", enterEffect = CONST_ME_MAGIC_BLUE, } local vocations = {3,4,7} if isInArray(vocations, getPlayerVocation(cid)) then doPlayerSendTextMessage(cid, 25, tileConfig.enterMsg) doSendMagicEffect(position, tileConfig.enterEffect) return true else doTeleportThing(cid, tileConfig.kickPos) doSendMagicEffect(tileConfig.kickPos, tileConfig.kickEffect) doPlayerSendCancel(cid, tileConfig.kickMsg) return true end end
-
action Talkaction para retirar premium points do Site
pergunta respondeu ao Dennyz Dias de Danihcv em Scripts
Só precisa informar qual a table e qual a clomun responsáveis pelo armazenamento dos premium points. ^^ -
@@Vasto Lord X, tem sim. Basta ir acrescentando nessa parte: Segue a nova versão do script, sem erro: function onStepIn(cid, item, position, fromPosition) local tileConfig = { kickPos = fromPosition, kickEffect = CONST_ME_POFF, kickMsg = "Only the worthy may pass.", enterMsg = "Welcome!", enterEffect = CONST_ME_MAGIC_BLUE, } local vocations = {3,4,7} if isInArray(vocations, getPlayerVocation(cid)) then doPlayerSendTextMessage(cid, 25, tileConfig.enterMsg) doSendMagicEffect(position, tileConfig.enterEffect) return true else doTeleportThing(cid, tileConfig.kickPos) doSendMagicEffect(tileConfig.kickPos, tileConfig.kickEffect) doPlayerSendCancel(cid, tileConfig.kickMsg) return true end end
-
Tranquilo... Esse script aqui eu já testei e tá 100%. Falta apenas funcionar aí pra vc... sauhsahuas: function onStepIn(cid, item, position, fromPosition) local tileConfig = { kickPos = fromPosition, kickEffect = CONST_ME_POFF, kickMsg = "Only the worthy may pass.", enterMsg = "Welcome!", enterEffect = CONST_ME_MAGIC_BLUE, } local vocations = {3,4,7} if isInArray(vocations, getPlayerVocation(cid)) then doPlayerSendTextMessage(cid, 25, tileConfig.enterMsg) doSendMagicEffect(position, tileConfig.enterEffect) return true else doTeleportThing(cid, tileConfig.kickPos) doSendMagicEffect(tileConfig.kickPos, tileConfig.kickEffect) doPlayerSendCancel(cid, tileConfig.kickMsg) return true end end ~~agradecimentos ao Matheus Duarte
-
Bom, para que alguem possa oferecer uma ajuda 100% eficiente, é necessário que vc informe qual distro vc usa, e que ponha um link para mostrar qual o frag system q vc está usando exatamente.
-
@@brendoonh, o erro está reportando que não conseguiu encontrar o arquivo. Pf, garanta de que a instalação dos scripts foi feita de forma correta. *de acordo com o erro, vc precisa btoar o nome do script como: portapala.lua
-
descoberto (AoM) Adivinhe o Mapa #07
tópico respondeu ao Administrador de Danihcv em Concursos e Eventos
Parque de diversão. -
Tópico movido para dúvidas / pedidos resolvidos.
-
Vá em data\movements e adicione essa tag ao arquivo movements.xml: <movevent type="StepIn" actionid="5876" event="script" value="pisovoc.lua"/> Agora adicione a action id 5876 ao piso que fica em baixo da porta, pois é o action que está configurado na tag acima. Agora vá em data\movements\scripts e crie um arquivo chamado pisovoc.lua e coloque o script q eu mandei acima.
-
@, manda como vc deixou as coisas.
-
sahusauhas, então de boa. Acredito que agr só apareça uma mensagem de "olá": local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 -------------------------- ----PARTE CONFIGURAVEL---- -------------------------- local msgs = { ['mysterious island'] = 'É uma ilha que antigos diziam ficar ao sudoeste de Carlin. Há um teleport que dizem aparecer nos pântanos de Venore, talvez, ele leve a essa ilha.', ['second promotion'] = 'Há um NPC que vem de muito longe e fica a caminhas pelos campos de Thais, dizem que ele pode dar a segunda vocação para os aventureiros.', } local voc = 3 ----------------------------- --FIM DA PARTE CONFIGURAVEL-- ----------------------------- function greetCallback(cid) npcHandler:say('Olá, '..getCreatureName(cid)..'. O que você procura? {Informações}?', cid) return true end function creatureSayCallback(cid, type, msg) if msgcontains(string.lower(msg), 'informações') then if getPlayerVocation(cid) == voc then npcHandler:say('Sobre o que você quer saber? Sobre a {mysterious island} ou sobre a {second promotion}?', cid) for k, v in pairs(msgs) do if msgcontains(string.lower(msg), v) then npcHandler:say(msgs[v], cid) return true end end else npcHandler:say('Perai, você é '..getVocationInfo(getPlayerVocation(cid)).name..'?! Não falo com gente do seu tipo.', cid) npcHandler:resetNpc(cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
Urrgh.... local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 -------------------------- ----PARTE CONFIGURAVEL---- -------------------------- local msgs = { ['mysterious island'] = 'É uma ilha que antigos diziam ficar ao sudoeste de Carlin. Há um teleport que dizem aparecer nos pântanos de Venore, talvez, ele leve a essa ilha.', ['second promotion'] = 'Há um NPC que vem de muito longe e fica a caminhas pelos campos de Thais, dizem que ele pode dar a segunda vocação para os aventureiros.', } local voc = 3 ----------------------------- --FIM DA PARTE CONFIGURAVEL-- ----------------------------- function greetCallback(cid) npcHandler:say('Olá, '..getCreatureName(cid)..'. O que você procura? {Informações}?', cid) return true end function creatureSayCallback(cid, type, msg) if msgcontains(string.lower(msg), 'informações') then if getPlayerVocation(cid) == voc then npcHandler:say('Sobre o que você quer saber? Sobre a {mysterious island} ou sobre a {second promotion}?', cid) for k, v in pairs(msgs) do if string.lower(msg) == 'bye' then npcHandler:resetNpc(cid) elseif msgcontains(msg, v) then npcHandler:say(msgs[v], cid) return true end end else npcHandler:say('Perai, você é '..getVocationInfo(getPlayerVocation(cid)).name..'?! Não falo com gente do seu tipo.', cid) npcHandler:resetNpc(cid) end end return true end npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Mais tarde eu dou um jeito de arranjar um modo pra testar os scripts... Pra não ficar passando trocentos scripts sem saber se tão 100%. Até lá, não perca a paciência. sauhsauhsa
-
Puta vida, mano... Uma hora a gnt consegue. sahusahus .xml: <?xml version="1.0" encoding="UTF-8"?> <npc name="Ezequiel" script="data/npc/scripts/Ezequiel.lua" walkinterval="1500" speed="100" walkradius="2" floorchange="0"> <health max="100" now="100"/> <look type="130" head="0" body="64" legs="67" feet="114" addons="1" mount="0"/> <parameter key="message_greet" value="Olá, |PLAYER NAME|. O que você procura? {Informações}?"/> </npc> .lua: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 -------------------------- ----PARTE CONFIGURAVEL---- -------------------------- local msgs = { ["mysterious island"] = "É uma ilha que antigos diziam ficar ao sudoeste de Carlin. Há um teleport que dizem aparecer nos pântanos de Venore, talvez, ele leve a essa ilha.", ["second promotion"] = "Há um NPC que vem de muito longe e fica a caminhas pelos campos de Thais, dizem que ele pode dar a segunda vocação para os aventureiros.", } local voc = 3 ----------------------------- --FIM DA PARTE CONFIGURAVEL-- ----------------------------- function creatureSayCallback(cid, type, msg) if msgcontains(string.lower(msg), 'informações') then if getPlayerVocation(cid) == voc then for k, v in pairs(msgs) do if string.lower(msg) == 'bye' then npcHandler:resetNpc(cid) elseif msgcontains(msg, v) then npcHandler:say(msgs[v], cid) end end else npcHandler:say('Perai, você é '..getVocationInfo(getPlayerVocation(cid)).name..'?! Não falo com gente do seu tipo.', cid) npcHandler:releaseFocus(cid) end end return true end npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
Tópico movido para dúvidas / pedidos resolvidos.
-
Qual o sript.xml que vc tá usando no npc? De qqr forma, tenta assim o .lua: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 -------------------------- ----PARTE CONFIGURAVEL---- -------------------------- local msgs = { ["mysterious island"] = "É uma ilha que antigos diziam ficar ao sudoeste de Carlin. Há um teleport que dizem aparecer nos pântanos de Venore, talvez, ele leve a essa ilha.", ["second promotion"] = "Há um NPC que vem de muito longe e fica a caminhas pelos campos de Thais, dizem que ele pode dar a segunda vocação para os aventureiros.", } local voc = 3 ----------------------------- --FIM DA PARTE CONFIGURAVEL-- ----------------------------- local function greetCallback(cid) if getPlayerVocation(cid) == voc then npcHandler:say('Olá, '..getCreatureName(cid)..'. Sobre o que você quer saber? Sobre a {mysterious island} ou sobre a {second promotion}?', cid) npcHandler:addFocus(cid) else npcHandler:say('Eu não falo com '..getVocationInfo(getPlayerVocation(cid)).name..'s.', cid) npcHandler:releaseFocus(cid) return true end return false end function creatureSayCallback(cid, type, msg) for k, v in pairs(msgs) do if string.lower(msg) == 'bye' then npcHandler:resetNpc(cid) elseif msgcontains(msg, v) then npcHandler:say(msgs[v], cid) end end return true end npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 -------------------------- ----PARTE CONFIGURAVEL---- -------------------------- local msgs = { ["mysterious island"] = "É uma ilha que antigos diziam ficar ao sudoeste de Carlin. Há um teleport que dizem aparecer nos pântanos de Venore, talvez, ele leve a essa ilha.", ["second promotion"] = "Há um NPC que vem de muito longe e fica a caminhas pelos campos de Thais, dizem que ele pode dar a segunda vocação para os aventureiros.", } local voc = 3 ----------------------------- --FIM DA PARTE CONFIGURAVEL-- ----------------------------- local function greetCallback(cid) if getPlayerVocation(cid) == voc then npcHandler:say('Olá, '..getCreatureName(cid)..'. Sobre o que você quer saber? Sobre a {mysterious island} ou sobre a {second promotion}?', cid) npcHandler:addFocus(cid) else npcHandler:say('Eu não falo com '..getVocationInfo(getPlayerVocation(cid)).name..'s.', cid) npcHandler:releaseFocus(cid) return true end return false end function creatureSayCallback(cid, type, msg) if string.lower(msg) == 'bye' then npcHandler:resetNpc(cid) return false end for k, v in pairs(msgs) do if msgcontains(msg, v) then npcHandler:say(msgs[v], cid) end end return true end npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
descoberto (AoM) Adivinhe o Mapa #07
tópico respondeu ao Administrador de Danihcv em Concursos e Eventos
loja de artigos diversos. -
@@lol08, é necessário muito mais detalhes sobre esse sistema. Caso seja algo que vc imaginou, detalhe o que este system é suposto a fazer. Caso seja algo que vc viu, diga onde viu e diga o que exatamente vc espera que o system faça. Também não esqueça de informar a versão da sua distro.
-
Ok... Vamos tentar outra coisa. Remova o action id da porta. Adicione o action id ao piso da porta. script.lua: local voc = {3, 7} --vocações que podem acessar a porta function onStepIn(cid, frompos) for k, v in pairs(voc) do if getPlayerVocation(cid) == v then doSendMagicEffect(getCreaturePosition(cid), 2) else doPlayerSendCancel(cid, "Only the worthy may pass.") doTeleportThing(cid, frompos) end end return true end *atenção! O script agora é um movement. Caso não saiba instalá-lo, avisa que eu ensino.
-
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 -------------------------- ----PARTE CONFIGURAVEL---- -------------------------- local msgs = { ["mysterious island"] = "É uma ilha que antigos diziam ficar ao sudoeste de Carlin. Há um teleport que dizem aparecer nos pântanos de Venore, talvez, ele leve a essa ilha.", ["second promotion"] = "Há um NPC que vem de muito longe e fica a caminhas pelos campos de Thais, dizem que ele pode dar a segunda vocação para os aventureiros.", } local msgAccept = 'Olá, '..getCreatureName(cid)..'. Sobre o que você quer saber? Sobre a {mysterious island} ou sobre a {second promotion}?' local msgDenied = 'Eu não falo com '..getVocationInfo(getPlayerVocation(cid)).name..'s.' local voc = 3 ----------------------------- --FIM DA PARTE CONFIGURAVEL-- ----------------------------- local function greetCallback(cid) if getPlayerVocation(cid) == voc then npcHandler:say(msgAccept, cid) npcHandler:addFocus(cid) else npcHandler:say(msgDenied, cid) npcHandler:releaseFocus(cid) return true end return false end function creatureSayCallback(cid, type, msg) if string.lower(msg) == 'bye' then npcHandler:resetNpc(cid) return false end for k, v in pairs(msgs) do if msgcontains(msg, v) then npcHandler:say(msgs[v], cid) end end return true end npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.