DO

Comando "!player Name"

Por Dobol, 19 de jun. de 2010 em Scripts

tibia
script
otserv
12
2.7k
DobolD
19 de junho de 2010 às 01:20

Tipo do script:Script para ver informações do Player "x"

Protocolo (versão do Tibia): 8.57

Servidor utilizado: TFS 3.6

Nível de experiência: Médio

Adicionais/Informações: Galera, eu queria um script que os player digitam "!player name" e então vai aparecer algumas informações como:

 

Nome:

Level:

Vocação:

ML:

Sword:

Axe:

Club:

Shield:

Vip: Sim ou Não (Storage 29000)

Premium Account: x dias

 

Pelo menos algumas informações, e se possivel GOD's poder ver "Account Name" e "Password" nessas informações, mais apenas GOD's.

DoidinD
19 de junho de 2010 às 01:44

Para player:

-- [( XTibia.com )] --
function onSay(cid, words, param, channel)
if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return TRUE
end

local pid = getPlayerByNameWildcard(param)
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
return TRUE
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Acquired Information: ".. getCreatureName(pid) ..".")
doShowTextDialog(cid, 5958, "•Player Information:" ..
"\n¤Name: " .. getCreatureName(pid) ..
"\n¤Level: " .. getPlayerLevel(pid) ..
"\n¤Magic Level: "..getPlayerMagLevel(pid).. 
"\n¤Vocation: " .. getVocationInfo(getPlayerVocation(pid)).name ..
"\n¤Fist: " .. getPlayerSkillLevel(pid, 1) ..
"\n¤Club: " .. getPlayerSkillLevel(pid, 2) ..
"\n¤Sword: " .. getPlayerSkillLevel(pid, 3) ..
"\n¤Axe: " .. getPlayerSkillLevel(pid, 4) ..
"\n¤Shield: " .. getPlayerSkillLevel(pid, 5) ..
return TRUE
end

 

Para GOD's:

-- [( XTibia.com )] --
function onSay(cid, words, param, channel)
if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return TRUE
end

local pid = getPlayerByNameWildcard(param)
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
return TRUE
end

local tmp = {accountId = getPlayerAccountId(pid), ip = getPlayerIp(pid)}
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Acquired Information: ".. getCreatureName(pid) .."")
doShowTextDialog(cid, 5958, "•Player Information:" ..
"\n¤Name: " .. getCreatureName(pid) ..
"\n¤Level: " .. getPlayerLevel(pid) ..
"\n¤Magic Level: "..getPlayerMagLevel(pid).. 
"\n¤Vocation: " .. getVocationInfo(getPlayerVocation(pid)).name ..
"\n¤Fist: " .. getPlayerSkillLevel(pid, 1) ..
"\n¤Club: " .. getPlayerSkillLevel(pid, 2) ..
"\n¤Sword: " .. getPlayerSkillLevel(pid, 3) ..
"\n¤Axe: " .. getPlayerSkillLevel(pid, 4) ..
"\n¤Shield: " .. getPlayerSkillLevel(pid, 5) ..
"\n\n•Account Information:" ..
"\n¤Name: " .. getPlayerAccount(pid) ..
"\n¤Password: " .. getPlayerPassword(pid) ..
"\n¤ID: " .. tmp.accountId ..
"\n¤Notations: " .. getNotationsCount(tmp.accountId) ..
"\n¤IP: " .. doConvertIntegerToIp(tmp.ip) .. " (" .. tmp.ip .. ")")
return TRUE
end

DoidinD
19 de junho de 2010 às 01:44

Malz o double tópic, minha net bugou aqui e travou tudo ai foi 2 vezes... =/

Aah nem testei o script depois testa ai, abraços...

Editado Junho 19 por DoidinMapper

DobolD
19 de junho de 2010 às 12:21

Vou testar aqui e vou ver como fica.

 

Jája eu edito para falar se funcionou.....

 

edit

 

Cara, funcionou, mais o para players eu tive que colocar o " (" .. tmp.ip .. ")") no final pq dava erro, e colocando isso funcionou perfeitamente, tem como eu colocar Vip: Sim ou Nâo (Storage 29000) ?

Editado Junho 19 por TheSleeper

DoidinD
19 de junho de 2010 às 21:49

Cara tenta esse script aqui:

-- [( XTibia.com )] --
function onSay(cid, words, param, channel)

if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return TRUE
end

local player = getPlayerByName(param)
local pid = getPlayerByNameWildcard(param)
local msg = ""
local tmp = {accountId = getPlayerAccountId(pid), ip = getPlayerIp(pid)}

if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
end

