Jump to content

[AJUDA] Chat anonimo para STAFF


Recommended Posts

Eai rapaziada, eu estou tentando colocar o CHAT ANONIMO no meu servidor e que apareça o 

nome do player somente para quem está na ACL "Staff", mas quando algum player manda
mesnagem, o nick dele não aparece para mim, me ajuda ai porfavor.

function adminchat4 ( thePlayer, _, ... )
    local message = table.concat ( { ... }, " " )
    if ( isPlayerOnGroup ( thePlayer ) ) then
    for _, player in ipairs ( getElementsByType ( "player" ) ) do
    if ( isPlayerOnGroup ( player ) ) then

	if getElementData (thePlayer, "ChatGlobal:Delay1", true) then
	outputChatBox ( MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true ) return end

	conta = getAccountName(getPlayerAccount(thePlayer))					

	if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then
	outputChatBox("* #bfbfbfDeep Web - #ffffff"..getPlayerName(thePlayer).. " ("..getPlayerID(thePlayer)..") #bfbfbf- "..message, player, 255, 255, 255, true)
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Staff" ) ) then
	outputChatBox("* #bfbfbfDeep Web - #ffffff"..getPlayerName(thePlayer).. " ("..getPlayerID(thePlayer)..") #bfbfbf- "..message, player, 255, 255, 255, true)
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then
	outputChatBox("* #bfbfbfDeep Web - "..message, player, 255, 255, 255, true)

	end
    end
    end
    end

	setElementData ( thePlayer, "ChatGlobal:Delay2",true )
    setTimer ( setElementData, 100, 1, thePlayer, "ChatGlobal:Delay2", false )
end
addCommandHandler ( ComandoDoChatGlobal4, adminchat4 )

 

Edited by BlackinSCR
Link to comment
On 20/04/2021 at 11:34, BlackinSCR said:

Eai rapaziada, eu estou tentando colocar o CHAT ANONIMO no meu servidor e que apareça o 

nome do player somente para quem está na ACL "Staff", mas quando algum player manda
mesnagem, o nick dele não aparece para mim, me ajuda ai porfavor.



function adminchat4 ( thePlayer, _, ... )
    local message = table.concat ( { ... }, " " )
    if ( isPlayerOnGroup ( thePlayer ) ) then
    for _, player in ipairs ( getElementsByType ( "player" ) ) do
    if ( isPlayerOnGroup ( player ) ) then

	if getElementData (thePlayer, "ChatGlobal:Delay1", true) then
	outputChatBox ( MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true ) return end

	conta = getAccountName(getPlayerAccount(thePlayer))					

	if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then
	outputChatBox("* #bfbfbfDeep Web - #ffffff"..getPlayerName(thePlayer).. " ("..getPlayerID(thePlayer)..") #bfbfbf- "..message, player, 255, 255, 255, true)
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Staff" ) ) then
	outputChatBox("* #bfbfbfDeep Web - #ffffff"..getPlayerName(thePlayer).. " ("..getPlayerID(thePlayer)..") #bfbfbf- "..message, player, 255, 255, 255, true)
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then
	outputChatBox("* #bfbfbfDeep Web - "..message, player, 255, 255, 255, true)

	end
    end
    end
    end

	setElementData ( thePlayer, "ChatGlobal:Delay2",true )
    setTimer ( setElementData, 100, 1, thePlayer, "ChatGlobal:Delay2", false )
end
addCommandHandler ( ComandoDoChatGlobal4, adminchat4 )

 

Bom vamos lá! @BlackinSCR Gostei do nick haha' 

function adminchat4 ( thePlayer, _, ... )
    local message = table.concat ( { ... }, " " )
    if ( isPlayerOnGroup ( thePlayer ) ) then
    for _, player in ipairs ( getElementsByType ( "player" ) ) do
    if ( isPlayerOnGroup ( player ) ) then

	if getElementData (thePlayer, "ChatGlobal:Delay1", true) then
	outputChatBox ( MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true ) return end

	local conta = getAccountName(getPlayerAccount(player))		-- Aqui voce deve verificar para quem irá aparcer a mensagem (player definido no for)			

	if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Staff" ) ) then
	outputChatBox("* #bfbfbfDeep Web - #ffffff"..getPlayerName(thePlayer).. " ("..getPlayerID(thePlayer)..") #bfbfbf- "..message, player, 255, 255, 255, true)
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then
	outputChatBox("* #bfbfbfDeep Web - "..message, player, 255, 255, 255, true)

	end
    end
    end
    end

	setElementData ( thePlayer, "ChatGlobal:Delay2",true )
    setTimer ( setElementData, 100, 1, thePlayer, "ChatGlobal:Delay2", false )
end
addCommandHandler ( ComandoDoChatGlobal4, adminchat4 )

 

Edited by Lord Henry
Script convertido de HTML para Lua.
  • Haha 1
Link to comment

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...