Jump to content

Ajuda com Portão.


Recommended Posts

Boa Tarde, Achei um Script perdido na internte de portão automatico, porem eu queria colocar ele pra abrir somente para uma determinada ACL, não pra todo mundo.

==========================================================================================================================


 

objeto = createObject ( 980, 1497.4000244141, -698.5, 96.5, 0, 0, 0 )
x,y,z = getElementPosition (objeto)
Zona = createColCircle ( x,y, 6, 6 )
--portao aberto--
function Funcion ()
moveObject ( objeto, 500, 1497.4000244141, -698.5, 20.300000190735 )
end
addEventHandler ( "onColShapeHit", Zona, Funcion )
--portao fechado--
function Funcion2 ()
moveObject ( objeto, 500, 1497.4000244141,-698.5, 96.5 )
end
addEventHandler ( "onColShapeLeave", Zona, Funcion2 )

 

Link to comment

Tente assim, para isso você precisa de um IsObjectInACLGroup.
 

objeto = createObject ( 980, 1497.4000244141, -698.5, 96.5, 0, 0, 0 )
x,y,z = getElementPosition (objeto)
Zona = createColCircle ( x,y, 6, 6 )

--portao aberto--
function Funcion ()
  	for _, group in ipairs ({"Grupo que você deseja"}) do
		if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group )) then 
			moveObject ( objeto, 500, 1497.4000244141, -698.5, 20.300000190735 )
		end
    end
end
addEventHandler ( "onColShapeHit", Zona, Funcion )

--portao fechado--
function Funcion2 ()
	for _, group in ipairs ({"Grupo que você deseja"}) do
		if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group )) then 
  			moveObject ( objeto, 500, 1497.4000244141,-698.5, 96.5 )
		end
    end
end
addEventHandler ( "onColShapeLeave", Zona, Funcion2 )

Se te ajudei dá um Thanks! 

  • Thanks 1
Link to comment
local objeto = createObject (980, 1497.400, -698.5, 96.5, 0, 0, 0)
local x, y, z = getElementPosition (objeto)
local Zona = createColCircle (x, y, 6, 6)

function Function (thePlayer, matchingDimension)
	if getElementType (thePlayer) == "player" then -- Se o elemento que colidiu no col for um player, então:
		if (isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (thePlayer)), aclGetGroup("Admin"))) then -- Se o jogador estiver na acl "Admin" por exemplo, então:
			moveObject (objeto, 500, 1497.400, -698.5, 20.300)
			outputChatBox ("@Portão aberto!", thePlayer)
		end
	end
end	
addEventHandler ("onColShapeHit", Zona, Function)

function Function2 (thePlayer, matchingDimension)
	if getElementType (thePlayer) == "player" then -- Se o elemento que saiu do col for um player, então:
		if (isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (thePlayer)), aclGetGroup("Admin"))) then -- Se o jogador estiver na acl "Admin" por exemplo, então:
			moveObject (objeto, 500, 1497.400, -698.5, 96)
			outputChatBox ("@Portão fechado!", thePlayer)
		end
	end
end
addEventHandler ("onColShapeLeave", Zona, Function2)

@Niick

Edited by Jonas^
Correção!
  • Thanks 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...