Jump to content

[HELP]Gates


JasperRieken

Recommended Posts

I made the script it works fine but i want to make it just opening for me this is the script

  
local gate4 = createObject(971,1539.0588378906,-1451.3624267578,15.952730178833,0,0,0) 
local gate5 = createObject(971,1530.3012695313,-1451.3624267578,15.952730178833,0,0,180) 
local marker4 = createMarker(1534.7189941406,-1451.9150390625,12.6328125,"cylinder",10,255,0,0,0) 
  
function openGate(hitPlayer) 
  moveObject (gate4,1000,1545.0588378906,-1451.3624267578,15.952730178833) 
  moveObject (gate5,1000,1523.3012695313,-1451.3624267578,15.952730178833) 
end 
addEventHandler("onClientMarkerHit",marker4,openGate) 
  
function closeGate(hitPlayer) 
  moveObject (gate4,1000,1539.0588378906,-1451.3624267578,15.952730178833) 
  moveObject (gate5,1000,1530.3012695313,-1451.3624267578,15.952730178833) 
end 
addEventHandler("onClientMarkerLeave",marker4,closeGate) 
  

If you can help me that would be nice

Edited by Guest
Link to comment
I made the script it works fine but i want to make it just opening for me this is the script
local gate4 = createObject(971,1539.0588378906,-1451.3624267578,15.952730178833,0,0,0) 
local gate5 = createObject(971,1530.3012695313,-1451.3624267578,15.952730178833,0,0,180) 
local marker4 = createMarker(1534.7189941406,-1451.9150390625,12.6328125,"cylinder",10,255,0,0,0) 
  
function openGate(hitPlayer) 
moveObject (gate4,1000,1545.0588378906,-1451.3624267578,15.952730178833) 
moveObject (gate5,1000,1523.3012695313,-1451.3624267578,15.952730178833) 
end 
addEventHandler("onClientMarkerHit",marker4,openGate) 
  
function closeGate(hitPlayer) 
moveObject (gate4,1000,1539.0588378906,-1451.3624267578,15.952730178833) 
moveObject (gate5,1000,1530.3012695313,-1451.3624267578,15.952730178833) 
end 
addEventHandler("onClientMarkerLeave",marker4,closeGate) 

If you can help me that would be nice

You want it so the gate only opens for you? Add a commandHandler, and don't tell anybody the command, simple. :D

Link to comment
  
local gate4 = createObject(971,1539.0588378906,-1451.3624267578,15.952730178833,0,0,0) 
local gate5 = createObject(971,1530.3012695313,-1451.3624267578,15.952730178833,0,0,180) 
local marker4 = createMarker(1534.7189941406,-1451.9150390625,12.6328125,"cylinder",10,255,0,0,0) 
  
function openGate(hitPlayer) 
  if getPlayerName(hitPlayer) ~= "JasperRieken" then return end 
  moveObject (gate4,1000,1545.0588378906,-1451.3624267578,15.952730178833) 
  moveObject (gate5,1000,1523.3012695313,-1451.3624267578,15.952730178833) 
end 
addEventHandler("onClientMarkerHit",marker4,openGate) 
  
function closeGate(hitPlayer) 
  if getPlayerName(hitPlayer) ~= "JasperRieken" then return end 
  moveObject (gate4,1000,1539.0588378906,-1451.3624267578,15.952730178833) 
  moveObject (gate5,1000,1530.3012695313,-1451.3624267578,15.952730178833) 
end 
addEventHandler("onClientMarkerLeave",marker4,closeGate) 
  

you can change the name.

or change it to check ACL group, team, serial, some custom player property, whatever.

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