Postado Maio 24, 2015 10 anos Gostaria de ajuda para criar um script assim: Ao usar o item, você ganha 30 dias(configurável) de área donate. Após esses 30 dias, ele não consiga mais entra nessa área e será teletransportado para o templo. Obrigado desde já. Baiak Thunder New TFS Downgrade [TFS 1.5 - 8.60] Gesior Ferobra Downgrade Evento Monster Hunt [TFS 1.X] Evento SafeZone [TFS 1.X] Online Bonus System [TFS 1.X] Dodge & Critical [TFS 1.X] Nova moeda, funcionando com NPCs [TFS 1.X] Square System [TFS 1.X] Loot Channel [TFS 1.X] Gerenciador de Quests [All TFS] NPCs comprando vial/flasks por storage [TFS 1.X] AntiBot [TFS 1.X] Como compilar TFS 0.X
Postado Maio 24, 2015 10 anos Gostaria de ajuda para criar um script assim: Ao usar o item, você ganha 30 dias(configurável) de área donate. Após esses 30 dias, ele não consiga mais entra nessa área e será teletransportado para o templo. Obrigado desde já. Pode explicar melhor? Ele ganha uma determinada storage ou dias de premium? _ .-'` `} _./) / } .'o \ | } '.___.'`.\ {` /`\_/ , `. } ME DA UMA NOZ! \=' .-' _`\ { `'`;/ `, } _\ @ ; } /__`;-...'--' Cluck!
Postado Maio 24, 2015 10 anos Servidor\data\actions\scripts vipname.lua function onUse(cid, item, fromPosition, itemEx, toPosition) local name = getCreatureName(cid) local days = 30 -- dias que serão adicionados local strg = 33339 -- valor da sua storage local strg_n = 12120 -- não precisa editar local daysvalue = days * 24 * 60 * 60 local storageplayer = getPlayerStorageValue(cid, strg) local timenow = os.time() if getPlayerStorageValue(cid, strg) - os.time() <= 0 then time = timenow + daysvalue else time = storageplayer + daysvalue end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.") setPlayerStorageValue(cid, strg, time) local quantity = math.floor((getPlayerStorageValue(cid, strg) - timenow)/(24 * 60 * 60)) doSendMagicEffect(getPlayerPosition(cid), math.random(28,30)) doPlayerAddPremiumDays(cid, 30) doRemoveItem(item.uid, 1) if getPlayerStorageValue(cid, strg_n) < 1 then setPlayerStorageValue(cid, strg_n, 1) addEvent(doRemoveCreature, 5000, cid) end return TRUE end C:\Users\Wend\Desktop\Servidor\data\actions actions.xml adicione essa tag <action itemid="1819" script="vipname.lua"/> C:\Users\Wend\Desktop\Servidor\data\creaturescripts\scripts endvip.lua local strg = 33339 -- valor da sua storage local strg_n = 12120 -- não precisa editar function onLogin(cid) if getPlayerPremiumDays(cid) <= 0 and getPlayerStorageValue(cid, strg_n) == 1 then setPlayerStorageValue(cid, 9898, 1) end if getPlayerStorageValue(cid, 9898) == 1 and getPlayerPremiumDays(cid) <= 0 then local temple = getTownTemplePosition(getPlayerTown(cid)) doTeleportThing(cid, temple) doPlayerPopupFYI(cid, "Sua vip Account acabou.") setPlayerStorageValue(cid, 9898, -1) setPlayerStorageValue(cid, strg_n, -1) if string.find(tostring(getCreatureName(cid)),"[Vip]") then addEvent(EddyHavoc, 3*1000, cid) end end return TRUE end function EddyHavoc(cid) if isPlayer(cid) then db.executeQuery("UPDATE `players` SET `name` = '"..string.sub(getCreatureName(cid), 7).."' WHERE `id` = "..getPlayerGUID(cid)..";") doRemoveCreature(cid) end end C:\Users\Wend\Desktop\Servidor\data\creaturescripts creaturescripts.xml adicione essa tag <event type="login" name="CheckVip" script="endvip.lua"/> registre o evento no login.lua registerCreatureEvent(cid, "CheckVip")
Postado Julho 9, 2015 9 anos Autor Servidor\data\actions\scripts vipname.lua function onUse(cid, item, fromPosition, itemEx, toPosition) local name = getCreatureName(cid) local days = 30 -- dias que serão adicionados local strg = 33339 -- valor da sua storage local strg_n = 12120 -- não precisa editar local daysvalue = days * 24 * 60 * 60 local storageplayer = getPlayerStorageValue(cid, strg) local timenow = os.time() if getPlayerStorageValue(cid, strg) - os.time() <= 0 then time = timenow + daysvalue else time = storageplayer + daysvalue end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.") setPlayerStorageValue(cid, strg, time) local quantity = math.floor((getPlayerStorageValue(cid, strg) - timenow)/(24 * 60 * 60)) doSendMagicEffect(getPlayerPosition(cid), math.random(28,30)) doPlayerAddPremiumDays(cid, 30) doRemoveItem(item.uid, 1) if getPlayerStorageValue(cid, strg_n) < 1 then setPlayerStorageValue(cid, strg_n, 1) addEvent(doRemoveCreature, 5000, cid) end return TRUE end C:\Users\Wend\Desktop\Servidor\data\actions actions.xml adicione essa tag <action itemid="1819" script="vipname.lua"/> C:\Users\Wend\Desktop\Servidor\data\creaturescripts\scripts endvip.lua local strg = 33339 -- valor da sua storage local strg_n = 12120 -- não precisa editar function onLogin(cid) if getPlayerPremiumDays(cid) <= 0 and getPlayerStorageValue(cid, strg_n) == 1 then setPlayerStorageValue(cid, 9898, 1) end if getPlayerStorageValue(cid, 9898) == 1 and getPlayerPremiumDays(cid) <= 0 then local temple = getTownTemplePosition(getPlayerTown(cid)) doTeleportThing(cid, temple) doPlayerPopupFYI(cid, "Sua vip Account acabou.") setPlayerStorageValue(cid, 9898, -1) setPlayerStorageValue(cid, strg_n, -1) if string.find(tostring(getCreatureName(cid)),"[Vip]") then addEvent(EddyHavoc, 3*1000, cid) end end return TRUE end function EddyHavoc(cid) if isPlayer(cid) then db.executeQuery("UPDATE `players` SET `name` = '"..string.sub(getCreatureName(cid), 7).."' WHERE `id` = "..getPlayerGUID(cid)..";") doRemoveCreature(cid) end end C:\Users\Wend\Desktop\Servidor\data\creaturescripts creaturescripts.xml adicione essa tag <event type="login" name="CheckVip" script="endvip.lua"/> registre o evento no login.lua registerCreatureEvent(cid, "CheckVip") Não funcionou a parte de "acabar" o vip Programadores.. Preciso da ajuda de vocês :/ Up Editado Julho 9, 2015 9 anos por moviebr (veja o histórico de edições) Baiak Thunder New TFS Downgrade [TFS 1.5 - 8.60] Gesior Ferobra Downgrade Evento Monster Hunt [TFS 1.X] Evento SafeZone [TFS 1.X] Online Bonus System [TFS 1.X] Dodge & Critical [TFS 1.X] Nova moeda, funcionando com NPCs [TFS 1.X] Square System [TFS 1.X] Loot Channel [TFS 1.X] Gerenciador de Quests [All TFS] NPCs comprando vial/flasks por storage [TFS 1.X] AntiBot [TFS 1.X] Como compilar TFS 0.X
Postado Julho 9, 2015 9 anos tente assim. action/ function onUse(cid, item) if getPlayerStorageValue(cid, 13540) - os.time() < 0 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"Agora voce e um player VIP.") setPlayerStorageValue(cid, 9898, os.time() + (30*24*60*60)) doRemoveItem(item.uid, 1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"Voce ja e VIP so poderá renovar daqui 30 dias.") end return TRUE end creturescript/ function onLogin(cid) if getPlayerStorageValue(cid, 13540) - os.time() > 0 then setPlayerStorageValue(cid, 9898, 1) end local pos = {x = 157, y = 50, z = 7} -- posiçao do templo. function EddyHavoc(cid) if isPlayer(cid) then db.executeQuery("UPDATE `players` SET `name` = '"..string.sub(getCreatureName(cid), 7).."' WHERE `id` = "..getPlayerGUID(cid)..";") doRemoveCreature(cid) end end if getPlayerStorageValue(cid, 9898) == 1 and getPlayerStorageValue(cid, 13540) - os.time() < 1 or getPlayerStorageValue(cid, 13540) - os.time() == 0 then doTeleportThing(cid, pos) doPlayerPopupFYI(cid, "Sua vip Account acabou.") setPlayerStorageValue(cid, 9898, -1) if string.find(tostring(getCreatureName(cid)),"[[Vip]]") then addEvent(EddyHavoc, 3*1000, cid) end end return TRUE end Editado Julho 9, 2015 9 anos por pedrook (veja o histórico de edições)
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.