Jokeℝ1472771893 Posted May 16, 2012 Author 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
Guest Guest4401 Posted May 16, 2012 Posted May 16, 2012 No its wrong. Press page 1 of this topic, you will get the answer.
Jokeℝ1472771893 Posted May 16, 2012 Author 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?
Jokeℝ1472771893 Posted May 16, 2012 Author Posted May 16, 2012 if getTeamName(getPlayerTeam(player)) == "Armed Force" then where i need to add this line?
Castillo Posted May 17, 2012 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 )
Jokeℝ1472771893 Posted May 17, 2012 Author 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?
Jokeℝ1472771893 Posted May 17, 2012 Author Posted May 17, 2012 Yes, only "Armed Force" team can use that command. thnx
Hussain Posted May 17, 2012 Posted May 17, 2012 Yes, only "Armed Force" team can use that command. thnx It's worked ?
Jokeℝ1472771893 Posted May 18, 2012 Author Posted May 18, 2012 Yes, only "Armed Force" team can use that command. thnx It's worked ? Yes it's work
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