Postado Fevereiro 14, 2015 10 anos Autor local config = { removeItem = "yes", strInName = "[VIP] " } config.removeItem = getBooleanFromString(config.removeItem) function onUse(cid, item, fromPosition, itemEx, toPosition) local name, guid = getCreatureName(cid), getPlayerGUID(cid) doRemoveItem(item.uid, config.removeItem and 1 or 0) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `name` = '"..config.strInName..""..name.."' WHERE `id` = "..guid..";") return true end Agora só adicionar a TAG em actions Mano não add o nome =(, lembrando que meu server é tfs 0.4 e tem gesior o que eu usava e funcinava perfeitamente era function onUse(cid, item, fromPosition, itemEx, toPosition) local name = getCreatureName(cid) local days = 30 -- dias que serão adicionados local strg = 13500 -- 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) db.executeQuery("UPDATE `players` SET `name` = '[VIP] "..name.."' WHERE `id` = "..getPlayerGUID(cid)..";") doRemoveCreature(cid) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Seus dias foram acrescentados e seu nome ja foi alterado.") end return TRUE end
Postado Fevereiro 14, 2015 10 anos Autor Tenta trocar: db.executeQuery por: db.query Manoh, agora deu kkkk, mas tipo ta assim [VIP] Tester e tem como cria um player com o nick Tester e tem como colocar ele como storange 13500, e... acabar em 15 dias.. kk rep+++ e melhor resposta se ajuda
Postado Fevereiro 14, 2015 10 anos Troca o script por esse: local config = { removeItem = "yes", strInName = "[VIP] ", vipStorage = 13500, vipDays = 15 } config.removeItem = getBooleanFromString(config.removeItem) function onUse(cid, item, fromPosition, itemEx, toPosition) local name, guid = getCreatureName(cid), getPlayerGUID(cid) doRemoveItem(item.uid, config.removeItem and 1 or 0) setPlayerStorageValue(cid, config.vipStorage, (config.vipDays*24*60*60) + os.time()) doRemoveCreature(cid) db.query("UPDATE `players` SET `name` = '"..config.strInName..""..name.."' WHERE `id` = "..guid..";") return true end depois vá em login.lua e la no final você coloca isso: if(string.find(getCreatureName(cid), "[VIP] ")) then if(getPlayerStorageValue(cid, 13500) < os.time) then local newname, guid = string.match(getCreatureName(cid), " (.+)"), getPlayerGUID(cid) setPlayerStorageValue(cid, 13500, -1) doRemoveCreature(cid) db.query("UPDATE `players` SET `name` = '"..newname.."' WHERE `id` = "..guid..";") return true end end Editado Fevereiro 14, 2015 10 anos por MaTTch (veja o histórico de edições)
Postado Fevereiro 14, 2015 10 anos Autor Troca o script por esse: local config = { removeItem = "yes", strInName = "[VIP] ", vipStorage = 13500, vipDays = 15 } config.removeItem = getBooleanFromString(config.removeItem) function onUse(cid, item, fromPosition, itemEx, toPosition) local name, guid = getCreatureName(cid), getPlayerGUID(cid) doRemoveItem(item.uid, config.removeItem and 1 or 0) setPlayerStorageValue(cid, config.vipStorage, (config.vipDays*24*60*60) + os.time()) doRemoveCreature(cid) db.query("UPDATE `players` SET `name` = '"..config.strInName..""..name.."' WHERE `id` = "..guid..";") return true end depois vá em login.lua e la no final você coloca isso: if(string.find(getCreatureName(cid), "[VIP] ") then if(getPlayerStorageValue(cid, 13500) < os.time) then local newname, guid = string.match(getCreatureName(cid), " (.+)"), getPlayerGUID(cid) setPlayerStorageValue(cid, 13500, -1) doRemoveCreature(cid) db.query("UPDATE `players` SET `name` = '"..newname.."' WHERE `id` = "..guid..";") return true end end olha, tem como cria 2 personagem com o mesmo nick agora ='( sabe como arrumar?? TIPO NO ACCOUNT MANAGER TEM NÃO TEM COMO CRIAR UMA CONTA COM OUTRO NOME MAS NO SITE TEM ajuda plxx Editado Fevereiro 14, 2015 10 anos por Danielgomes (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.