Ir para conteúdo

Dúvida Urgente Sobre !online E Scripts !


LucasAM

Posts Recomendados

Gente, é o seguinte : Meu Server é aquele que toda vez que alguém loga aparece : [89] Lolz acabou de entrar no servidor.

[89] Lolz acabou de sair do servidor.

 

E no meu server, quando os GMS/GODS/CMS (ETC) entram também aparece :

[1] GM WOL acabou de entrar no servidor.

[1] GM WOL acabou de sair do servidor.

 

Eu gostaria de continuar com esse script, mas que os GMS quando entrassem não aparecessem . Por favor me ajudem.

 

Sobre o online : Quando os players falam !online os GMS/GODS/CMS (ETC) aparecem também no comando : !online ~~> players online : GM WOL, godofredo, wilarian, hudrud.

 

Por favor alguém me ajudem a resolver esses 2 problemas. Vou postar os scripts para vocês :

 

SCRIPT ENTROU :

 

function onLogin(cid)

doBroadcastMessage(getPlayerName(cid) .. " [" .. getPlayerLevel(cid) .. "]: acabou de entrar no servidor", MESSAGE_STATUS_CONSOLE_ORANGE)

return TRUE

end

 

SCRIPT SAIU :

 

function onLogout(cid)

doBroadcastMessage(getPlayerName(cid) .. " [" .. getPlayerLevel(cid) .. "]: acabou de sair do servidor", MESSAGE_STATUS_CONSOLE_ORANGE)

return TRUE

end

 

SCRIPT LOGIN (Nao sei se tem a ver mas vou por) :

 

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, "GuildMotd")

 

registerCreatureEvent(cid, "killer")

registerCreatureEvent(cid, "saiu")

registerCreatureEvent(cid, "entrou")

registerCreatureEvent(cid, "Idle")

 

registerCreatureEvent(cid, "attackguild")

registerCreatureEvent(cid, "onPrepareDeath")

registerCreatureEvent(cid, "advance")

registerCreatureEvent(cid, "FimVip")

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

 

CREATURESCRIPTS.XML :

 

<?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="login" name="StartSkills" event="script" value="startskills.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="advance" name="advance" script="advance.lua"/>

<event type="attack" name="attackguild" script="attackguild.lua"/>

<event type="death" name="incendio" script="incendioMonster.lua"/>

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

<event type="logout" name="saiu" script="saiu.lua"/>

</creaturescripts>

 

TALKACTION !ONLINE :

 

local config = {

showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))

}

 

function onSay(cid, words, param, channel)

local players = getPlayersOnline()

local strings = {""}

 

local i, position = 1, 1

local added = false

for _, pid in ipairs(players) do

if(added) then

if(i > (position * 7)) then

strings[position] = strings[position] .. ","

position = position + 1

strings[position] = ""

else

strings[position] = i == 1 and "" or strings[position] .. ", "

end

end

 

if((config.showGamemasters or getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) or not getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) and (not isPlayerGhost(pid) or getPlayerGhostAccess(cid) >= getPlayerGhostAccess(pid))) then

strings[position] = strings[position] .. getCreatureName(pid) .. " [" .. getPlayerLevel(pid) .. "]"

i = i + 1

added = true

else

added = false

end

end

 

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player(s) online:")

for i, str in ipairs(strings) do

if(str:sub(str:len()) ~= ",") then

str = str .. "."

end

 

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)

end

 

return true

end

 

OBRIGADO, E ESPERO AJUDA. ABRAÇOS.

Link para o comentário
Compartilhar em outros sites

troque SCRIPT ENTROU por:

 

function onLogin(cid)

if getPlayerAccess(cid) <= 3 then

doBroadcastMessage(getPlayerName(cid) .. " [" .. getPlayerLevel(cid) .. "]: acabou de entrar no servidor", MESSAGE_STATUS_CONSOLE_ORANGE)

return TRUE

end

return TRUE

end

 

 

troque SCRIPT SAIU por:

 

 

 

function onLogout(cid)

if getPlayerAccess(cid) <= 3 then

doBroadcastMessage(getPlayerName(cid) .. " [" .. getPlayerLevel(cid) .. "]: acabou de sair do servidor", MESSAGE_STATUS_CONSOLE_ORANGE)

return TRUE

end

return TRUE

end

 

 

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...