GA

Ajuda no Recompensa por Nv por favor!

Por gabneitor, 11 de jan. de 2020 em Scripts

27
3.4k
gabneitorG
13 de janeiro de 2020 às 00:14

Usei o Primeiro código la em cima com a mensagem em branco mesmo, não tem problema não estar laranja a mensagem kkk'

Yan OliveiraY
13 de janeiro de 2020 às 14:38
14 horas atrás, gabneitor disse:

Usei o Primeiro código la em cima com a mensagem em branco mesmo, não tem problema não estar laranja a mensagem kkk'

Mas a laranja não funcionou depois?

gabneitorG
13 de janeiro de 2020 às 14:47
Agora, Yan18 disse:

Mas a laranja não funcionou depois?

funcionou não, nem executou o script na real, ficou como se nem tivesse ele, ai como o primeiro que a mensagem em branco funcionou eu deixei assim rs' to tentando agora é trazer gente pra meu servidor ta a 2 dias online já kkkkk

Yan OliveiraY
13 de janeiro de 2020 às 14:53
Melhor resposta
Agora, gabneitor disse:

funcionou não, nem executou o script na real, ficou como se nem tivesse ele, ai como o primeiro que a mensagem em branco funcionou eu deixei assim rs' to tentando agora é trazer gente pra meu servidor ta a 2 dias online já kkkkk

Só por curiosidade, testa esse aqui. Substitui todo o código por esse:

 

local id_crystal_coin = 3043 -- ID CRYSTAL COIN
local id_montaria_donkey = 13 -- ID MONTARIA DONKEY
local id_plague_mask = 13925 -- ID PLAGUE MASK
local id_plague_bell = 13926 -- ID PLAGUE BELL
local id_soft_boots = 6132 -- ID SOFT BOOTS
local id_montaria_crystal_wolf = 16 -- ID MONTARIA CRYSTAL WOLF

-- TABELA PARA ADDON CITIZEN DE ACORDO COM SEXO DO PLAYER --
local addon_citizen = {
 [0] = 136,
 [1] = 128
}

function onAdvance(cid, skill, oldlevel, newlevel)

  if getPlayerLevel(cid) >= 20 and getPlayerStorageValue(cid, 99980) < 1 then
    doPlayerAddItem(cid, id_crystal_coin, 2) -- ADICIONA CRYSTAL COIN 
    doPlayerAddOutfit(cid, addon_citizen[getPlayerSex(cid)], 3) -- ADICIONA ADDON CITIZEN FULL DE ACORDO COM SEXO DO PLAYER
    doSendMagicEffect(cid, CONST_ME_POFF) -- EFEITO AO UPAR
    doPlayerSendTextMessage(cid, 20, "You have received 2 Crystal Coin and the addon Citizen Full for advancing to level 20.") -- MENSAGEM
    setPlayerStorageValue(cid, 99980, 1) -- STORAGE PARA NÃO FICAR UPANDO MAIS ASSIM QUE ESTIVER NO LEVEL OU SUPERIOR
  return true

  elseif getPlayerLevel(cid) >= 50 and getPlayerStorageValue(cid, 99981) < 1 then
    doPlayerAddMount(cid, id_montaria_donkey) -- ADICIONA MO0NTARIA DONKEY
    doSendMagicEffect(cid, CONST_ME_POFF) 
    doPlayerSendTextMessage(cid, 20, "You have received Donkey mount for advancing to level 50.")
    setPlayerStorageValue(cid, 99981, 1)
  return true  
 
  elseif getPlayerLevel(cid) >= 80 and getPlayerStorageValue(cid, 99982) < 1 then
    doPlayerAddItem(cid, id_plague_mask, 1) -- ADICIONA PLAGUE MASK
    doPlayerAddItem(cid, id_plague_bell, 1) -- ADICIONA PLAGUE BELL
    doSendMagicEffect(cid, CONST_ME_POFF)
    doPlayerSendTextMessage(cid, 20, "You have received Plague Mask and Plague Bell for advancing to Level 80.")
    setPlayerStorageValue(cid, 99982, 1)
  return true
  
  elseif getPlayerLevel(cid) >= 100 and getPlayerStorageValue(cid, 99983) < 1 then
    doPlayerAddItem(cid, id_soft_boots, 1) -- ADICIONA SOFT BOOTS
    doSendMagicEffect(cid, CONST_ME_POFF)
    doPlayerSendTextMessage(cid, 20, "You have received Soft Boots for advancing to Level 100.")
    setPlayerStorageValue(cid, 99983, 1)  
  return true  
    
  elseif getPlayerLevel(cid) >= 150 and getPlayerStorageValue(cid, 99984) < 1 then
    doPlayerAddMount(cid, id_montaria_crystal_wolf) -- ADICIONA MONTARIA CRYSTAL WOLF
    doSendMagicEffect(cid, CONST_ME_POFF)
    doPlayerSendTextMessage(cid, 20, "You have received the Crystal Wolf mount for advancing to Level 150.") 
    setPlayerStorageValue(cid, 99984, 1)
  return true  
  end
  
