Postado Julho 6, 2015 10 anos Achei, ta certo sim Editado Julho 6, 2015 10 anos por rogaforyn2 (veja o histórico de edições) Life is so meaningless, there is nothing worth a smile So goodbye, I'll miss you sugestões?
Postado Julho 6, 2015 10 anos Dessa forma, todos players sem premium serão teleportados quando logarem, seria preciso verificar uma storage, assim não haveria este problema. Danera Global Server Versão: 10.77 - 10.79 Sem Items VIP Venha se divertir
Postado Julho 6, 2015 10 anos 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 Julho 6, 2015 10 anos @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. STYLLER OT 2022
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.