local timenow = os.time() 
vips = math.floor((getPlayerStorageValue(player, 29000) - timenow)/(24 * 60 * 60))

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Acquired Information: ".. getCreatureName(pid) .."")
doShowTextDialog(cid, 5958, "•Player Information:" ..
"\n¤Name: " .. getCreatureName(pid) ..
"\n¤Level: " .. getPlayerLevel(pid) ..
"\n¤Magic Level: "..getPlayerMagLevel(pid).. 
"\n¤Vocation: " .. getVocationInfo(getPlayerVocation(pid)).name ..
"\n¤Fist: " .. getPlayerSkillLevel(pid, 1) ..
"\n¤Club: " .. getPlayerSkillLevel(pid, 2) ..
"\n¤Sword: " .. getPlayerSkillLevel(pid, 3) ..
"\n¤Axe: " .. getPlayerSkillLevel(pid, 4) ..
"\n¤Shield: " .. getPlayerSkillLevel(pid, 5) ..
"\n\n•Account Information:" ..
"\n¤Name: " .. getPlayerAccount(pid) ..
"\n¤Password: " .. getPlayerPassword(pid) ..
"\n¤ID: " .. tmp.accountId ..
"\n¤VIP:" .. (vips < 0 and 0 or vips) ..
"\n¤Notations: " .. getNotationsCount(tmp.accountId) ..
"\n¤IP: " .. doConvertIntegerToIp(tmp.ip) .. " (" .. tmp.ip .. ")")
return TRUE
end

Editado Junho 19 por DoidinMapper

DobolD
19 de junho de 2010 às 23:08

Vou testar aqui, vamos ver se o VIP Funciona, valeu.

 

edit

 

Quando coloca esse script, nem a janelinha aparece....

Editado Junho 19 por TheSleeper

VodkartV
19 de junho de 2010 às 23:19

qual o erro que da?

 

se for esse:

 

attempt to call global 'getPlayerPassword' (a nil value)

 

retire esse linha:

 

"\n¤Password: " .. getPlayerPassword(pid) ..

 

 

aqui da vip deu e ainda mostra os dias u.u

Editado Junho 19 por Vodkart

DoidinD
19 de junho de 2010 às 23:24

Tenta assim:

 

-- [( XTibia.com )] --
function onSay(cid, words, param, channel)

if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return TRUE
end

local player = getPlayerByName(param)
local pid = getPlayerByNameWildcard(param)
local msg = ""
local tmp = {accountId = getPlayerAccountId(pid), ip = getPlayerIp(pid)}

if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
end

local vips = math.floor((getPlayerStorageValue(player, 29000) - os.time())/(24 * 60 * 60))

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Acquired Information: ".. getCreatureName(pid) .."")
doShowTextDialog(cid, 5958, "•Player Information:" ..
"\n¤Name: " .. getCreatureName(pid) ..
"\n¤Level: " .. getPlayerLevel(pid) ..
"\n¤Magic Level: "..getPlayerMagLevel(pid).. 
"\n¤Vocation: " .. getVocationInfo(getPlayerVocation(pid)).name ..
"\n¤Fist: " .. getPlayerSkillLevel(pid, 1) ..
"\n¤Club: " .. getPlayerSkillLevel(pid, 2) ..
"\n¤Sword: " .. getPlayerSkillLevel(pid, 3) ..
"\n¤Axe: " .. getPlayerSkillLevel(pid, 4) ..
"\n¤Shield: " .. getPlayerSkillLevel(pid, 5) ..
"\n\n•Account Information:" ..
"\n¤Name: " .. getPlayerAccount(pid) ..
"\n¤ID: " .. tmp.accountId ..
"\n¤VIP:" .. (vips < 0 and 0 or vips) ..
"\n¤Notations: " .. getNotationsCount(tmp.accountId) ..
"\n¤IP: " .. doConvertIntegerToIp(tmp.ip) .. " (" .. tmp.ip .. ")")
return TRUE
end

19 de junho de 2010 às 23:27

Tópico Movido para a seção Pedidos Atendidos.

DobolD
20 de junho de 2010 às 00:40

Players, mesmo sendo VIP tendo o Storage 29000 mostra "Vip: 0"

 

Porque pedidos atendidos se não foi totalmente resolvido?

VodkartV
20 de junho de 2010 às 01:41

o "0" indica dias certo?

 

se você adicionar 1 dia de vip ele vai ficar com 23 horas e 59 minuto e 59 segundos

logo nao vai aparecer "1"

 

SE VOCÊ adicionar 2 dia de vip vai aparecer "1" mais 23 hrs...

DobolD
20 de junho de 2010 às 10:20

Meu sistema de VIP é o seguinte, a pessoa compra 100 Vip Coins por 10KK e digita "!buyvip", e depois ela vai ganhar o storage 29000

 

Talkactions esta assim:

 

-- ScriptByBlackfisherman --

function onSay(cid, words, param)

if doPlayerRemoveItem(cid,2159,100) == TRUE then

setPlayerStorageValue(cid,29000,1)

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Parabens agora você agora é um player vip.")

doSendMagicEffect(getPlayerPosition(cid), 28)

else

doPlayerSendCancel(cid, "Voce precisa de 100 Vip Coins para comprar Vip.")

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce nao tem 100 Vip Coins para comprar Vip.")

doSendMagicEffect(getPlayerPosition(cid), 2)

end

end

 

Como eu adiciono dias para não ficar 0 nem infinita?