Ir para conteúdo

Featured Replies

Postado

fala galera boa tarde é o seguinte meu servidor tem vip aí quando o cara pega (VIP) Spartan o account manager deixa criar outro boneco somente com o nome Spartan ai quando o vip do cara sai buga db fica dois nomes Spartan como arrumar segue meu login.lua aí

 

local config = {
loginMessage = getConfigValue('loginMessage')
}
 
function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end
 
local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
else
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
elseif(accountManager == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(accountManager == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
end
 
if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end
 
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
 
registerCreatureEvent(cid, "killer")
registerCreatureEvent(cid, "Idle")
 
registerCreatureEvent(cid, "attackguild") 
registerCreatureEvent(cid, "advance")
registerCreatureEvent(cid, "FimVip")
 
registerCreatureEvent(cid, "DeathC")
registerCreatureEvent(cid, "SkullCheck")
registerCreatureEvent(cid, "ReportBug")
 
registerCreatureEvent(cid, "PlayerKill")
registerCreatureEvent(cid, "ZombieAttack")
registerCreatureEvent(cid, "DeathBroadcast")
registerCreatureEvent(cid, "SkullAmulet")
registerCreatureEvent(cid, "BlessDrop")
registerCreatureEvent(cid, "DeathList")
registerCreatureEvent(cid, "GalaxySkullAmulet")
registerCreatureEvent(cid, "BloquearMagia")
registerCreatureEvent(cid, "onPrepareDeathinifi")
registerCreatureEvent(cid, "Aurea")
registerCreatureEvent(cid, "checkNewTop")
registerCreatureEvent(cid, "LevelRecompense")
 
if (InitArenaScript ~= 0) then
InitArenaScript = 1
end
for i = 42300, 42309 do
setGlobalStorageValue(i, 0)
setGlobalStorageValue(i+100, 0)
end
-- if he did not make full arena 1 he must start from zero
if getPlayerStorageValue(cid, 42309) < 1 then
for i = 42300, 42309 do
setPlayerStorageValue(cid, i, 0)
end
end
-- if he did not make full arena 2 he must start from zero
if getPlayerStorageValue(cid, 42319) < 1 then
for i = 42310, 42319 do
setPlayerStorageValue(cid, i, 0)
end
end
-- if he did not make full arena 3 he must start from zero
if getPlayerStorageValue(cid, 42329) < 1 then
for i = 42320, 42329 do
setPlayerStorageValue(cid, i, 0)
end
end
if getPlayerStorageValue(cid, 42355) == -1 then
setPlayerStorageValue(cid, 42355, 0) -- did not arena level
end
setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
setPlayerStorageValue(cid, 42352, 0) -- is not in arena 
 
function Vodka(cid)
db.executeQuery("UPDATE `players` SET `name` = '"..string.sub(getCreatureName(cid), 7).."' WHERE `id` = "..getPlayerGUID(cid))
doRemoveCreature(cid)
end
if getCreatureName(cid):find('(VIP)') and getPlayerStorageValue(cid, 85258) - os.time() <= 0 then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
addEvent(Vodka,2000,cid)
end
 
registerCreatureEvent(cid, "Rankfrags")
setFrags(cid)
 
return true
end

Firmão igual um prego na areia,
Prego, jogou o ego, dentro de um buraco,
Um Bon vivant, jamais mostra o ponto fraco,
Pergunte a Sansão quem foi Dalila...

  • Respostas 8
  • Visualizações 430
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Autor

problema ta no account manager né não ??

 

local lever = {

[7045] = {30,30,{2160}}

}
function onUse(cid,item,fromPosition,itemEx,toPosition)
if getPoints(cid) < lever[item.actionid][1] then
return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Você precisa de "..lever[item.actionid][1].." points.")
end
removePoints(cid,lever[item.actionid][1])
local add = (lever[item.actionid][2]*86400)
setPlayerStorageValue(cid, 85258, getPlayerStorageValue(cid, 85258) - os.time() <= 0 and (os.time() + add) or (getPlayerStorageValue(cid, 85258) + add))
local quantity = math.floor((getPlayerStorageValue(cid, 85258) - os.time())/(24 * 60 * 60))  
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.") 
for _, items in pairs(lever[item.actionid][3]) do
doPlayerAddItem(cid,items,1)
end 
if not getCreatureName(cid):find('(VIP)') then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
db.executeQuery("UPDATE `players` SET `name` = '(VIP) "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";") 
addEvent(doRemoveCreature, 3*1000, cid)
end 
return true
end

Firmão igual um prego na areia,
Prego, jogou o ego, dentro de um buraco,
Um Bon vivant, jamais mostra o ponto fraco,
Pergunte a Sansão quem foi Dalila...

Postado

Caso nenhum dos dois scripts postados abaixos derem certo, volte aqui para tentarmos solucionar novamente.

e não é no acc manager não... 

 

tente este primeiro: 

 

Spoiler

Action.xml

 

<action uniqueid="35400" script="vipname.lua" />

 

Spoiler

vipname.lua

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

if item.uid == 35400 then

queststatus = getPlayerStorageValue(cid,85258)

if queststatus == -1 or queststatus == 0 then

doCreatureSay(cid, "VOcê recebeu seu beneficio por ser vip!", TALKTYPE_ORANGE_1)

db.executeQuery("UPDATE `players` SET `name` = '[VIP] "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";")

doPlayerSendTextMessage(cid,25,"Você será kickado em 5 segundos para mudança de nome.")

doPlayerAddAddons(cid, 1)

addEvent(doRemoveCreature, 5*1000, cid, true)

setPlayerStorageValue(cid,85258, 1)

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)

else

doPlayerSendTextMessage(cid,22,"você ja tem o [VIP] no nome.")

end

return true

end

end

 

em Seguida, tente esta:

 

data\action\scripts

vipname.lua

Spoiler

function onUse(cid, item, fromPosition, itemEx, toPosition)
 
local name = getCreatureName(cid)
local days = 30 -- dias que serão adicionados
local strg = 85258 -- 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

 

 

 

 

data\actions 

adicione essa tag no actions.xml   (TROQUE O XX PELO ID DO ITEM)

Spoiler

<action itemid="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" script="vipname.lua"/>

 

 

 

data\creaturescripts\scripts

endvip.lua

Spoiler

local strg = 85258 -- 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

 

 

data\creaturescripts 

adicione essa tag no creaturescripts.xml

Spoiler

<event type="login" name="CheckVip" script="endvip.lua"/>

 

vá em data\creaturescripts\scripts e coloque essa função depois das outras no login.lua

Spoiler

registerCreatureEvent(cid, "CheckVip")

 

Quote

Creditos: Wend // smart box

Editado por Thunder Black
Stge (veja o histórico de edições)

Postado
  • Autor

obrigado, assim que eu testa te falo o vip ta do mesmo jeito q antes né vai sair sozinho tudo mais tu só tentou arrumar o account manager pra não poder criar player com mesmo nome de quem tem vip né ??

Firmão igual um prego na areia,
Prego, jogou o ego, dentro de um buraco,
Um Bon vivant, jamais mostra o ponto fraco,
Pergunte a Sansão quem foi Dalila...

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