Postado Abril 1, 2017 8 anos Autor 2 horas atrás, KotZletY disse: @jNo não é algo complexo, é simples, me passa o script, que adiciono o check nele, se ele tiver o item, ele consegui usar a spell, se não tiver, ele não usa, esse check do item deve ser feito diretamente na spell. Você não tem essa exiva que falou ? Seu pedido é esse comando que mostre o último bixo que "fulano" matou ? Seja mais especifico amigo. Já que não citou o assunto sobre o chat open, suponho que tenha entendido, membros postaram o código que se deve adicionar na source, olhe na área de programação, ou no perfil do alexy, ele postou o mesmo para a versão 0.4. @KotZletY Faça em forma de talk um script que mostra o ultimo monstro morto pelo jogador X, com as característica que citei acima: (1º) | [8.60] - Galaxy Server - Download (2º) | [8.60] - Glorious Server - Download (3º) | [8.60] - Epic Server - Download
Postado Abril 2, 2017 8 anos Solução @jNo qual a versão do seu tfs ? @Edit: fiz como você pediu, qualquer coisa avisa: data/creaturescripts/scripts crie um arquivo com a extensão Lua, com o nome de spyplayer.lua ou qualquer nome desejado, e coloque esse code dentro: Spoiler function onKill(cid, target) if isMonster(target) then setPlayerStorageValue(cid, 99882, getCreatureName(target)) end return true end ainda na pasta scripts abra o arquivo login.lua o e registre esse event: registerCreatureEvent(cid, "SpyPlayer") agora vá em data/creaturescripts e abra o arquivo creaturescripts.xml e adicione essa tag dentro dele; <event type="kill" name="SpyPlayer" event="script" value="spyplayer.lua"/> agora vá em data/talkactions/scripts e cria um arquivo chamado spyplayer.lua ou o nome desejado, dentro dele coloque esse code: Spoiler function onSay(cid, words, param, channel) local v = { item = 2160, -- id do item time = 3 -- tempo em segundos que ficará sem usar o comando } local txt = "[--> Player Spy <--]\n\n" local p = string.explode(param, '"') if getPlayerItemCount(cid, v.item) >= 1 then if getPlayerStorageValue(cid, v.storage) < os.time() then if p[2] then if getPlayerByName(p[2]) then if getPlayerStorageValue(getPlayerByName(p[2]), 99882) == -1 then txt = txt .. "Esse player ainda não matou nenhum monstro." else txt = txt .. "O último monstro que esse player matou foi: "..getPlayerStorageValue(getPlayerByName(p[2]), 99882).."." return setPlayerStorageValue(cid, v.storage, os.time()+v.time), doPlayerPopupFYI(cid, txt) end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "O nome do player está errado ou não existe.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Digite o nome do player que deseja.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Espere "..getPlayerStorageValue(cid, v.storage) - os.time().." segundos para usar o comando novamente.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você precisa de tal item para poder usar o comando.") end return true end em data/talkactions abra o arquivo chamado talkactions.xml dentro dele adicione a seguinte tag: <talkaction words="!exivaspy" event="script" value="spyplayer.lua"/> Agora basta configurar a gosto e já era!
Postado Abril 2, 2017 8 anos Autor 9 horas atrás, KotZletY disse: @jNo qual a versão do seu tfs ? @Edit: fiz como você pediu, qualquer coisa avisa: data/creaturescripts/scripts crie um arquivo com a extensão Lua, com o nome de spyplayer.lua ou qualquer nome desejado, e coloque esse code dentro: Ocultar conteúdo function onKill(cid, target) if isMonster(target) then setPlayerStorageValue(cid, 99882, getCreatureName(target)) end return true end ainda na pasta scripts abra o arquivo login.lua o e registre esse event: registerCreatureEvent(cid, "SpyPlayer") agora vá em data/creaturescripts e abra o arquivo creaturescripts.xml e adicione essa tag dentro dele; <event type="kill" name="SpyPlayer" event="script" value="spyplayer.lua"/> agora vá em data/talkactions/scripts e cria um arquivo chamado spyplayer.lua ou o nome desejado, dentro dele coloque esse code: Ocultar conteúdo function onSay(cid, words, param, channel) local v = { item = 2160, -- id do item time = 3 -- tempo em segundos que ficará sem usar o comando } local txt = "[--> Player Spy <--]\n\n" local p = string.explode(param, '"') if getPlayerItemCount(cid, v.item) >= 1 then if getPlayerStorageValue(cid, v.storage) < os.time() then if p[2] then if getPlayerByName(p[2]) then if getPlayerStorageValue(getPlayerByName(p[2]), 99882) == -1 then txt = txt .. "Esse player ainda não matou nenhum monstro." else txt = txt .. "O último monstro que esse player matou foi: "..getPlayerStorageValue(getPlayerByName(p[2]), 99882).."." return setPlayerStorageValue(cid, v.storage, os.time()+v.time), doPlayerPopupFYI(cid, txt) end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "O nome do player está errado ou não existe.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Digite o nome do player que deseja.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Espere "..getPlayerStorageValue(cid, v.storage) - os.time().." segundos para usar o comando novamente.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você precisa de tal item para poder usar o comando.") end return true end em data/talkactions abra o arquivo chamado talkactions.xml dentro dele adicione a seguinte tag: <talkaction words="!exivaspy" event="script" value="spyplayer.lua"/> Agora basta configurar a gosto e já era! Olá, esta exatamente como eu pedi, mas quando eu digito o !exivaspy Fulano, ele só fica mandando essa mensagem e não da erros no distro: 07:17 Digite o nome do player que deseja. Editado Abril 2, 2017 8 anos por jNo (veja o histórico de edições) (1º) | [8.60] - Galaxy Server - Download (2º) | [8.60] - Glorious Server - Download (3º) | [8.60] - Epic Server - Download
Postado Abril 2, 2017 8 anos @jNo não da erro porque o code ta funcionando 100%, !exivaspy "fulano não esqueça da aspa antes do nome.
Postado Abril 3, 2017 8 anos Autor 16 horas atrás, KotZletY disse: @jNo não da erro porque o code ta funcionando 100%, !exivaspy "fulano não esqueça da aspa antes do nome. Tem razão, obrigado amigo, funcionou perfeitamente! (1º) | [8.60] - Galaxy Server - Download (2º) | [8.60] - Glorious Server - Download (3º) | [8.60] - Epic Server - Download
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.