Jump to content

I got a big problem and i need to fix it.


Mr.Placek

Recommended Posts

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 :redhotevil: 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.

Link to comment

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 ) 

Link to comment
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 by Guest
Link to comment

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.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...