Ir para conteúdo

Alguem completa essa script pra min (Script pra avisar que item chegou)

Featured Replies

Postado

Eu uso uma script pra enviar item pro dp do player, e pra essa script ficar perfeita falta avisar que o item chegou, tipo uma mensagem pro player falando "seu item acabou de chegar" sera que alguem poderia completar essa script pra min ? 

 

function onSay(cid, words, param)


local t = string.explode(param, ",")

local present = doCreateItemEx(1989)

if not t[1] then
doPlayerSendTextMessage(cid, 27, "Digite nome, quantidade.")
return TRUE
end

if not getPlayerByNameWildcard(t[1]) and not getPlayerGUIDByName(t[1]) then
doPlayerSendTextMessage(cid, 27, "Nome nao existe.")
return TRUE
end

if not tonumber(t[2]) then
doPlayerSendTextMessage(cid, 27, "Digite nome, quantidade.")
return TRUE
end

doAddContainerItem(present, 6527, t[2])
doPlayerSendMailByName(getPlayerNameByGUID(getPlayerGUIDByName(t[1])), present, 1)
doPlayerSendTextMessage(cid, 27,"Voce adicionou "..t[2].." points ao jogador "..getPlayerNameByGUID(getPlayerGUIDByName(t[1]))..".")
return TRUE
end

Editado por menta2 (veja o histórico de edições)

Postado
Spoiler

function onSay(cid, words, param)

local t = string.explode(param, ",")
local present = doCreateItemEx(1989)
if not t[1] then
doPlayerSendTextMessage(cid, 27, "Digite nome, quantidade.")
return true
end
local tid = getPlayerByNameWildcard(t[1])
if not tid then
doPlayerSendTextMessage(cid, 27, "Nome nao existe ou player está offline.")
return true
end
if not tonumber(t[2]) then
doPlayerSendTextMessage(cid, 27, "Digite nome, quantidade.")
return true
end

doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, "Você recebeu o item!") 
doAddContainerItem(present, 6527, t[2])
doPlayerSendMailByName(getPlayerNameByGUID(getPlayerGUIDByName(t[1])), present, 1)
doPlayerSendTextMessage(cid, 27,"Voce adicionou "..t[2].." points ao jogador "..getPlayerNameByGUID(getPlayerGUIDByName(t[1]))..".")
return true
end

 

Contato:

 

Postado
  • Autor
Em 21/09/2017 em 13:37, Dwarfer disse:
  Ocultar conteúdo


function onSay(cid, words, param)

local t = string.explode(param, ",")
local present = doCreateItemEx(1989)
if not t[1] then
doPlayerSendTextMessage(cid, 27, "Digite nome, quantidade.")
return true
end
local tid = getPlayerByNameWildcard(t[1])
if not tid then
doPlayerSendTextMessage(cid, 27, "Nome nao existe ou player está offline.")
return true
end
if not tonumber(t[2]) then
doPlayerSendTextMessage(cid, 27, "Digite nome, quantidade.")
return true
end

doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, "Você recebeu o item!") 
doAddContainerItem(present, 6527, t[2])
doPlayerSendMailByName(getPlayerNameByGUID(getPlayerGUIDByName(t[1])), present, 1)
doPlayerSendTextMessage(cid, 27,"Voce adicionou "..t[2].." points ao jogador "..getPlayerNameByGUID(getPlayerGUIDByName(t[1]))..".")
return true
end

 

se modificar assim a script so vai funcionar se o player estiver online, queria que inviasse mesmo offline,  no caso so queria a mensagem quando ele tivesse on, so que cm essa script o item n envia se ele tiver off

 

Postado

@menta2

 

Spoiler

function onSay(cid, words, param)

local t = string.explode(param, ",")
local present = doCreateItemEx(1989)
if not t[1] then
doPlayerSendTextMessage(cid, 27, "Digite nome, quantidade.")
return true
end
if not getPlayerGUIDByName(t[1]) then
doPlayerSendTextMessage(cid, 27, "Nome nao existe.")
return true
end
if not tonumber(t[2]) then
doPlayerSendTextMessage(cid, 27, "Digite nome, quantidade.")
return true
end
local tid = getPlayerByNameWildcard(t[1])
if tid then
doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, "Você recebeu o item!") 
end
doAddContainerItem(present, 6527, t[2])
doPlayerSendMailByName(getPlayerNameByGUID(getPlayerGUIDByName(t[1])), present, 1)
doPlayerSendTextMessage(cid, 27,"Voce adicionou "..t[2].." points ao jogador "..getPlayerNameByGUID(getPlayerGUIDByName(t[1]))..".")
return true
end

 

 

Contato:

 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo