Ir para conteúdo
Banner com Efeitos

Featured Replies

  • Respostas 19
  • Visualizações 1.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Vai na creaturescripts/scripts sempremium.lua function onLogin(player, cid) if getPlayerPremiumDays(cid) == 0 then doTeleportThing(cid, getPlayerMasterPos(cid), false) doPlayerSendTextMessage(cid

Postado

Dessa forma, todos players sem premium serão teleportados quando logarem, seria preciso verificar uma storage, assim não haveria este problema.

                                                                                               1zcn2mb.jpg

 

                                                                                                                       Danera Global Server

                                                                                                                       Versão: 10.77 - 10.79

                                                                                                                       Sem Items VIP

                                                                                                                       Venha se divertir

Postado

function onLogin(player, cid)


if (getPlayerPremiumDays(cid) < 1 and getPlayerStorageValue(cid, 64555) > 0)  then
setPlayerStorageValue(cid, 64560, 0) 
doTeleportThing(cid, getPlayerMasterPos(cid), false)
doPlayerSendTextMessage(cid,MESSAGE_FIRST,'Sua premium acabou, voce foi pro templo')
doSendMagicEffect(getCreaturePosition(cid),CONST_ME_TELEPORT)


end

Ai no talkactions/scripts/buyprem.lua:

local config = {
	days = 90,
	maxDays = 365,
	price = 10000
}

function onSay(player, words, param)
	if configManager.getBoolean(configKeys.FREE_PREMIUM) then
		return true
	end

	if player:getPremiumDays() <= config.maxDays then
		if player:removeMoney(config.price) then
			player:addPremiumDays(config.days)
			setPlayerStorageValue(cid, 64555, 1)
			player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have bought " .. config.days .." days of premium account.")
		else
			player:sendCancelMessage("You don't have enough money, " .. config.days .. " days premium account costs " .. config.price .. " gold coins.")
			player:getPosition():sendMagicEffect(CONST_ME_POFF)
		end
	else
		player:sendCancelMessage("You can not buy more than " .. config.maxDays .. " days of premium account.")
		player:getPosition():sendMagicEffect(CONST_ME_POFF)
	end
	return false
end

return true

end

Life is so meaningless, there is nothing worth a smile
So goodbye, I'll miss you

 

 

sugestões?

 

 

Postado

@TioJapa

local STORAGE_PREMIUM = 64555

function onLogin(cid)
	local player = Player(cid)

	if player:getPremiumDays() < 1 and player:getStorageValue(STORAGE_PREMIUM) > 0 then
		player:setStorageValue(STORAGE_PREMIUM, 0)
		player:teleportTo(player:getTown():getTemplePosition())
		player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
		player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Sua premium acabou!")
	end

	return true
end
function onLogin(player

Esse callback não existe no TFS 1.0 

player:registerEvent("Sempremium")

Não precisa registrar eventos onLogin.

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