Jump to content

Log's


Recommended Posts

Posted

Opa tudo bom eu gostaria de ter uma ideia basica de como criar um log de um chat pra eu pegar como referencia Ex:

 

addEventHandler("onPlayerCommand",root,
    function(command)
	if command == "me" or command == "register" or command == "login" or command == "msg" then
	    cancelEvent()
	end
end)

DESATIVAR_TWITTER = false
DESATIVAR_DEEPWEB = false

function MensagemAnon ( source, cmd, ...)
    if DESATIVAR_DEEPWEB == true then
	    return outputChatBox ( "* Chat Desativado Temporariamente!", source, 255, 255, 255, true )
	end
    local MessagemANS = table.concat ( { ... }, " " );
    for _, player in ipairs ( getElementsByType ( "player" ) ) do
	    MessagemANS = string.gsub(MessagemANS, "#%x%x%x%x%x%x", "")
		--Jogador = getPlayerName ( source )
		--Jogador2 = string.gsub(Jogador, "#%x%x%x%x%x%x", "")
		
		--local Conta = getAccountName ( getPlayerAccount ( source ) )
		--if Conta == "AndreJr" or Conta == "tridentgostoso" then return end
		
	    if getElementData ( player, "Anti_Fome" ) ~= "Sim" then
            outputChatBox ( "* #A4A4A4 ᴅᴇᴇᴘ ᴡᴇʙ - "..MessagemANS, player, 255, 255, 255, true )
		end
    end
	adminchat ( source, MessagemANS )
end
addCommandHandler ( "u", MensagemAnon )

function MensagemTwitter ( source, cmd, ...) 
    if DESATIVAR_TWITTER == true then
	    return outputChatBox ( "* Chat Desativado Temporariamente!", source, 255, 255, 255, true )
	end
    local MessagemANS = table.concat ( { ... }, " " );
    for _, player in ipairs ( getElementsByType ( "player" ) ) do
	    MessagemANS = string.gsub(MessagemANS, "#%x%x%x%x%x%x", "")
		Jogador = getPlayerName ( source )
		Jogador2 = string.gsub(Jogador, "#%x%x%x%x%x%x", "")
		
		--local Conta = getAccountName ( getPlayerAccount ( source ) )
		--if Conta == "AndreJr" or Conta == "tridentgostoso" then return end
		
        if isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Console" ) ) then
	        outputChatBox ( "* #00FA9Aᴛᴡɪᴛᴛᴇʀ - #00FF00Presidente #FF00FF- ".. Jogador2 .." #00FA9A- "..MessagemANS, player, 255, 255, 255, true )		
		elseif isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Everyone" ) ) then
		    outputChatBox ( "* #2E9AFEᴛᴡɪᴛᴛᴇʀ - #ffffff".. Jogador2 .." #2E9AFE- "..MessagemANS, player, 255, 255, 255, true )
		end
    end
end
addCommandHandler ( "i", MensagemTwitter )

 

eu gostaria de criar um log que registre tudo que seja falado  no ex : twitter com o login , nick e serial da pessoa

  • Other Languages Moderators
Posted (edited)

Não precisa criar um log novo para isso.

Usando a função outputServerLog, já faz o texto ser registrado no arquivo server.log do servidor.

local conta = getAccountName (getPlayerAccount (source))
local serial = getPlayerSerial (source)

outputServerLog ("CHAT: [CHAT-TWITTER] "..jogador.." (login: "..conta..")".." ("..serial..")"..": "..MessagemANS)

Obs: Você não deveria usar source dessa maneira. Apesar de funcionar.

Edited by Lord Henry

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...