Jump to content

moving gates when admin comes near them


Xeno

Recommended Posts

how would i create a gate that opens only for admins? i have tryed but i have only got a commands... please help me :D

function createGate ()

gatePolice = createObject ( 987, -2494.3918457031, 1199.9107666016, 36.207420349121, 0, 0, 41.605255126953 )

end

addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate )

function openGate(playerSource, commandName)

moveObject ( gatePolice, 3000, -2494.3918457031, 1199.9107666016, 43.207420349121)

end

addCommandHandler("open", openGate)

Link to comment

how would i create a gate that opens only for admins? i have tryed but i have only got a commands... please help me :D

function createGate ()

gatePolice = createObject ( 987, -2494.3918457031, 1199.9107666016, 36.207420349121, 0, 0, 41.605255126953 )

end

addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate )

function openGate(playerSource, commandName)

moveObject ( gatePolice, 3000, -2494.3918457031, 1199.9107666016, 43.207420349121)

end

addCommandHandler("open", openGate)

Link to comment

This should works, it's from Wiki:

function createGate()
 
   gatePolice = createObject ( 987, -2494.3918457031, 1199.9107666016, 36.207420349121, 0, 0, 41.605255126953 )
 
end
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate )
 
function openGate( playerSource, commandName )
 
-- FROM WIKI (not mine, so it might be right)
-- Open Gate if he has access
local playerName = getPlayerName ( playerSource)
-- Does he have access to Admin functions?
if isObjectInACLGroup( "user." .. playerName, aclGetGroup ( "Admin" ) ) then
-- He's an admin. Open the Gate.
moveObject( gatePolice, 3000, -2494.3918457031, 1199.9107666016, 43.207420349121 )
end
 
end
addCommandHandler( "open", openGate )

Link to comment

This should works, it's from Wiki:

function createGate()
 
   gatePolice = createObject ( 987, -2494.3918457031, 1199.9107666016, 36.207420349121, 0, 0, 41.605255126953 )
 
end
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate )
 
function openGate( playerSource, commandName )
 
-- FROM WIKI (not mine, so it might be right)
-- Open Gate if he has access
local playerName = getPlayerName ( playerSource)
-- Does he have access to Admin functions?
if isObjectInACLGroup( "user." .. playerName, aclGetGroup ( "Admin" ) ) then
-- He's an admin. Open the Gate.
moveObject( gatePolice, 3000, -2494.3918457031, 1199.9107666016, 43.207420349121 )
end
 
end
addCommandHandler( "open", openGate )

Link to comment

nope.... the gate is there but it doesent move ....

function createGate()

gatePolice = createObject ( 987, -2494.3918457031, 1199.9107666016, 36.207420349121, 0, 0, 41.605255126953 )

end

addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate )

function openGate( playerSource, commandName )

local playerName = getPlayerName ( playerSource)

ObjectInACLGroup( "User." .. playerName, aclGetGroup ( "Admin." ) ) then

moveObject( gatePolice, 3000, -2494.3918457031, 1199.9107666016, 43.20742034912 )

end

end

addCommandHandler( "open", openGate )

is what i got so far.... any1?

Link to comment

nope.... the gate is there but it doesent move ....

function createGate()

gatePolice = createObject ( 987, -2494.3918457031, 1199.9107666016, 36.207420349121, 0, 0, 41.605255126953 )

end

addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate )

function openGate( playerSource, commandName )

local playerName = getPlayerName ( playerSource)

ObjectInACLGroup( "User." .. playerName, aclGetGroup ( "Admin." ) ) then

moveObject( gatePolice, 3000, -2494.3918457031, 1199.9107666016, 43.20742034912 )

end

end

addCommandHandler( "open", openGate )

is what i got so far.... any1?

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