return true
end

 

gabneitorG
13 de janeiro de 2020 às 17:46
2 horas atrás, Yan18 disse:

Só por curiosidade, testa esse aqui. Substitui todo o código por esse:

 

A escrita funcionou na cor vermelha!!! Agora eu descobri uma coisa sobre o código... se eu estou em nivel 20 por exemplo e pulo para o nv 80, eu ganho a recompensa do nv 50 e não ganho a do nv 80 mais a mensagem de premiação tanto do nv 50 quanto 80 aparece para min e dps mesmo upando não ganho mais a recompensa do nv 80. Isso não será um problema pra min por que no meu servidor a pessoa não upa tão rápido assim...

Mais uma vez, obrigado!


Site do meu servidor caso queira conferir rs': GranOT.tk 

Yan OliveiraY
13 de janeiro de 2020 às 20:04
2 horas atrás, gabneitor disse:

A escrita funcionou na cor vermelha!!! Agora eu descobri uma coisa sobre o código... se eu estou em nivel 20 por exemplo e pulo para o nv 80, eu ganho a recompensa do nv 50 e não ganho a do nv 80 mais a mensagem de premiação tanto do nv 50 quanto 80 aparece para min e dps mesmo upando não ganho mais a recompensa do nv 80. Isso não será um problema pra min por que no meu servidor a pessoa não upa tão rápido assim...

Mais uma vez, obrigado!


Site do meu servidor caso queira conferir rs': GranOT.tk 

Estava vendo aqui e no TFS 1x parece que a cor laranja é 36. Testa ai se ficou laranja. Também vi o problema sobre upar vários níveis, é que a condição elseif e os return em cada bloco estava dando problema. Arrumei aqui e testei, deu certo aqui. Substitui o código por:

 

local id_crystal_coin = 3043 -- ID CRYSTAL COIN
local id_montaria_donkey = 13 -- ID MONTARIA DONKEY
local id_plague_mask = 13925 -- ID PLAGUE MASK
local id_plague_bell = 13926 -- ID PLAGUE BELL
local id_soft_boots = 6132 -- ID SOFT BOOTS
local id_montaria_crystal_wolf = 16 -- ID MONTARIA CRYSTAL WOLF

-- TABELA PARA ADDON CITIZEN DE ACORDO COM SEXO DO PLAYER --
local addon_citizen = {
 [0] = 136,
 [1] = 128
}

function onAdvance(cid, skill, oldlevel, newlevel)

  if (getPlayerLevel(cid) >= 20) and (getPlayerStorageValue(cid, 99980) < 1) then
    doPlayerAddItem(cid, id_crystal_coin, 2) -- ADICIONA CRYSTAL COIN 
    doPlayerAddOutfit(cid, addon_citizen[getPlayerSex(cid)], 3) -- ADICIONA ADDON CITIZEN FULL DE ACORDO COM SEXO DO PLAYER
    doSendMagicEffect(cid, CONST_ME_POFF) -- EFEITO AO UPAR
    doPlayerSendTextMessage(cid, 36, "You have received 2 Crystal Coin and the addon Citizen Full for advancing to level 20.") -- MENSAGEM
    setPlayerStorageValue(cid, 99980, 1) -- STORAGE PARA NÃO FICAR UPANDO MAIS ASSIM QUE ESTIVER NO LEVEL OU SUPERIOR
  end

  if (getPlayerLevel(cid) >= 50) and (getPlayerStorageValue(cid, 99981) < 1) then
    doPlayerAddMount(cid, id_montaria_donkey) -- ADICIONA MO0NTARIA DONKEY
    doSendMagicEffect(cid, CONST_ME_POFF) 
    doPlayerSendTextMessage(cid, 36, "You have received Donkey mount for advancing to level 50.")
    setPlayerStorageValue(cid, 99981, 1)
  end 
 
  if (getPlayerLevel(cid) >= 80) and (getPlayerStorageValue(cid, 99982) < 1) then
    doPlayerAddItem(cid, id_plague_mask, 1) -- ADICIONA PLAGUE MASK
    doPlayerAddItem(cid, id_plague_bell, 1) -- ADICIONA PLAGUE BELL
    doSendMagicEffect(cid, CONST_ME_POFF)
    doPlayerSendTextMessage(cid, 36, "You have received Plague Mask and Plague Bell for advancing to Level 80.")
    setPlayerStorageValue(cid, 99982, 1)
  end
  
  if (getPlayerLevel(cid) >= 100) and (getPlayerStorageValue(cid, 99983) < 1) then
    doPlayerAddItem(cid, id_soft_boots, 1) -- ADICIONA SOFT BOOTS
    doSendMagicEffect(cid, CONST_ME_POFF)
    doPlayerSendTextMessage(cid, 36, "You have received Soft Boots for advancing to Level 100.")
    setPlayerStorageValue(cid, 99983, 1)  
  end 
    
  if (getPlayerLevel(cid) >= 150) and (getPlayerStorageValue(cid, 99984) < 1) then
    doPlayerAddMount(cid, id_montaria_crystal_wolf) -- ADICIONA MONTARIA CRYSTAL WOLF
    doSendMagicEffect(cid, CONST_ME_POFF)
    doPlayerSendTextMessage(cid, 36, "You have received the Crystal Wolf mount for advancing to Level 150.") 
    setPlayerStorageValue(cid, 99984, 1)
  return true  
  end
  
