Jump to content

Preciso de ajuda neste script (sou novato)


Recommended Posts

Objetivo:   Só os jogadores q podem acessar o "Policia" podem ver e mandar mensagens no COPOM. Quem pode me ajudar , sou novato em desenvolver scripts mas já tenho uma noção, pois, eu editei bastante scripts por ai

função adminchat_policia (thePlayer, MessagemANS)
    local acc = getAccountName (getPlayerAccount (thePlayer)) 
    se isObjectInACLGroup ("user." .. acc, aclGetGroup (Grupo)) e
    Jogador = string.gsub (getPlayerName (thePlayer), "#% x% x% x% x% x% x "," ")
    ID local = getElementData (thePlayer," ID ") ou" N / C "
    outputChatBox (" # FFBF00 • Corporação - #ffffff [".. ID .."] - ".. Jogador .." # A4A4A4- # FFBF00 ".. MessagemANS, jogador, 255, 255, 255, verdadeiro)
    end
end

Edited by danielpaulino
Link to comment

assim?

função adminchat_policia (thePlayer, MessagemANS)
    local acc = getAccountName (getPlayerAccount (thePlayer)) 
    se isObjectInACLGroup ("user." .. acc, aclGetGroup (Grupo)) e
    Jogador = string.gsub (getPlayersInACLGroup (thePlayer), "#% x% x% x% x% x% x "," ")
    ID local = getElementData (thePlayer," ID ") ou" N / C "
    outputChatBox (" # FFBF00 • Corporação - #ffffff [".. ID .."] - ".. Jogador .." # A4A4A4- # FFBF00 ".. MessagemANS, jogador, 255, 255, 255, isPlayerInACL)
    Loop
    end
end

 

Link to comment
  • Moderators

Não, Lua não tem o poder de detectar a linguagem humana e adivinhar as coisas.

Fiz um código que explica os passos e deixei comentado


-- especificar 'thePlayer'
if isPlayerInACL( thePlayer, "Admin" ) then
	-- o jogador está no grupo
	outputChatBox( "Bem-vindo admin "..getPlayerName(thePlayer).."!", thePlayer )
else
	-- o jogador não está no grupo
	outputChatBox( "Você não é admin!", thePlayer )
end

-- função que envia mensagem para os membros de um grupo
function sendMessageForGroup( msg, playerWhoSend )
	for _, player in ipairs(getPlayersInACLGroup("Admin")) do -- loop nos jogadores do grupo
		if player ~= playerWhoSend then -- verificar se o jogador é diferente do que enviou a msg
			outputChatBox( msg, player ) -- mostrar a mensagem ao jogador do grupo
		end
	end
end

-- exemplo: 
sendMessageForGroup( "Olá", getPlayerFromName("nome_do_player_que_enviou") )

 

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