Jokeℝ1472771893 Posted May 14, 2012 Share Posted May 14, 2012 local allowedGroups = { "FBI"=true } col1 = createColSphere ( 927.4365234375, -1022.5947265625, 35.913665771484, 27.5 ) gate1 = createObject (3113, 941.1669921875, -1012.3310546875, 32.369918823242, 0, 15, 272.5) function openGate1 ( player ) if ( allowedGroups getElementData ( player, "FBI" ) ) then moveObject (gate1, 941.1669921875, -1012.3310546875, 21.369918823242, 0, 15, 272.5 ) end end addEventHandler("onColShapeHit", col1, openGate1) function closeGate1() moveObject(gate1, 3037, 941.1669921875, -1012.3310546875, 32.369918823242, 0, 15, 272.5) end addEventHandler("onColShapeLeave", col1, closeGate1) what is wrong? Link to comment
Jaysds1 Posted May 14, 2012 Share Posted May 14, 2012 (edited) I could see you've been using the wiki, here:OnVehicleStartEnter try this: local allowedGroups = { ["FBI"]=true } col1 = createColSphere ( 927.4365234375, -1022.5947265625, 35.913665771484, 27.5 ) gate1 = createObject (3113, 941.1669921875, -1012.3310546875, 32.369918823242, 0, 15, 272.5) function openGate1 ( player ) if ( allowedGroups[getElementData ( player, "FBI" )] ) then moveObject (gate1, 941.1669921875, -1012.3310546875, 21.369918823242, 0, 15, 272.5 ) addEventHandler("onColShapeLeave", col1, closeGate1) -- add the event of leaving the colshape if it's an FBI end end addEventHandler("onColShapeHit", col1, openGate1) function closeGate1() moveObject(gate1, 3037, 941.1669921875, -1012.3310546875, 32.369918823242, 0, 15, 272.5) removeEventHandler("onColShapeLeave",col1,closeGate1) -- remove it after the gate is closed end Edited May 14, 2012 by Guest Link to comment
Kenix Posted May 14, 2012 Share Posted May 14, 2012 what is wrong? if ( allowedGroups getElementData ( player, "FBI" ) ) then and local allowedGroups = { "FBI"=true } Correct local aAllowedGroups = { [ 'FBI' ] = true; [ false ] = false; } local pCol = createColSphere ( 927.4365234375, -1022.5947265625, 35.913665771484, 27.5 ) local pGate = createObject ( 3113, 941.1669921875, -1012.3310546875, 32.369918823242, 0, 15, 272.5 ) function ColShapeManager( pElement ) if getElementType( pElement ) == 'player' and aAllowedGroups[ getElementData ( pElement, 'FBI' ) ] then if eventName == 'onColShapeHit' then moveObject ( pGate, 941.1669921875, -1012.3310546875, 21.369918823242, 0, 15, 272.5 ) else moveObject( pGate, 3037, 941.1669921875, -1012.3310546875, 32.369918823242, 0, 15, 272.5 ) end end end addEventHandler( 'onColShapeHit', pCol, ColShapeManager ) addEventHandler( 'onColShapeLeave', pCol, ColShapeManager ) What return data 'FBI' ? Link to comment
Jokeℝ1472771893 Posted May 14, 2012 Author Share Posted May 14, 2012 it is by ACL group or Team maded by Admin Panel Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now