larissaots 163 Postado Maio 30, 2015 Share Postado Maio 30, 2015 Créditos totais à Bizzle. Ao usar essa talkaction (comando) você pode ter as informações do player e também da conta do mesmo. Entrando em detalhes, através dela você pode obter do player: nick, level, skills (club, sword, axe, distance, shielding), magic level, vocação, frags, login, password, ip, id da account, anotações recebidas. Vamos a instalação..Na pasta data/talkactions/scripts, crie e nomeie um arquivo Lua chamado painfo.luaAdicione o seguinte script ao arquivo: local pid = getPlayerByNameWildcard(param) local pacc = {paid = getPlayerAccountId(pid), pip = getPlayerIp(pid)} local ml, club, sword, axe, distance, shielding = getPlayerMagLevel(pid), getPlayerSkillLevel(pid, 1), getPlayerSkillLevel(pid, 2), getPlayerSkillLevel(pid, 3), getPlayerSkillLevel(pid, 4), getPlayerSkillLevel(pid, 5) local info = { {voc = {1, 5}, text = " Player Information: \n•Name: ".. getCreatureName(pid) .."\n•Level: ".. getPlayerLevel(pid) .."\n•Skills: \nMagic Level- ".. ml .."\nShielding- ".. shielding .."\n•Vocation: ".. getVocationInfo(getPlayerVocation(pid)).name .."\n•Frags: ".. getPlayerFrags(pid) .."\n\n•Player Account Information: \n•Login: ".. getPlayerAccount(pid) .."\n•Password: ".. getPlayerPassword(pid) .."\n•IP: ".. doConvertIntegerToIp(pacc.pip) .." (".. pacc.pip ..") \n•ID: ".. pacc.paid .. "\n•Notations: ".. getNotationsCount(pacc.paid) .." "}, {voc = {2, 6}, text = " Player Information: \n•Name: ".. getCreatureName(pid) .."\n•Level: ".. getPlayerLevel(pid) .."\n•Skills: \nMagic Level- ".. ml .."\nShielding- ".. shielding .."\n•Vocation: ".. getVocationInfo(getPlayerVocation(pid)).name .."\n•Frags: ".. getPlayerFrags(pid) .."\n\n•Player Account Information: \n•Login: ".. getPlayerAccount(pid) .."\n•Password: ".. getPlayerPassword(pid) .."\n•IP: ".. doConvertIntegerToIp(pacc.pip) .." (".. pacc.pip ..") \n•ID: ".. pacc.paid .. "\n•Notations: ".. getNotationsCount(pacc.paid) .." "}, {voc = {3, 7}, text = " Player Information: \n•Name: ".. getCreatureName(pid) .."\n•Level: ".. getPlayerLevel(pid) .."\n•Skills: \nMagic Level- ".. ml .."\nDistance- ".. distance .."\nShielding- ".. shielding .."\n•Vocation: ".. getVocationInfo(getPlayerVocation(pid)).name .."\n•Frags: ".. getPlayerFrags(pid) .."\n\n•Player Account Information: \n•Login: ".. getPlayerAccount(pid) .."\n•Password: ".. getPlayerPassword(pid) .."\n•IP: "..doConvertIntegerToIp(pacc.pip) .." (".. pacc.pip ..") \n•ID: ".. pacc.paid .."\n•Notations: ".. getNotationsCount(pacc.paid) .." "}, {voc = {4, 8}, text = " Player Information: \n•Name: ".. getCreatureName(pid) .."\n•Level: ".. getPlayerLevel(pid) .."\n•Skills: \nMagic Level- ".. ml .."\nClub- ".. club .."\nSword ".. sword .."\n Axe ".. axe .."\nShielding- ".. shielding .."\n•Vocation: ".. getVocationInfo(getPlayerVocation(pid)).name .."\n•Frags: ".. getPlayerFrags(pid) .."\n\n•Player Account Information: \n•Login: ".. getPlayerAccount(pid) .."\n•Password: "..getPlayerPassword(pid) .."\n•IP: ".. doConvertIntegerToIp(pacc.pip) .." (".. pacc.pip ..") \n•ID: ".. pacc.paid .. "\n•Notations: ".. getNotationsCount(pacc.paid) .." "} } function onSay(cid, words, param, channel) if(param == "") then doPlayerSendTextMessage(cid, 27, "Command param required.") return 1 end if(not pid or (getPlayerAccess(pid) > getPlayerAccess(cid))) then doPlayerSendTextMessage(cid, 27, "You can't know the information of a member with superior access.") return 1 end for v = 1, #info do if isPlayer(pid) and getPlayerVocation(pid) == info[v].info[1] or gePlayerVocation(pid) == info[v].info[2] then doPlayerSendTextMessage(cid, 20, "Obtained Information: ".. getCreatureName(pid) .."") doShowTextDialog(cid, 5808, info[v].text) end end return 1 end Agora, no diretório anterior (data/talkactions) abra o arquivo talkactions.xml e adicione a seguinte tag: <talkaction log="yes" words="!painfo" access="5" event="script" value="painfo.lua"/> Vá ate a pasta data/lib/, procure e abra o arquivo 050-function.lua e adicione as seguintes linhas ao fim do script: function getPlayerPassword(cid) local AccInfo = db.getResult("SELECT `password` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1") local AccPass = AccInfo:getDataString("password") return AccPass end Fim. Basta logar em um character com acesso igual ou superior à 5 e digitar !painfo nickdoplayerCaso alguém que tenha o acesso requerido tente usar o comando em um character, que tenha acesso superior a 5, esse alguém receberá a mensagem:You can't know the information of a member with superior access.(Você não pode saber as informações de um membro com acesso superior.).~ ~ ~Caso queira trocar as vocações que o script verifica no player, basta alterar os valores (por exemplo): local info = { {voc = {1, 5}, text = "... Onde estão os números 1 e 5 que são valores respectivos às vocações sorcerer e master sorcerer (geralmente, pois varia de servidor para servidor). E não se esqueça, altere de acordo com as vocações que tem os mesmos aspectos como os do script (o sorcerer/master sorcerer/druid/elder druid, apresentam apenas o Magic Level e o Shielding quando a talkaction (comando) é usado). Link para o comentário Compartilhar em outros sites More sharing options...
pedrobarbalho 2 Postado Agosto 5, 2015 Share Postado Agosto 5, 2015 Script não funcionou aqui. Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados