Ir para conteúdo

Featured Replies

Postado

@Natan Fernandes é proibido dar up, utilize nosso sistema para isso, você é um membro antigo, deveria estar atualizado das regras.

Reformulei o scrpit, testei, e está 100, abraços.

Spoiler

function onSay(cid, words, param)
local fail = 0
local bless = {1, 2, 3, 4, 5, 6}
 
if getPlayerLevel(cid) < 31 then
 cost = 2000
else
 cost = ((getPlayerLevel(cid) - 30) * 200) + 2000
end
   
if cost > 20000 then
 cost = 20000
end

for i = 1, #bless do
 if not getPlayerBlessing(cid, bless[i]) then
  if doPlayerRemoveMoney(cid, cost) == TRUE then
   doPlayerAddBlessing(cid, bless[i])
   if i == #bless  and not(fail == #bless) then
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
	doPlayerSendCancel(cid, "You just bought the missing blessings.")
	fail = 0
   end
  else
   fail = 0
   doPlayerSendCancel(cid, "You do not have enough money to buy all the blessings!")
   break
  end
 else
 fail = fail + 1
 end
end

if fail == #bless then 
 doPlayerSendCancel(cid, "You already have all the blessings!")
end

return TRUE
end

 

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

  • Respostas 11
  • Visualizações 835
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Esta é uma mensagem automática! Este tópico foi movido para a área correta. Pedimos que você leia as regras do fórum.  

Posted Images

Postado
  • Autor

desculpa, vou testar aqui

Deu esse erro na hora de executar a script, por gentileza, poderia analisar?

Captura de tela de 2017-06-26 11:16:00.png

mano testei aqui e alterei a parte de checkar a bless por nesse server ser diferente mas agr fala sempre q tem todas as bless ate quando morre e tenta denovo aqui a bless system:

 

-- Author: 		Rodrigo (Nottinghster) - (OTLand, OTFans, XTibia, OTServBR)
-- Country:		Brazil
-- From: 		Tibia World RPG OldSchool
-- Email: 		[email protected]
-- Compiler:	Tibia World Script Maker (Libs Scripts)

function CheckPlayerBlessings(cid)
	if isPromoted(cid) == TRUE then
		deathlossvalue = 7
	else
		deathlossvalue = 10
	end
    local MGB = mysqlQuery("SELECT `bless1`, `bless2`, `bless3`, `bless4`, `bless5` FROM `players` WHERE `name` = '" .. getPlayerName(cid) .. "';", "bless1, bless2, bless3, bless4, bless5")
	
	if(MGB.bless1) == "1" then
		blessone = 1
	else
		blessone = 0
	end
	if(MGB.bless2) == "1" then
		blesstwo = 1
	else
		blesstwo = 0
	end
	if(MGB.bless3) == "1" then
		blessthree = 1
	else
		blessthree = 0
	end
	if(MGB.bless4) == "1" then
		blessfour = 1
	else
		blessfour = 0
	end
	if(MGB.bless5) == "1" then
		blessfive = 1
	else
		blessfive = 0
	end

FINISHEDDEATHLOSS = (deathlossvalue-((((blessone+blesstwo)+blessthree)+blessfour)+blessfive))
	
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, FINISHEDDEATHLOSS)
doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, FINISHEDDEATHLOSS)
doPlayerSetLossPercent(cid, PLAYERLOSS_SKILL, FINISHEDDEATHLOSS)

return true
end

function RemovePlayerBlessing(cid)
mysqlQuery("UPDATE `players` SET `bless1` = '0',`bless2` = '0',`bless3` = '0',`bless4` = '0',`bless5` = '0' WHERE `name` = \"" .. getPlayerName(cid) .. "\"", "SET")
return true
end

function AddPlayerBlessing(cid, type)
local MGB = mysqlQuery("SELECT `bless1`, `bless2`, `bless3`, `bless4`, `bless5` FROM `players` WHERE `name` = '" .. getPlayerName(cid) .. "';", "bless1, bless2, bless3, bless4, bless5")
if type == 1 then
	if (MGB.bless1) == "0" then
		mysqlQuery("UPDATE `players` SET `bless1` = '1' WHERE `name` = '" .. getPlayerName(cid) .. "';", "SET")
		CheckPlayerBlessings(cid)
		return true
	else
	return false
	end
elseif type == 2 then
	if (MGB.bless2) == "0" then
		mysqlQuery("UPDATE `players` SET `bless2` = '1' WHERE `name` = '" .. getPlayerName(cid) .. "';", "SET")
		CheckPlayerBlessings(cid)
		return true
	else
	return false
	end
elseif type == 3 then
	if (MGB.bless3) == "0" then
		mysqlQuery("UPDATE `players` SET `bless3` = '1' WHERE `name` = '" .. getPlayerName(cid) .. "';", "SET")
		CheckPlayerBlessings(cid)
		return true
	else
	return false
	end
elseif type == 4 then
	if (MGB.bless4) == "0" then
		mysqlQuery("UPDATE `players` SET `bless4` = '1' WHERE `name` = '" .. getPlayerName(cid) .. "';", "SET")
		CheckPlayerBlessings(cid)
		return true
	else
	return false
	end
elseif type == 5 then
	if (MGB.bless5) == "0" then
		mysqlQuery("UPDATE `players` SET `bless5` = '1' WHERE `name` = '" .. getPlayerName(cid) .. "';", "SET")
		CheckPlayerBlessings(cid)
		return true
	else
	return false
	end	
end
end

acho que isso pode ajudar sla

Spoiler

function onSay(cid, words, param)
local fail = 0
local bless = {1, 2, 3, 4, 5, 6}
 
if getPlayerLevel(cid) < 31 then
 cost = 2000
else
 cost = ((getPlayerLevel(cid) - 30) * 200) + 2000
end
   
if cost > 20000 then
 cost = 20000
end

for i = 1, #bless do
 if not AddPlayerBlessing(cid, bless[i]) then
   CheckPlayerBlessings(cid, bless[i])
  if doPlayerRemoveMoney(cid, cost) == TRUE then
   if i == #bless  and not(fail == #bless) then
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
	doPlayerSendCancel(cid, "You just bought the missing blessings.")
	fail = 0
   end
  else
   fail = 0
   doPlayerSendCancel(cid, "You do not have enough money to buy all the blessings!")
   break
  end
 else
 fail = fail + 1
 end
end

if fail == #bless then 
 doPlayerSendCancel(cid, "You already have all the blessings!")
end

return TRUE
end

 

MANO FUCEI PRA CARAMBA, MAS AGR TA FUNCIONANDO TIPO ELE ADICIONA NA DATABASE TODA AS BLESS TA FUNCIONANDO OK, MAS AGR ELE NÃO CHECKA EU ALTEREI A LINHA Q ELE CHECKAVA A BLESS PARA ELE ADICIONAR, JA QUE NÃO ESTAVA FUNCIONANDO MAS AGR NÃO ELE NÃO CHECKA MAIS SO FICA TIRANDO DINHEIRO MESMO O PLAYER TENDO

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