Ir para conteúdo
  • Cadastre-se

Ajuda Creaturescript Login plzz


Posts Recomendados

Ajuda plzz! erro en creaturescript login line 5 : 

for i, player in ipairs(getOnlinePlayers()) do

050- function erro line 660:

table.insert(players, getCreatureName(cid)) 

post-113750-0-20574000-1405214197_thumb.

Link para o post
Compartilhar em outros sites

Poste o seu login.lua

YDmXTU2.png

 

Entenda tudo sobre VPS, DEDICADOS & HOSPEDAGENS. => Clique aqui

Global Full Download 10.9x - TFS 1.2/FERUMBRAS/KRAILOS. => Clique aqui

 

Muitos querem aquilo que você tem, 
mas vão desistir quando souberem o preço que você pagou.

 

skype-favicon.png lu.lukinha

message-16.png [email protected]

Link para o post
Compartilhar em outros sites
function onLogin(cid)
accountManager = "Account Manager"                       
managerCounter = 0

   for i, player in ipairs(getOnlinePlayers()) do
      if accountManager:lower() == player:lower() then             
      managerCounter = managerCounter + 1
      end 
   end
 
   if managerCounter >= 3 then
      return false
   end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
	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 getPlayerPremiumDays(cid) <= 0 and getPlayerStorageValue(cid,100000) == 1 then
		doPlayerSetTown(cid, 2)
        setPlayerStorageValue(cid,100000,2)
        doTeleportThing(cid,{x=72, y=25, z=8})
        doPlayerPopupFYI(cid, "Your premium time has expired and you've been teleported to Main Land. You're now alived to Deheon.")
		if getPlayerSex(cid) == 1 then
			doCreatureChangeOutfit(cid,{lookType = 128, lookHead = 78, lookBody = 68, lookLegs = 58, lookFeet = 95, lookAddons = 0})
		elseif getPlayerSex(cid) ~= 1 then
			doCreatureChangeOutfit(cid,{lookType = 136, lookHead = 78, lookBody = 68, lookLegs = 58, lookFeet = 95, lookAddons = 0})
		end
	end


	if(not isPlayerGhost(cid)) and (isVip(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
	elseif(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	local lastLogin, str = getPlayerLastLoginSaved(cid)
		
	if(lastLogin >= 0) then
		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)
	
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	registerCreatureEvent(cid, "TempleTeleporter") --VIP
	registerCreatureEvent(cid, "VipCheck") --VIP

	registerCreatureEvent(cid, "advance")
	registerCreatureEvent(cid, "bp")
	registerCreatureEvent(cid, "Achievements")
	registerCreatureEvent(cid, "fullmh")
	registerCreatureEvent(cid, "primeiro")
	registerCreatureEvent(cid, "killcount")
	registerCreatureEvent(cid, "playeradvance")
	registerCreatureEvent(cid, "radvance")
	registerCreatureEvent(cid, "counter")
	registerCreatureEvent(cid, "countKill")
	
	registerCreatureEvent(cid, "Grizzly_Adams") 

	registerCreatureEvent(cid, "demonOakLogout")
	registerCreatureEvent(cid, "demonOakDeath")
	registerCreatureEvent(cid, "demonOakAttack")

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")
	registerCreatureEvent(cid, "idle")
	registerCreatureEvent(cid, "SkullCheck")

	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "XpVip")
	registerCreatureEvent(cid, "Zaoarena")
	registerCreatureEvent(cid, "ArenaKill")

	registerCreatureEvent(cid, "Tirecz")

	registerCreatureEvent(cid, "Inquisition")  
    registerCreatureEvent(cid, "inquisitionPortals")
	registerCreatureEvent(cid, "arenaPortals") 
	
	registerCreatureEvent(cid, "ZombieAttack")
	registerCreatureEvent(cid, "ZE")
	registerCreatureEvent(cid, "Uze2")
	registerCreatureEvent(cid, "Uze3")
	
	registerCreatureEvent(cid, "RushCombat")
	registerCreatureEvent(cid, "RushAttack")
	registerCreatureEvent(cid, "RushDead")
	registerCreatureEvent(cid, "RushOutfit")
	registerCreatureEvent(cid, "Monsterhunter")
	
	registerCreatureEvent(cid, "BountyHunter")
	
	registerCreatureEvent(cid, "defence")
 
	registerCreatureEvent(cid, "Frag Reward")


--- CRITICAL SYSTEM ----
registerCreatureEvent(cid, "critical")
if getPlayerStorageValue(cid, 48913) == -1 then
        setPlayerStorageValue(cid, 48913, 0) 
    end 

-----[[Dodge System ----

registerCreatureEvent(cid, "dodge")
if getPlayerStorageValue(cid, 48902) == -1 then
        setPlayerStorageValue(cid, 48902, 0) 
    end
----------MAGMA BOOTS DO FOX----------------
registerCreatureEvent(cid, "magmaboots")
if getPlayerStorageValue(cid, 19501) ~= 0 then
        setPlayerStorageValue(cid, 19501, 0) 
end
---------------------------------------
 -- first login ~ Outfit Windows 
    if getPlayerStorageValue(cid, 1228512) == -1 then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Please choose your outfit.")
		doPlayerSendOutfitWindow(cid)
 		setPlayerStorageValue(cid,1228512, 1)
	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  
	return true
end
Link para o post
Compartilhar em outros sites

Troque por:

function onLogin(cid)
accountManager = "Account Manager"                       
managerCounter = 0
 
   if managerCounter >= 3 then
      return false
   end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
	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 getPlayerPremiumDays(cid) <= 0 and getPlayerStorageValue(cid,100000) == 1 then
		doPlayerSetTown(cid, 2)
        setPlayerStorageValue(cid,100000,2)
        doTeleportThing(cid,{x=72, y=25, z=8})
        doPlayerPopupFYI(cid, "Your premium time has expired and you've been teleported to Main Land. You're now alived to Deheon.")
		if getPlayerSex(cid) == 1 then
			doCreatureChangeOutfit(cid,{lookType = 128, lookHead = 78, lookBody = 68, lookLegs = 58, lookFeet = 95, lookAddons = 0})
		elseif getPlayerSex(cid) ~= 1 then
			doCreatureChangeOutfit(cid,{lookType = 136, lookHead = 78, lookBody = 68, lookLegs = 58, lookFeet = 95, lookAddons = 0})
		end
	end


	if(not isPlayerGhost(cid)) and (isVip(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
	elseif(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	local lastLogin, str = getPlayerLastLoginSaved(cid)
		
	if(lastLogin >= 0) then
		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)
	
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	registerCreatureEvent(cid, "TempleTeleporter") --VIP
	registerCreatureEvent(cid, "VipCheck") --VIP

	registerCreatureEvent(cid, "advance")
	registerCreatureEvent(cid, "bp")
	registerCreatureEvent(cid, "Achievements")
	registerCreatureEvent(cid, "fullmh")
	registerCreatureEvent(cid, "primeiro")
	registerCreatureEvent(cid, "killcount")
	registerCreatureEvent(cid, "playeradvance")
	registerCreatureEvent(cid, "radvance")
	registerCreatureEvent(cid, "counter")
	registerCreatureEvent(cid, "countKill")
	
	registerCreatureEvent(cid, "Grizzly_Adams") 

	registerCreatureEvent(cid, "demonOakLogout")
	registerCreatureEvent(cid, "demonOakDeath")
	registerCreatureEvent(cid, "demonOakAttack")

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")
	registerCreatureEvent(cid, "idle")
	registerCreatureEvent(cid, "SkullCheck")

	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "XpVip")
	registerCreatureEvent(cid, "Zaoarena")
	registerCreatureEvent(cid, "ArenaKill")

	registerCreatureEvent(cid, "Tirecz")

	registerCreatureEvent(cid, "Inquisition")  
    registerCreatureEvent(cid, "inquisitionPortals")
	registerCreatureEvent(cid, "arenaPortals") 
	
	registerCreatureEvent(cid, "ZombieAttack")
	registerCreatureEvent(cid, "ZE")
	registerCreatureEvent(cid, "Uze2")
	registerCreatureEvent(cid, "Uze3")
	
	registerCreatureEvent(cid, "RushCombat")
	registerCreatureEvent(cid, "RushAttack")
	registerCreatureEvent(cid, "RushDead")
	registerCreatureEvent(cid, "RushOutfit")
	registerCreatureEvent(cid, "Monsterhunter")
	
	registerCreatureEvent(cid, "BountyHunter")
	
	registerCreatureEvent(cid, "defence")
 
	registerCreatureEvent(cid, "Frag Reward")


--- CRITICAL SYSTEM ----
registerCreatureEvent(cid, "critical")
if getPlayerStorageValue(cid, 48913) == -1 then
        setPlayerStorageValue(cid, 48913, 0) 
    end 

-----[[Dodge System ----

registerCreatureEvent(cid, "dodge")
if getPlayerStorageValue(cid, 48902) == -1 then
        setPlayerStorageValue(cid, 48902, 0) 
    end
----------MAGMA BOOTS DO FOX----------------
registerCreatureEvent(cid, "magmaboots")
if getPlayerStorageValue(cid, 19501) ~= 0 then
        setPlayerStorageValue(cid, 19501, 0) 
end
---------------------------------------
 -- first login ~ Outfit Windows 
    if getPlayerStorageValue(cid, 1228512) == -1 then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Please choose your outfit.")
		doPlayerSendOutfitWindow(cid)
 		setPlayerStorageValue(cid,1228512, 1)
	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  
	return true
end

Reinicie o servidor e teste.

YDmXTU2.png

 

Entenda tudo sobre VPS, DEDICADOS & HOSPEDAGENS. => Clique aqui

Global Full Download 10.9x - TFS 1.2/FERUMBRAS/KRAILOS. => Clique aqui

 

Muitos querem aquilo que você tem, 
mas vão desistir quando souberem o preço que você pagou.

 

skype-favicon.png lu.lukinha

message-16.png [email protected]

Link para o post
Compartilhar em outros sites

muito obrigado, que mudanças que você fez? Preciso mudar 050-função?, agora comprova o que você me escreveu

 

Apenas retirei a inútil função do getOnline.

 

 

Á disponha.

YDmXTU2.png

 

Entenda tudo sobre VPS, DEDICADOS & HOSPEDAGENS. => Clique aqui

Global Full Download 10.9x - TFS 1.2/FERUMBRAS/KRAILOS. => Clique aqui

 

Muitos querem aquilo que você tem, 
mas vão desistir quando souberem o preço que você pagou.

 

skype-favicon.png lu.lukinha

message-16.png [email protected]

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo