Jokeℝ1472771893 Posted May 15, 2012 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
Jokeℝ1472771893 Posted May 15, 2012 Author Posted May 15, 2012 because you create the object clientsided what i need to change it?
Guest Guest4401 Posted May 15, 2012 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)
Jokeℝ1472771893 Posted May 15, 2012 Author Posted May 15, 2012 and how to make thet only FBI for example can do it?
TAPL Posted May 15, 2012 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 -_-"
Jokeℝ1472771893 Posted May 15, 2012 Author 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
Guest Guest4401 Posted May 15, 2012 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
Jokeℝ1472771893 Posted May 15, 2012 Author 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?
TAPL Posted May 15, 2012 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)
Jokeℝ1472771893 Posted May 15, 2012 Author 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
TAPL Posted May 15, 2012 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
Jokeℝ1472771893 Posted May 15, 2012 Author Posted May 15, 2012 how to make it only take 4 bariers after 5 / 1st barier destroy
Guest Guest4401 Posted May 16, 2012 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
Jokeℝ1472771893 Posted May 16, 2012 Author 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
Guest Guest4401 Posted May 16, 2012 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)
Guest Guest4401 Posted May 16, 2012 Posted May 16, 2012 what about Team? Yes, it's possible. Make it.
Jokeℝ1472771893 Posted May 16, 2012 Author Posted May 16, 2012 How to make for Armed Force group only ?
Guest Guest4401 Posted May 16, 2012 Posted May 16, 2012 if getTeamName(getPlayerTeam(player)) == "Armed Force" then
Jokeℝ1472771893 Posted May 16, 2012 Author Posted May 16, 2012 if getTeamName(getPlayerTeam(player)) == "Armed Force" then Nonononono not team but ACL group
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