Mr.Placek Posted September 16, 2011 Posted September 16, 2011 Hi, firstly sorry for my english because im from poland and im polish so i can make some mistakes if you dont know what im writing about please say and i try to describe it more . My problem is in this script. policjabrama2 = createObject ( 980, 1545.7504882813, -1628.373046875, 15.156204223633 , 0, 0, 85 ) function policjaO2 () moveObject ( policjabrama2, 3200, 1546.0052490234, -1618.1116943359, 15.327953338623) end addCommandHandler("open7", policjaO2 ) function policjaC2 () moveObject ( policjabrama2, 3200, 1545.7504882813, -1628.373046875, 15.156204223633 ) end addCommandHandler("close7", policjaC2 ) Thats how the scripts looks. Meta.xml is ok. Firstly this script is to open gate by command open7 and close7, it works. But mine problem is that everyone can open it and i just want that the police team can open it, or if other player try to open and is not in acl police or not in team police on his chat box shows something like " you are not a policeman ". The team and acl is called "Policja" ( it is in polish ). In acl i have the acl "Policja" and line something like command.open7 access = true. ( you know what i mean ) And other acl like "Cywile" ( civils ) have line like that command.open7 access - false. But even by that they can open it i dont know what to do or how to edit the script. If some one know how to fix it please say it. or copy the script and just edit and paste it. I will be very thankfull.
Jaysds1 Posted September 16, 2011 Posted September 16, 2011 try this: policjabrama2 = createObject ( 980, 1545.7504882813, -1628.373046875, 15.156204223633 , 0, 0, 85 ) function policjaO2 () if (getPlayerTeam(source) == "Police") then moveObject ( policjabrama2, 3200, 1546.0052490234, -1618.1116943359, 15.327953338623) end end addCommandHandler("open7", policjaO2 ) function policjaC2 () if (getPlayerTeam(source) == "Police") then moveObject ( policjabrama2, 3200, 1545.7504882813, -1628.373046875, 15.156204223633 ) end end addCommandHandler("close7", policjaC2 )
Mr.Placek Posted September 16, 2011 Author Posted September 16, 2011 Sorry , dont works. Im in team police write /open7 dont works. Tried to get other team dont works either. But the script is running , and the gate is there but the command seem to not work Any other ideas?
Mr.Placek Posted September 16, 2011 Author Posted September 16, 2011 sorry for double post but in my script at the end of it is only 1 end but in yours are 2 end will it make any difference? may be try that ifObjectInAcl or something like that? if yes can someone edit it because i dont know where to write it
SpUnKyMe Posted September 17, 2011 Posted September 17, 2011 (edited) policjabrama2 = createObject ( 980, 1545.7504882813, -1628.373046875, 15.156204223633 , 0, 0, 85 ) function policjaO2(thePlayer) if getPlayerTeam(thePlayer) == getTeamFromName("Policja") then moveObject ( policjabrama2, 3200, 1546.0052490234, -1618.1116943359, 15.327953338623) end end addCommandHandler("open7", policjaO2 ) function policjaC2(thePlayer) if getPlayerTeam(thePlayer) == getTeamFromName("Policja") then moveObject ( policjabrama2, 3200, 1545.7504882813, -1628.373046875, 15.156204223633 ) end end addCommandHandler("close7", policjaC2 ) Edited September 17, 2011 by Guest
NotAvailable Posted September 17, 2011 Posted September 17, 2011 Get the 'Policja' team by using: policja = getTeamFromName("Policja") If it is still not working try defining 'thePlayer'.
Mr.Placek Posted September 17, 2011 Author Posted September 17, 2011 Jesseunit what you mean? can you edit mine script? because i dont quite get it what you wrote. spunkyme i try that in a sec and tell you
Castillo Posted September 17, 2011 Posted September 17, 2011 You have created the team already, right? if so, why don't you just check for the team name? policjabrama2 = createObject ( 980, 1545.7504882813, -1628.373046875, 15.156204223633 , 0, 0, 85 ) function policjaO2(thePlayer) local pTeam = getPlayerTeam(thePlayer) if not pTeam then return end if (getTeamName(pTeam) == "Policja") then moveObject ( policjabrama2, 3200, 1546.0052490234, -1618.1116943359, 15.327953338623) end end addCommandHandler("open7", policjaO2 ) function policjaC2(thePlayer) local pTeam = getPlayerTeam(thePlayer) if not pTeam then return end if (getTeamName(pTeam) == "Policja") then moveObject ( policjabrama2, 3200, 1545.7504882813, -1628.373046875, 15.156204223633 ) end end addCommandHandler("close7", policjaC2 ) Try that.
Mr.Placek Posted September 17, 2011 Author Posted September 17, 2011 SpunkyMe fucking love ya ;D Is here anything about something like " help " ? you know like a button and it adds to stats ?
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