Ir para conteúdo

Featured Replies

Postado

Eu criei uma quest no meu servidor e gostaria que, quando o Player abrir o baú, aparecer uma mensagem em laranja para todo o servidor com o nome do jogador que completou a quest.

 

O Script está quase pronto, eu já consegui fazer o Player ganhar o item e aparecer a msg em Laranja para todo o server...

function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == 6411 then
queststatus = getPlayerStorageValue(cid,6411)
if queststatus == -1 then
broadcastMessage("O Jogador completou a Anihilator 4.", MESSAGE_STATUS_CONSOLE_ORANGE)
doPlayerAddItem(cid,9693,1)
doPlayerAddItem(cid,2160,1)
setPlayerStorageValue(cid,6411,1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Você ja ganhou seu bonus.")
end
else
return 0
end

return 1
end

Mas falta adicionar o nome do jogador na msg. Eu tentei adicionar "player = getCreatureName" e "...player..." e ficou assim:

function onUse(cid, item, fromPosition, itemEx, toPosition)
   if item.uid == 6411 then
        queststatus = getPlayerStorageValue(cid,6411)
	player = getCreatureName
       if queststatus == -1 then
           broadcastMessage("O Jogador "...player..." completou a Anihilator 4.", MESSAGE_STATUS_CONSOLE_ORANGE)
           doPlayerAddItem(cid,9693,1)
           doPlayerAddItem(cid,2160,1)
           setPlayerStorageValue(cid,6411,1)
       else
           doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Você "...assassino..." ja ganhou seu bonus.")
       end
    else
        return 0
   end

   return 1
end

mas não funcionou, tem alguém aí que consegue me ajudar com essa linha que identifica o nome do personagem? Alguém tem alguma idéia que eu possa testar aqui?

Resolvido por Eduardo Carvalho

Ir para solução
  • Respostas 5
  • Visualizações 489
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Eduardo Carvalho
    Eduardo Carvalho

    ops, falta de atenção minha , testa ae agora..   function onUse(cid, item, fromPosition, itemEx, toPosition) if item.uid == 6411 then    if getPlayerStorageValue(cid, 6411) <= 0 then       doB

Postado
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if item.uid == 6411 then
        queststatus = getPlayerStorageValue(cid,6411)
       if queststatus == -1 then
           doBroadcastMessage("O Jogador "...getCreatureName(cid)..." completou a Anihilator 4.", MESSAGE_STATUS_CONSOLE_ORANGE)
           doPlayerAddItem(cid,9693,1)
           doPlayerAddItem(cid,2160,1)
           setPlayerStorageValue(cid,6411,1)
       else
           doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você já ganhou seu bonus.")
       end
    else
        return 0
   end


   return true
end
Postado
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == 6411 then
queststatus = getPlayerStorageValue(cid,6411)
if queststatus == -1 then
if not isPlayer(target) or not isPlayer(cid) then
return true
end
broadcastMessage("O Jogador "..getCreatureName(cid).." completou a Anihilator 4.", MESSAGE_STATUS_CONSOLE_ORANGE)
doPlayerAddItem(cid,9693,1)
doPlayerAddItem(cid,2160,1)
setPlayerStorageValue(cid,6411,1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Você ja ganhou seu bonus.")
end
else
return 0
end
 
return 1
end
Postado
  • Autor

Muito obrigado por responder de imediato, estava há pouco lendo outro post do Eduardo, mas enfim....

Não funcionou, testei os dois [Do Eduardo e do Absolute], tentei também combinar algumas coisas mas não funcionou ainda ("[Error - LuaScriptInterface::loadFile]",)

Postado
  • Solução

ops, falta de atenção minha , testa ae agora..

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

if item.uid == 6411 then
   if getPlayerStorageValue(cid, 6411) <= 0 then
      doBroadcastMessage("O Jogador "..getCreatureName(cid).." completou a Anihilator 4.", MESSAGE_STATUS_CONSOLE_ORANGE)
      doPlayerAddItem(cid,9693,1)
      doPlayerAddItem(cid,2160,1)
      setPlayerStorageValue(cid,6411,1)
   else
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você já ganhou seu bonus.")
   end
end

 return true
end

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.6k

Informação Importante

Confirmação de Termo