Jump to content

Como por pra só pegar quem estiver na acl?


Recommended Posts

Estou tentando por esse script por acl mas nn consigo!

Alguém pra me ajdar?
 

procurei em diversos foruns

pegar = createMarker(2747.1008300781, -1461.0627441406, 1.96875, "cylinder", 1.5,255,255,255,50)

function pegarFarda(player)
	if isElementWithinMarker(player, pegar) then
		if (getPlayerSkin(player) == 14) then
			outputChatBox("#0077FF[TDJ] #ffffffVocê ja está com a farda.", player, 255,255,255, true)
		else
			setPlayerSkin(player,14)
			outputChatBox("#0077FF[TDJ] #ffffffVocê vestiu a roupa!!.", player, 255,255,255, true)
		end
	end
end
addCommandHandler("skin", pegarFarda)

function tirarFarda(player)
	if isElementWithinMarker(player, pegar) then
		setPlayerSkin(player,0)
		outputChatBox("#0077FF[TDJ] #ffffffVocê tirou sua Farda.", player, 255,255,255, true)
	end
end
addCommandHandler("tskin", tirarFarda)

function pegarArmas(player)
	if isElementWithinMarker(player, pegar) then
		giveWeapon ( player, 24, 5000, true ) --Pistola
		giveWeapon ( player, 30, 5000, true ) --M4
		giveWeapon ( player, 25, 5000, true ) --Shotgun
		giveWeapon ( player, 28, 5000, true ) --MP5
		giveWeapon ( player, 1, 5000, true ) --Cacetete
		outputChatBox("#0077FF[TDJ] #ffffffVocê se equipou com as armas.", player, 255,255,255, true)
	end
end
addCommandHandler("armas", pegarArmas)

addEventHandler("onMarkerHit", pegar,
function(player)
	if getElementType(player) == "player" then
		outputChatBox("#0077FF=========================================================", player, 255,255,255, true)
		outputChatBox("#0077FF[TDJ] #ffffffOlá, seja bem vindo a TDJ, pegue aqui suas armas e roupas.", player, 255,255,255, true)
		outputChatBox("#0077FF[TDJ] #ffffffFarda: #727272/skin", player, 255,255,255, true)
		outputChatBox("#0077FF[TDJ] #ffffffTirar roupa: #727272/tskin", player, 255,255,255, true)
		outputChatBox("#0077FF[TDJ] #ffffffArmas: #727272/armas", player, 255,255,255, true)
		outputChatBox("#0077FF=========================================================", player, 255,255,255, true) 
	end
end)
Edited by Lord Henry
Código convertido de HTML para Lua. Indentação corrigida.
Link to comment

Da uma olhada nesse tópico aqui

Basicamente ele pega a informação pelo lado do server e envia para o client, assim você vai conseguir fazer o que está tentando.

 

No server você aciona um evento para checar se o player tem autorização para acessar o marker.

addEvent("onPlayerReady", true);
addEventHandler("onPlayerReady", resourceRoot,
  function()
    local has_policia = isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(client)), aclGetGroup ("Policia"));
    
    triggerClientEvent(client, "onClientReceivePermissions", resourceRoot, has_policia);
  end, false
);

 

 

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