Jokeℝ1472771893 Posted May 16, 2012 Author Share Posted May 16, 2012 (edited) local maxBarriers = 4 local barriers = {} function createBarrier(player) if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Armed Force")) then if not barriers[player] then barriers[player] = {} end if #barriers[player] >= maxBarriers then destroyElement(barriers[player][1]) table.remove(barriers[player],1) end local x,y,z = getElementPosition(player) local xR,yR,zR = getElementRotation(player) local obj = createObject(3091,x,y,z,xR,yR,zR) table.insert(barriers[player], obj) end addCommandHandler("ab",createBarrier) Like this? Edited May 16, 2012 by Guest Link to comment
Guest Guest4401 Posted May 16, 2012 Share Posted May 16, 2012 No its wrong. Press page 1 of this topic, you will get the answer. Link to comment
Jokeℝ1472771893 Posted May 16, 2012 Author Share Posted May 16, 2012 local maxBarriers = 4 local barriers = {} function createBarrier(player) if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Armed Force")) then if not barriers[player] then barriers[player] = {} end if #barriers[player] >= maxBarriers then destroyElement(barriers[player][1]) table.remove(barriers[player],1) end local x,y,z = getElementPosition(player) local xR,yR,zR = getElementRotation(player) local obj = createObject(3091,x,y,z,xR,yR,zR) table.insert(barriers[player], obj) end addCommandHandler("ab",createBarrier) this? Link to comment
Jokeℝ1472771893 Posted May 16, 2012 Author Share Posted May 16, 2012 if getTeamName(getPlayerTeam(player)) == "Armed Force" then where i need to add this line? Link to comment
Castillo Posted May 17, 2012 Share Posted May 17, 2012 You want to let him place barriers if he's on the "Armed Force" team? if so then use this: local maxBarriers = 4 local barriers = { } function createBarrier ( player ) if ( getPlayerTeam ( player ) and getTeamName ( getPlayerTeam ( player ) ) == "Armed Force" ) then if ( not barriers [ player ] ) then barriers [ player ] = { } end if ( #barriers [ player ] >= maxBarriers ) then destroyElement ( barriers [ player ] [ 1 ] ) table.remove ( barriers [ player ], 1 ) end local x, y, z = getElementPosition ( player ) local xR, yR, zR = getElementRotation ( player ) local obj = createObject ( 3091, x, y, z, xR, yR, zR ) table.insert ( barriers [ player ], obj ) end end addCommandHandler ( "ab", createBarrier ) Link to comment
Jokeℝ1472771893 Posted May 17, 2012 Author Share Posted May 17, 2012 You want to let him place barriers if he's on the "Armed Force" team? if so then use this: local maxBarriers = 4 local barriers = { } function createBarrier ( player ) if ( getPlayerTeam ( player ) and getTeamName ( getPlayerTeam ( player ) ) == "Armed Force" ) then if ( not barriers [ player ] ) then barriers [ player ] = { } end if ( #barriers [ player ] >= maxBarriers ) then destroyElement ( barriers [ player ] [ 1 ] ) table.remove ( barriers [ player ], 1 ) end local x, y, z = getElementPosition ( player ) local xR, yR, zR = getElementRotation ( player ) local obj = createObject ( 3091, x, y, z, xR, yR, zR ) table.insert ( barriers [ player ], obj ) end end addCommandHandler ( "ab", createBarrier ) This can use only Armed Force Team? Link to comment
Castillo Posted May 17, 2012 Share Posted May 17, 2012 Yes, only "Armed Force" team can use that command. Link to comment
Jokeℝ1472771893 Posted May 17, 2012 Author Share Posted May 17, 2012 Yes, only "Armed Force" team can use that command. thnx Link to comment
Hussain Posted May 17, 2012 Share Posted May 17, 2012 Yes, only "Armed Force" team can use that command. thnx It's worked ? Link to comment
Jokeℝ1472771893 Posted May 18, 2012 Author Share Posted May 18, 2012 Yes, only "Armed Force" team can use that command. thnx It's worked ? Yes it's work 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