return true
end

Testa e me fala se deu problema, lembrando que somente o último bloco do nível, tem que ter o return.

Editado Janeiro 13 por Yan18

gabneitorG
14 de janeiro de 2020 às 08:12
12 horas atrás, Yan18 disse:

Estava vendo aqui e no TFS 1x parece que a cor laranja é 36. Testa ai se ficou laranja. Também vi o problema sobre upar vários níveis, é que a condição elseif e os return em cada bloco estava dando problema. Arrumei aqui e testei, deu certo aqui. Substitui o código por:

 

Testa e me fala se deu problema, lembrando que somente o último bloco do nível, tem que ter o return.

Com esse aqui eu criei um personagem e passei ele do 19 ao 209... Ganhou todas as recompensas, mas não apareceu nenhuma das mensagens

Yan OliveiraY
14 de janeiro de 2020 às 12:18
4 horas atrás, gabneitor disse:

Com esse aqui eu criei um personagem e passei ele do 19 ao 209... Ganhou todas as recompensas, mas não apareceu nenhuma das mensagens

Pode ser por conta da cor da mensagem, talvez não exista esse parâmetro no seu server. Mas se funcionou as recompensas menos mal, mas faz o seguinte, vai em Data/Lib e mostra o arquivo 000-constant.lua.

gabneitorG
14 de janeiro de 2020 às 15:14
2 horas atrás, Yan18 disse:

Pode ser por conta da cor da mensagem, talvez não exista esse parâmetro no seu server. Mas se funcionou as recompensas menos mal, mas faz o seguinte, vai em Data/Lib e mostra o arquivo 000-constant.lua.

mano olhei aqui e com esse nome eu nao tenho nenhum arquivo em meu servidor, tem um que esta só constants.lua que ta dentro de data/libs/core e dentro dele tem:

CONTAINER_POSITION = 0xFFFF
ROSHAMUUL_MORTAR_THROWN = 20200
ROSHAMUUL_KILLED_FRAZZLEMAWS = 20201
ROSHAMUUL_KILLED_SILENCERS = 20202
ROSHAMUUL_GOLD_RECORD = 20203

agora esse com 000- na frente nao tem... 

ScreenShot_20200114151329.png

Editado Janeiro 14 por gabneitor

Yan OliveiraY
14 de janeiro de 2020 às 15:43
19 minutos atrás, gabneitor disse:

mano olhei aqui e com esse nome eu nao tenho nenhum arquivo em meu servidor, tem um que esta só constants.lua que ta dentro de data/libs/core e dentro dele tem:

CONTAINER_POSITION = 0xFFFF
ROSHAMUUL_MORTAR_THROWN = 20200
ROSHAMUUL_KILLED_FRAZZLEMAWS = 20201
ROSHAMUUL_KILLED_SILENCERS = 20202
ROSHAMUUL_GOLD_RECORD = 20203

agora esse com 000- na frente nao tem... 

ScreenShot_20200114151329.png

Vish, geralmente nesse arquivo mostra todas as constantes do servidor (que inclui a cor das mensagens). Mas seu TFS é 1.2 correto? Procurei aqui no fórum a cor das mensagens laranja e uma outra alternativa é com o parâmetro 37, tente esse código:

 

