Ir para conteúdo
  • Cadastre-se

Posts Recomendados

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)
Link para o post
Compartilhar em outros sites
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
Link para o post
Compartilhar em outros sites
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

Link para o post
Compartilhar em outros sites
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)
Link para o post
Compartilhar em outros sites
  • 2 years later...
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?

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo