Jump to content

Portão Ajuda


Recommended Posts

Opa Boa Noite, achei esse portão automatico na web, porem eu queria colocar ele para abrir apenas para ACL 

Portao = createMarker ( 2185.667, -1766.193, 13.375, "cylinder", 7.0, 0, 0, 255, 0 )

function createGate ()
	Gate = createObject ( 980,  2185.8000488281, -1767.1999511719, 15.10000038147, 0, 0, 0)
	
end
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate )


function gateCheckingTeam ( thePlayer )
	moveObject ( Gate, 2000, 2185.8000488281, -1767.1999511719, 21 )
	
end
addEventHandler ( "onMarkerHit", Portao, gateCheckingTeam )


function movingBackPolice ( thePlayer )
	moveObject ( Gate, 2000, 2185.8000488281, -1767.1999511719, 15.10000038147 )
	
end
addEventHandler ( "onMarkerLeave", Portao, movingBackPolice )

 

Link to comment

tente:

Portao = createMarker ( 2185.667, -1766.193, 13.375, "cylinder", 7.0, 0, 0, 255, 0 )

function createGate ()
	Gate = createObject ( 980,  2185.8000488281, -1767.1999511719, 15.10000038147, 0, 0, 0)
	
end
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate )


function gateCheckingTeam ( thePlayer )
  	accountname = getAccountName(getPlayerAccount(thePlayer))
	if isObjectInACLGroup("user." .. accountname, aclGetGroup("ACL")) then 
		moveObject ( Gate, 2000, 2185.8000488281, -1767.1999511719, 21 )
	
end
addEventHandler ( "onMarkerHit", Portao, gateCheckingTeam )


function movingBackPolice ( thePlayer )
    accountname = getAccountName(getPlayerAccount(thePlayer))
	if isObjectInACLGroup("user." .. accountname, aclGetGroup("ACL")) then 
		moveObject ( Gate, 2000, 2185.8000488281, -1767.1999511719, 15.10000038147 )
	
end
addEventHandler ( "onMarkerLeave", Portao, movingBackPolice )

Apenas troque ACL pelo nome da acl que vc qr que tenha a permissão para abrir

Link to comment

Opa, mandei o script errado, era esse aki 


objeto = createObject ( IdObjeto, PosX, PosY, PosZ, RotX, RotY, RotZ )
x,y,z = getElementPosition (objeto)
Zona = createColCircle ( x,y, 7, 7 )

function Funcion (source)
    playerTeam = getPlayerTeam ( source )
	Clann = getTeamFromName ( "BOPE" )
	if ( playerTeam ) == Clann then
        moveObject ( objeto, 3000, PosX, PosY, PosZ, RotX, RotY, RotZ )
	outputChatBox ( "Bem vindo", source, 0, 255, 0, true )
	else
	outputChatBox ( "Você não é do Bope", source, 255, 0, 0, true )
end
end
addEventHandler ( "onColShapeHit", Zona, Funcion )

function Funcion2 ()
        moveObject ( objeto, 3000, PosX, PosY, PosZ, RotX, RotY, RotZ )
		outputChatBox ( "Youtube: GamerMagnataHD", source, 0, 255, 0, true )
end
addEventHandler ( "onColShapeLeave", Zona, Funcion2 )

 

Link to comment
objeto = createObject ( IdObjeto, PosX, PosY, PosZ, RotX, RotY, RotZ )
x,y,z = getElementPosition (objeto)
Zona = createColCircle ( x,y, 7, 7 )

function Funcion (source)
	accountname = getAccountName(getPlayerAccount(thePlayer))
	if isObjectInACLGroup("user." .. accountname, aclGetGroup("BOPE")) then 
    	playerTeam = getPlayerTeam ( source )
		Clann = getTeamFromName ( "BOPE" )
		if ( playerTeam ) == Clann then
        	moveObject ( objeto, 3000, PosX, PosY, PosZ, RotX, RotY, RotZ )
		outputChatBox ( "Bem vindo", source, 0, 255, 0, true )
		else
		outputChatBox ( "Você não é do Bope", source, 255, 0, 0, true )
		end
    end
end
addEventHandler ( "onColShapeHit", Zona, Funcion )

function Funcion2 ()
	accountname = getAccountName(getPlayerAccount(thePlayer))
	if isObjectInACLGroup("user." .. accountname, aclGetGroup("BOPE")) then 
		moveObject ( objeto, 3000, PosX, PosY, PosZ, RotX, RotY, RotZ )
		outputChatBox ( "Youtube: GamerMagnataHD", source, 0, 255, 0, true )
end
addEventHandler ( "onColShapeLeave", Zona, Funcion2 )

deixei a acl como BOPE, caso n for esta apenas troque o bope pela acl certa

OBS: Não testei!

Edited by EW1611
Link to comment

Vai dar erro @EW1611, thePlayer não foi declarado em lugar nenhum.

local objeto = createObject (IdObjeto, PosX, PosY, PosZ, RotX, RotY, RotZ)
local x, y, z = getElementPosition (objeto)
local Zona = createColCircle (x, y, 7, 7)

addEventHandler ("onColShapeHit", Zona, function (thePlayer, matchingDimension)
	if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount(thePlayer)), aclGetGroup("Bope")) then -- Se o jogador estiver na acl "Bope", então:
		moveObject (objeto, 3000, PosX, PosY, PosZ, RotX, RotY, RotZ)
		outputChatBox ("Bem vindo", thePlayer, 0, 255, 0)
	else
		outputChatBox ("Você não é do Bope", thePlayer, 255, 0, 0)
	end
end)

addEventHandler ("onColShapeLeave", Zona, function (thePlayer, matchingDimension)
	if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount(thePlayer)), aclGetGroup("Bope")) then  -- Se o jogador estiver na acl "Bope", então:
		moveObject (objeto, 3000, PosX, PosY, PosZ, RotX, RotY, RotZ)
		outputChatBox ("Youtube: GamerMagnataHD", thePlayer, 0, 255, 0)
	end	
end)

 

Edited by Jonas^
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...