Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Bom, aparentemente não há nada de errado.

 

Penso que o @MaTTch tem razão.

 

Se puder, coloque o 'script' '

data > creaturescripts > creaturescripts.xml

e o seu arquivo

data > creaturescripts > scripts > login.lua 

para analisarmos.

 

Se por enquanto ajudei ou esclarecirep.png.c92df89ca871679927da6d7fc0fe084d

5YkRF3w.gif

 

 

 

 

 

 

CzysZUR.gifytaam6k.png

 

 

  • Respostas 22
  • Visualizações 1.1k
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Autor
1 minuto atrás, Xagah disse:

Bom, aparentemente não há nada de errado.

 

Penso que o @MaTTch tem razão.

 

Se puder, coloque o 'script' '


data > creaturescripts > creaturescripts.xml

e o seu arquivo


data > creaturescripts > scripts > login.lua 

para analisarmos.

 

Se por enquanto ajudei ou esclarecirep.png.c92df89ca871679927da6d7fc0fe084d

creaturescripts.xml

 

Spoiler

 

<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
    <event type="login" name="PlayerLogin" event="script" value="login.lua"/>

    <event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
    <event type="receivemail" name="Mail" event="script" value="mail.lua"/>
    <event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
        <event type="preparedeath" name="onPrepareDeath" event="script" value="preparedeath.lua"/>

    <event type="think" name="Idle" event="script" value="idle.lua"/>
    <event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>
    <event type="death" name="PlayerDeath" event="script" value="playerdeath.lua"/>
    <event type="login" name="FirstItems" event="script" value="firstitems.lua"/>

    <event type="PrepareDeath" name="pvparena" script="pvparena.lua"/>
    <event type="attack" name="attackguild" script="attackguild.lua"/>
    <event type="login" name="entrou" script="entrou.lua"/>

    <event type="death" name="tp1" event="script" value="NathanFischer/tp1.lua"/>
    <event type="death" name="tp2" event="script" value="NathanFischer/tp2.lua"/>
    <event type="death" name="tp3" event="script" value="NathanFischer/tp3.lua"/>
    <event type="login" name="tkexp" script="NathanFischer/tkexp.lua"/>
    <event type="kill" name="anunciarmorte" event="script" value="NathanFischer/anunciar_morte.lua"/>

<event type="think" name="ZombieThink" event="script" value="zombie/onthink.lua"/>
<event type="statschange" name="ZombieAttack" event="script" value="zombie/onattack.lua"/>
<event type="death" name="ZombieDeath" event="script" value="zombie/ondeath.lua"/>

<event type="login" name="PlayerAddPointsTimer" event="script" value="NathanFischer/points.lua"/>
<event type="logout" name="PlayerResetPointsTimer" event="script" value="NathanFischer/points.lua"/>

<event type="think" name="TiraBattle" event="script" value="tirabattle.lua"/>


<event type="login" name="playercheck" script="playercheck.lua"/>
<event type="antiacc" name="playercheck" script="antiacc.lua"/>

    </creaturescripts>

 

login.lua
 

Spoiler

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 starts 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, "anunciarmorte")
    registerCreatureEvent(cid, "GuildMotd")
    
registerCreatureEvent(cid, "killer")
registerCreatureEvent(cid, "saiu")
registerCreatureEvent(cid, "entrou")
registerCreatureEvent(cid, "Idle")

registerCreatureEvent(cid, "attackguild")
registerCreatureEvent(cid, "onPrepareDeath")    
registerCreatureEvent(cid, "advance")
registerCreatureEvent(cid, "ZombieAttack")
registerCreatureEvent(cid, "TiraBattle")
registerCreatureEvent(cid, "warSystem")
registerCreatureEvent(cid, "tkexp")
registerCreatureEvent(cid, "entrou")
registerCreatureEvent(cid, "advance")
registerCreatureEvent(cid, "BoasVindas")
registerCreatureEvent(cid, "FimVip")
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Bem Vindo ao HF Serv! Você conseguira donates realizando a quest (somente em grupo ira conseguir completar), completando TASK (NPC NA SALA DE TPS), ficando online (ira ganhar pontos a cada 1 hora para trocar por donates ou ira ganhar na loteria) e comprando no NPC na area VIP2 (1 donate = 25kk)")
registerCreatureEvent(cid, "SkullCheck")
    registerCreatureEvent(cid, "ReportBug")

registerCreatureEvent(cid, VipReceive)
registerCreatureEvent(cid, "PlayerKill")
registerCreatureEvent(cid, "FragReward")
    if (InitArenaScript ~= 0) then
    InitArenaScript = 1
    -- make arena rooms free
        for i = 42300, 42309 do
            setGlobalStorageValue(i, 0)
            setGlobalStorageValue(i+100, 0)
        end
    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
 

 

Postado
  • Autor
1 minuto atrás, Xagah disse:

Tá, agora, por favor, poste estes dois 'scripts':


data > creaturescripts > scripts > playercheck.lua

data > creaturescripts > scripts > antiacc.lua

 

playercheck.lua

Spoiler

local config = {
msg = "Anti-MC System by NathanFischer.",
maxMultiClients = 3,
allowGroupId = 2,
ignoreIps = {"hf-serv.no-ip.org",}
}
function onLogin(cid)
if getPlayerGroupId(cid) >= config.allowGroupId then
return TRUE
end
local number
local playersOnline = getPlayersOnline()
for _, pid in pairs(playersOnline) do
local pip = getPlayerIp(pid)
if cid ~= pid and getPlayerIp(cid) == pip and not isInArray(config.ignoreIps, doConvertIntegerToIp(getPlayerIp(cid))) then
number = (number or 0) + 1
if number > config.maxMultiClients then
return FALSE, doPlayerPopupFYI(cid, config.msg)
end
end
end
return TRUE
end

anticc.lua

Spoiler

local config = {
max = 6, -- número de Account Manager permitido para logar de uma só vez
group_id = "Account Manager" -- kikar apenas player com o group id 1
}

local accepted_ip_list = {} -- lista dos players permitidos a usar MC, exemplo: {"200.85.3.60", "201.36.5.222"}

local function antiMC(p)
if (#getPlayersByIp(getPlayerIp(p.pid)) >= p.max) then
doRemoveCreature(p.pid)
end
return true
end

function onLogin(cid)
if getPlayerName(cid) == config.group_id then
if isInArray(accepted_ip_list,doConvertIntegerToIp(getPlayerIp(cid))) == false then
addEvent(antiMC, 1000, {pid = cid, max = config.max+1})
end
end
return true
end

 

Postado

@marcosfarias, enquanto eu dou uma olhada aqui, muda o 'interval' desta linha do seu 'globalevents.xml' para 10000.

<globalevent name="points" interval="60" event="script" value="NathanFischer/points.lua"/>

Está curtíssimo este tempo, eis que o valor está em milisegundos. Logo, em menos de 1 segundo este evento foi rodado mais de 17 vezes.

 

Após, veja se o 'server' continua caindo.

 

Fico no aguardo.

5YkRF3w.gif

 

 

 

 

 

 

CzysZUR.gifytaam6k.png

 

 

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