Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Galera, alguém sabe como coloca esse script de bless apenas para jogadores PREMIUMS? Ou seja, free acc não pode comprar, aparece uma mensagem dizendo que eles precisam ser premium para pode comprar.
 

local bless = {1, 2, 3, 4, 5}
local cost = 50000
function onSay(cid, words, param)
for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless[i])) then
doPlayerSendCancel(cid, "You have already all blessings.")
return TRUE
end
end

if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
end
doCreatureSay(cid, "You are now blessed!" ,19)
doSendMagicEffect(getPlayerPosition(cid), 49)
else
doPlayerSendCancel(cid, "You don\'t have enough money.")
end
return TRUE
end
Ai está o código da Talkaction da bless

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

Postado
local bless = {1, 2, 3, 4, 5}
local cost = 50000
function onSay(cid, words, param)
    if not isPremium(cid) then
        doPlayerSendCancel(cid, 'Only premium players can buy blessings.')
       return true
    end

    for i = 1, table.maxn(bless) do
        if(getPlayerBlessing(cid, bless[i])) then
            doPlayerSendCancel(cid, "You have already all blessings.")
         return TRUE
        end
    end

    if(doPlayerRemoveMoney(cid, cost) == TRUE) then
        for i = 1, table.maxn(bless) do
            doPlayerAddBlessing(cid, bless[i])
        end
        doCreatureSay(cid, "You are now blessed!" ,19)
        doSendMagicEffect(getPlayerPosition(cid), 49)
    else
        doPlayerSendCancel(cid, "You don\'t have enough money.")
    end
   return true
end
Postado
  • Autor
local bless = {1, 2, 3, 4, 5}
local cost = 50000
function onSay(cid, words, param)
    if not isPremium(cid) then
        doPlayerSendCancel(cid, 'Only premium players can buy blessings.'
       return true
    end

    for i = 1, table.maxn(bless) do
        if(getPlayerBlessing(cid, bless[i])) then
            doPlayerSendCancel(cid, "You have already all blessings.")
         return TRUE
        end
    end

    if(doPlayerRemoveMoney(cid, cost) == TRUE) then
        for i = 1, table.maxn(bless) do
            doPlayerAddBlessing(cid, bless[i])
        end
        doCreatureSay(cid, "You are now blessed!" ,19)
        doSendMagicEffect(getPlayerPosition(cid), 49)
    else
        doPlayerSendCancel(cid, "You don\'t have enough money.")
    end
   return true
end

Vc é fera mano, valeeeu ! :D

Postado
doPlayerSendCancel(cid, 'Only premium players can buy blessings.'
return true

retorna a msg e economiza uma linha, e tbem faltou um ) no final.

return TRUE

TRUE maiúsculo é gambiarra.

bless[i]

Esse termo é a mesma coisa que se usar "i" apenas.

 

Refiz assim ... 

local bless = 5
local cost = 10000

function onSay(cid, words, param)
	if not isPremium(cid) then
		return doPlayerSendCancel(cid, 'Only premium players can buy blessings.')
	end

	local x = 0
	for i = 1, bless do
		if getPlayerBlessing(cid, i) == false then
			x = x + 1
			if doPlayerRemoveMoney(cid, cost) then
				doPlayerAddBlessing(cid, i)
			else
				return doPlayerSendCancel(cid, "You don\'t have enough money.")
			end
		end
	end

	if x == 0 then
		return doPlayerSendCancel(cid, "You have already all blessings.")
	else
		doCreatureSay(cid, "You are now blessed!" ,19)
		doSendMagicEffect(getPlayerPosition(cid), 49)
	end

	return true
end

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

  • 2 years later...
Postado
Em 14/10/2015 em 16:30, luanluciano93 disse:

doPlayerSendCancel(cid, 'Only premium players can buy blessings.'
return true

retorna a msg e economiza uma linha, e tbem faltou um ) no final.


return TRUE

TRUE maiúsculo é gambiarra.


bless[i]

Esse termo é a mesma coisa que se usar "i" apenas.

 

Refiz assim ... 


local bless = 5
local cost = 10000

function onSay(cid, words, param)
	if not isPremium(cid) then
		return doPlayerSendCancel(cid, 'Only premium players can buy blessings.')
	end

	local x = 0
	for i = 1, bless do
		if getPlayerBlessing(cid, i) == false then
			x = x + 1
			if doPlayerRemoveMoney(cid, cost) then
				doPlayerAddBlessing(cid, i)
			else
				return doPlayerSendCancel(cid, "You don\'t have enough money.")
			end
		end
	end

	if x == 0 then
		return doPlayerSendCancel(cid, "You have already all blessings.")
	else
		doCreatureSay(cid, "You are now blessed!" ,19)
		doSendMagicEffect(getPlayerPosition(cid), 49)
	end

	return true
end

mesmo com a bless o player ainda compra bless poderia arrumar?

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