Sign in to follow this  
Hize

Chat anonimo para ADMIN

Recommended Posts

to com um chat RP aqui e eu queria sabe ,como faço para quem tiver da ACL : STAFF vai mostrar quem Falou no anonimo tipo [Anonimo] Nick - mensagem e quem nao tiver na ACL aparecer sem o nick

 

server-side

function getPlayerID(player)
return  getElementData(player,"ID")
end

function getPlayerIDG(thePlayer)
return  getElementData(thePlayer,"ID")
end

--------------------------------------------------------------------------------------------

DistanciaDoChatLocal = 80 -- Metros

ComandoDoChatGlobal =                "rp" -- Ex /g Mensagem
ComandoDoChatGlobal2 =                "twitter" -- Ex /g Mensagem
ComandoDoChatGlobal3 =                "olx" -- Ex /g Mensagem
ComandoDoChatGlobal4 =                "anonimo" -- Ex /g Mensagem
ValorDoChatGlobal = 0 -- Dinheiro

--------------------------------------------------------------------------------------------

-- Config do Chat Local

addEventHandler("onPlayerChat", root, function(tresc, msgtype)
if (msgtype == 0) then
    cancelEvent()
	local x,y,z = getElementPosition(source)
	for key, gracze in ipairs(getElementsByType("player")) do
	local x2,y2,z2 = getElementPosition(gracze)

	if getElementData (source, "ChatLocal:Delay", true) then
	outputChatBox ( MensagemFalandoRapidoDemaisLocal, source, 255, 255, 255, true ) return end

	if ( getDistanceBetweenPoints3D ( x, y, z, x2, y2, z2 ) < DistanciaDoChatLocal ) then
	local int = getElementInterior   ( source )
	local dim = getElementDimension  ( source )
	local int2 = getElementInterior  ( gracze )
	local dim2 = getElementDimension ( gracze )
	if ( int == int2 and dim == dim2 ) then

	conta = getAccountName ( getPlayerAccount ( source ) )

	if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then
	outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #106FE7*Staff #ffffff"..getPlayerName(source).. "[ID:"..getPlayerID(source).."]:  #ffffff"..tresc, gracze, 255, 255, 255, true)

	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Administrador" ) ) then
	outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #106FE7*Staff #FFFFFF"..getPlayerName(source).."[ID:"..getPlayerID(source).."]:  #ffffff"..tresc, gracze, 255, 255, 255, true)

	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Super Moderador" ) ) then
	outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #106FE7*Staff #FFFFFF"..getPlayerName(source).."[ID:"..getPlayerID(source).."]:  #ffffff"..tresc, gracze, 255, 255, 255, true)

	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador2" ) ) then
	outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #106FE7*Staff #FFFFFF"..getPlayerName(source).."[ID:"..getPlayerID(source).."]:  #ffffff"..tresc, gracze, 255, 255, 255, true)
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador" ) ) then
	outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #106FE7*Staff #FFFFFF"..getPlayerName(source).."[ID:"..getPlayerID(source).."]:  #ffffff"..tresc, gracze, 255, 255, 255, true)
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip" ) ) then
	outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #40E0D0*Vip Simples #FFFFFF"..getPlayerName(source).."[ID:"..getPlayerID(source).."]:  #ffffff"..tresc, gracze, 255, 255, 255, true)
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip2" ) ) then
	outputChatBox("#ffffff[#FFFFFFLocal#ffffff] #00FFFF*Vip Avançado #FFFFFF"..getPlayerName(source).."[ID:"..getPlayerID(source).."]:  #ffffff"..tresc, gracze, 255, 255, 255, true)
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then
	outputChatBox("#ffffff[#FFFFFFLocal#ffffff] "..getPlayerName(source).. "[ID:"..getPlayerID(source).."]:  #ffffff"..tresc, gracze, 255, 255, 255, true)

	end
	end
	end
	end
	end
    setElementData (source, "ChatLocal:Delay",true)
	setTimer (setElementData, 100, 1, source, "ChatLocal:Delay", false)
end)

--------------------------------------------------------------------------------------------

