Jump to content

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


Mr.Placek

Recommended Posts

Posted

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.

Posted

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 ) 

Posted

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?

Posted

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 :/

Posted (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 by Guest
Posted

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.

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