local id_crystal_coin = 3043 -- ID CRYSTAL COIN
local id_montaria_donkey = 13 -- ID MONTARIA DONKEY
local id_plague_mask = 13925 -- ID PLAGUE MASK
local id_plague_bell = 13926 -- ID PLAGUE BELL
local id_soft_boots = 6132 -- ID SOFT BOOTS
local id_montaria_crystal_wolf = 16 -- ID MONTARIA CRYSTAL WOLF

-- TABELA PARA ADDON CITIZEN DE ACORDO COM SEXO DO PLAYER --
local addon_citizen = {
 [0] = 136,
 [1] = 128
}

function onAdvance(cid, skill, oldlevel, newlevel)

  if (getPlayerLevel(cid) >= 20) and (getPlayerStorageValue(cid, 99980) < 1) then
    doPlayerAddItem(cid, id_crystal_coin, 2) -- ADICIONA CRYSTAL COIN 
    doPlayerAddOutfit(cid, addon_citizen[getPlayerSex(cid)], 3) -- ADICIONA ADDON CITIZEN FULL DE ACORDO COM SEXO DO PLAYER
    doSendMagicEffect(cid, CONST_ME_POFF) -- EFEITO AO UPAR
    doPlayerSendTextMessage(cid, 37, "You have received 2 Crystal Coin and the addon Citizen Full for advancing to level 20.") -- MENSAGEM
    setPlayerStorageValue(cid, 99980, 1) -- STORAGE PARA NÃO FICAR UPANDO MAIS ASSIM QUE ESTIVER NO LEVEL OU SUPERIOR
  end

  if (getPlayerLevel(cid) >= 50) and (getPlayerStorageValue(cid, 99981) < 1) then
    doPlayerAddMount(cid, id_montaria_donkey) -- ADICIONA MO0NTARIA DONKEY
    doSendMagicEffect(cid, CONST_ME_POFF) 
    doPlayerSendTextMessage(cid, 37, "You have received Donkey mount for advancing to level 50.")
    setPlayerStorageValue(cid, 99981, 1)
  end 
 
  if (getPlayerLevel(cid) >= 80) and (getPlayerStorageValue(cid, 99982) < 1) then
    doPlayerAddItem(cid, id_plague_mask, 1) -- ADICIONA PLAGUE MASK
    doPlayerAddItem(cid, id_plague_bell, 1) -- ADICIONA PLAGUE BELL
    doSendMagicEffect(cid, CONST_ME_POFF)
    doPlayerSendTextMessage(cid, 37, "You have received Plague Mask and Plague Bell for advancing to Level 80.")
    setPlayerStorageValue(cid, 99982, 1)
  end
  
  if (getPlayerLevel(cid) >= 100) and (getPlayerStorageValue(cid, 99983) < 1) then
    doPlayerAddItem(cid, id_soft_boots, 1) -- ADICIONA SOFT BOOTS
    doSendMagicEffect(cid, CONST_ME_POFF)
    doPlayerSendTextMessage(cid, 37, "You have received Soft Boots for advancing to Level 100.")
    setPlayerStorageValue(cid, 99983, 1)  
  end 
    
  if (getPlayerLevel(cid) >= 150) and (getPlayerStorageValue(cid, 99984) < 1) then
    doPlayerAddMount(cid, id_montaria_crystal_wolf) -- ADICIONA MONTARIA CRYSTAL WOLF
    doSendMagicEffect(cid, CONST_ME_POFF)
    doPlayerSendTextMessage(cid, 37, "You have received the Crystal Wolf mount for advancing to Level 150.") 
    setPlayerStorageValue(cid, 99984, 1)
  return true  
  end
  
return true
end

Testa e me fala se deu certo.

gabneitorG
15 de janeiro de 2020 às 05:39
13 horas atrás, Yan18 disse:

Vish, geralmente nesse arquivo mostra todas as constantes do servidor (que inclui a cor das mensagens). Mas seu TFS é 1.2 correto? Procurei aqui no fórum a cor das mensagens laranja e uma outra alternativa é com o parâmetro 37, tente esse código:

 

Testa e me fala se deu certo.

testei aqui! e não foi, talvez meu servidor não tenha essas config o único que funcionou foi o vermelho

Yan OliveiraY
15 de janeiro de 2020 às 11:38
5 horas atrás, gabneitor disse:

testei aqui! e não foi, talvez meu servidor não tenha essas config o único que funcionou foi o vermelho

Que chato, mas vamos fazer o seguinte, vamos testar até achar a cor da mensagem pelo privado, assim não fica spammando o tópico, e quando encontrarmos a cor postamos aqui para que se outras pessoas queiram saber tem a resposta.