-- Config do Chat Global

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

	if ( isPlayerMuted(thePlayer) ) then
	outputChatBox ( MensagemVoceEstaMutadoGlobal, thePlayer, 255, 255, 255, true ) return end

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

	local money = getPlayerMoney(thePlayer)
	if (money < ValorDoChatGlobal ) then
	outputChatBox ( MensagemDinheiroInsuficienteGlobal, thePlayer, 255, 255, 255, true ) return end

	conta = getAccountName(getPlayerAccount(thePlayer))					

	if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then
	outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).. "[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)

	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Administrador" ) ) then
	outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Super Moderador" ) ) then
	outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador2" ) ) then
	outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)	
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador" ) ) then
	outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)	
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip" ) ) then
	outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #40E0D0*Vip Simples #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)	
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip2" ) ) then
	outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] #00FFFF*Vip Avançado #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)	
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then
	outputChatBox("#ffffff[#FFFFFFFora Do RP#ffffff] "..getPlayerName(thePlayer).. "[ID:"..getPlayerID(thePlayer).."]:  #ffffff#ffffff"..message, player, 255, 255, 255, true)

	end
    end
    end
    end
	setElementData ( thePlayer, "ChatGlobal:Delay1",true )
    setTimer ( setElementData, 100, 1, thePlayer, "ChatGlobal:Delay1", false )
end
addCommandHandler ( ComandoDoChatGlobal, adminchat )

--------------------------------------------------------------------------------------------

-- Chat Twitter

function adminchat2 ( 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("#14B4E7[#14B4E7Twitter#14B4E7] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).. "[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)

	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Admin" ) ) then
	outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Super Moderador" ) ) then
	outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador2" ) ) then
	outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)	
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador" ) ) then
	outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)	
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip" ) ) then
	outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #40E0D0*Vip Simples #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)	
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip2" ) ) then
	outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #00FFFF*Vip Avançado #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)	
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then
	outputChatBox("#14B4E7[#14B4E7Twitter#14B4E7] #ffffff"..getPlayerName(thePlayer).. "[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..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 ( ComandoDoChatGlobal2, adminchat2 )

-----------------------------------------------------------

-- Chat olx

function adminchat3 ( 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("#FF00EA[#FF00EAOLX#FF00EA] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).. "[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)

	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Admin" ) ) then
	outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Super Moderador" ) ) then
	outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador2" ) ) then
	outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)	
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderador" ) ) then
	outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)	

	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip" ) ) then
	outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #40E0D0*Vip Simples #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)	

	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Vip2" ) ) then
	outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #00FFFF*Vip Avançado #ffffff"..getPlayerName(thePlayer).."[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..message, player, 255, 255, 255, true)	

	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then
	outputChatBox("#FF00EA[#FF00EAOLX#FF00EA] #106FE7*Staff #ffffff"..getPlayerName(thePlayer).. "[ID:"..getPlayerID(thePlayer).."]:  #ffffff"..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 ( ComandoDoChatGlobal3, adminchat3 )

--------------------------------------------------------------

-- Chat anonimo

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("#838b83@Anónimo:  #ffffff"..message, player, 255, 255, 255, true)

	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Admin" ) ) then
	outputChatBox("#838b83@Anónimo:  #ffffff:  "..message, player, 255, 255, 255, true)
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "SuperModerator" ) ) then
	outputChatBox("#838b83@Anónimo:  #ffffff"..message, player, 255, 255, 255, true)
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderator" ) ) then
	outputChatBox("#838b83@Anónimo:  #ffffff"..message, player, 255, 255, 255, true)	
	
	elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then
	outputChatBox("#838b83@Anónimo:  #ffffff"..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 )

---------------------------------------------------------------------

function isPlayerOnGroup ( thePlayer )
    local account = getPlayerAccount ( thePlayer )
    local inGroup = false
    for _, group in ipairs ( { "Everyone" } ) do  
    if isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( group ) )   then
    inGroup = true
    break
    end
    end
    return inGroup
end

--------------------------------------------------------------------------------------------

 

Share this post


Link to post
Posted (edited)

Na linha 31 você está usando a variável MensagemFalandoRapidoDemaisLocal que não foi declarada em lugar nenhum.

Mesma coisa nos outros chats.

Edited by Lord Henry

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.