Jokeℝ1472771893 Posted May 15, 2012 Share Posted May 15, 2012 function createBarrier() local x,y,z = getElementPosition(getLocalPlayer()) local xR,yR,zR = getElementRotation(getLocalPlayer()) createObject(3091,x,y,z,xR,yR,zR) end addCommandHandler("sperre",createBarrier) Its make Barrier but only me can see it other players can't see Link to comment
Guest Guest4401 Posted May 15, 2012 Share Posted May 15, 2012 because you create the object clientsided Link to comment
Jokeℝ1472771893 Posted May 15, 2012 Author Share Posted May 15, 2012 because you create the object clientsided what i need to change it? Link to comment
Guest Guest4401 Posted May 15, 2012 Share Posted May 15, 2012 because you create the object clientsided what i need to change it? server side: function createBarrier(player) local x,y,z = getElementPosition(player) local xR,yR,zR = getElementRotation(player) createObject(3091,x,y,z,xR,yR,zR) end addCommandHandler("sperre",createBarrier) Link to comment
Jokeℝ1472771893 Posted May 15, 2012 Author Share Posted May 15, 2012 and how to make thet only FBI for example can do it? Link to comment
TAPL Posted May 15, 2012 Share Posted May 15, 2012 and how to make thet only FBI for example can do it? the same thing here viewtopic.php?f=91&t=43342 -_-" Link to comment
Jokeℝ1472771893 Posted May 15, 2012 Author Share Posted May 15, 2012 and how to make thet only FBI for example can do it? the same thing here viewtopic.php?f=91&t=43342 -_-" its not same topic I ask how FBI can make Barriers Link to comment
Guest Guest4401 Posted May 15, 2012 Share Posted May 15, 2012 (edited) if isFBI(player) then isFBI function function isFBI ( thePlayer ) if ( not thePlayer ) then return false end local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) return isObjectInACLGroup ("user."..accName, aclGetGroup ( "FBI" ) ) end Edited May 15, 2012 by Guest4401 Link to comment
Jokeℝ1472771893 Posted May 15, 2012 Author Share Posted May 15, 2012 function createBarrier(player) if isFBI(player) then local x,y,z = getElementPosition(player) local xR,yR,zR = getElementRotation(player) createObject(3091,x,y,z,xR,yR,zR) end addCommandHandler("sperre",createBarrier) Like This? Link to comment
TAPL Posted May 15, 2012 Share Posted May 15, 2012 function createBarrier(player) if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("FBI")) then local x,y,z = getElementPosition(player) local xR,yR,zR = getElementRotation(player) createObject(3091,x,y,z,xR,yR,zR) end end addCommandHandler("sperre",createBarrier) Link to comment
Jokeℝ1472771893 Posted May 15, 2012 Author Share Posted May 15, 2012 function createBarrier(player) if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("FBI")) then local x,y,z = getElementPosition(player) local xR,yR,zR = getElementRotation(player) createObject(3091,x,y,z,xR,yR,zR) end end addCommandHandler("sperre",createBarrier) SORRY ITS WORK VERY NICE TY FOR HELP Link to comment
Jokeℝ1472771893 Posted May 15, 2012 Author Share Posted May 15, 2012 But how to make it Limeted? Link to comment
TAPL Posted May 15, 2012 Share Posted May 15, 2012 (edited) But how to make it Limeted? i didn't understand you, can you explain better? Edited May 15, 2012 by Guest Link to comment
Jokeℝ1472771893 Posted May 15, 2012 Author Share Posted May 15, 2012 how to make it only take 4 bariers after 5 / 1st barier destroy Link to comment
Guest Guest4401 Posted May 16, 2012 Share Posted May 16, 2012 how to make it only take 4 bariers after 5 / 1st barier destroy you can make a table, like -- to add barriers = {} barriers[player] = {} obj = createObject() table.insert(barriers[player],obj) -- to check number of objects a player created #barriers[player] -- to remove table.remove -- remove from table destroyElement -- destroy the object http://lua-users.org/wiki/TablesTutorial http://lua-users.org/wiki/TableLibraryTutorial Link to comment
Jokeℝ1472771893 Posted May 16, 2012 Author Share Posted May 16, 2012 how to make it only take 4 bariers after 5 / 1st barier destroy you can make a table, like -- to add barriers = {} barriers[player] = {} obj = createObject() table.insert(barriers[player],obj) -- to check number of objects a player created #barriers[player] -- to remove table.remove -- remove from table destroyElement -- destroy the object http://lua-users.org/wiki/TablesTutorial http://lua-users.org/wiki/TableLibraryTutorial but i can't do it its dont work anymore Link to comment
Guest Guest4401 Posted May 16, 2012 Share Posted May 16, 2012 local maxBarriers = 4 local barriers = {} function createBarrier(player) if not barriers[player] then -- if the player isn't in the barriers table barriers[player] = {} -- add him and make an empty table end if #barriers[player] >= maxBarriers then -- if he has more than 4 barriers destroyElement(barriers[player][1]) -- destroy the first one table.remove(barriers[player],1) -- remove from table end local x,y,z = getElementPosition(player) -- get player's position local xR,yR,zR = getElementRotation(player) -- get player's rotation local obj = createObject(3091,x,y,z,xR,yR,zR) -- create object table.insert(barriers[player], obj) -- insert object into table end addCommandHandler("sperre",createBarrier) Link to comment
Jokeℝ1472771893 Posted May 16, 2012 Author Share Posted May 16, 2012 what about Team? Link to comment
Guest Guest4401 Posted May 16, 2012 Share Posted May 16, 2012 what about Team? Yes, it's possible. Make it. Link to comment
Jokeℝ1472771893 Posted May 16, 2012 Author Share Posted May 16, 2012 How to make for Armed Force group only ? Link to comment
Guest Guest4401 Posted May 16, 2012 Share Posted May 16, 2012 if getTeamName(getPlayerTeam(player)) == "Armed Force" then Link to comment
Jokeℝ1472771893 Posted May 16, 2012 Author Share Posted May 16, 2012 if getTeamName(getPlayerTeam(player)) == "Armed Force" then Nonononono not team but ACL group 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