IS

[Encerrado] ->Help<- Lag Quando Cria Novos Players

Por ispeto, 13 de jun. de 2010 em Tópicos Sem Resposta

script
4
1.5k
ispetoI
13 de junho de 2010 às 19:07

Galera fis um ot de war Quando um Novo player cria o char e entra OT TRAVA

Depois Volta Alguem sabe Como tira Isso?

Por favor me ajudem ;/

e se alguem tiver o script de faser td pt ficar com a mesma ropa Tambem gostaria

desde já MT oBRIGADO 'Espero respostas

caarolina12C
13 de junho de 2010 às 19:43

Qual versão é seu server?

 

Se for 8.54+ vá em data/creaturescripts/script/login.lua

 

se não tiver o script crie um arquivo chamado login.lua e coloque isso dentro:

 

local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

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, "Idle")
if(config.useFragHandler) then
	registerCreatureEvent(cid, "SkullCheck")
end

registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
return true
end

 

e em data/creaturescripts/creaturescripts.xml adicione esta tag:

 

<event type="login" name="PlayerLogin" event="script" value="login.lua"/>

 

se não for 8.54+, esquece esse script

 

tambem pode ser o account manager.. tem várias possibilidades!

ispetoI
13 de junho de 2010 às 20:03

Vou ver se esta sem a tau trava

 

Mt Obrigado (y)

 

Ai jow foi saiu o lag + agora quando o player morre

cai bp e uma pa de coisa :X

meu Login.lua é esse

local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
if getPlayerName(cid) ~= "Account Manager" then
	doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	doPlayerAddBlessing(cid, 1)
	doPlayerAddBlessing(cid, 2)
	doPlayerAddBlessing(cid, 3)
	doPlayerAddBlessing(cid, 4)
	doPlayerAddBlessing(cid, 5)
	doPlayerAddPremiumDays(cid, 2)
	doPlayerSetPromotionLevel(cid, 1)
end
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, "Idle")
if(config.useFragHandler) then
	registerCreatureEvent(cid, "SkullCheck")
end

registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "FragReward")
return true
end

7 anos depois...
StigalS
19 de abril de 2018 às 17:49
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.