Guest User

Untitled

a guest
Jan 22nd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.67 KB | None | 0 0
  1. --//Objects
  2. frontGate = createObject (2990,-2469.8000488281,-618.09997558594,135.49999389648,0,0,88.25)
  3. -------------------- the gate we are going to be moving. (ID,x,y,z,rot x,rot y,rot z)
  4. parkinglotGate = createObject (2990,-2414.3999023438,-603.20001220703,135.39999389648,0,0,306)
  5. -------------------- another gate
  6. frontGateCol = createMarker (-2469.8000488281,-618.09997558594,132.60000610352,'cylinder',7,0,0,0,0)
  7. parkinglotGateCol = createMarker (-2415,-603.59997558594,132.60000610352,'cylinder',7,0,0,0,0)
  8. -------------------- collision area for the gate (,x,y,z,rot x,rot y,rot z)
  9. antiZombie1 = createMarker (-2514.5,-623.09997558594,132.60000610352,'cylinder',58,0,0,0,0)
  10. antiZombie2 = createMarker (-2394.6000976563,-591,132.60000610352,'cylinder',48,0,0,0,0)
  11. -------------------- markers for anti zombie zones
  12.  
  13. groupSkins = {181,122,33}
  14.  
  15. ----//SECTION 1
  16.  
  17. --//Front Gate Open and Defense
  18. function gateOpen (hitPlayer,matchingDimesion) -- the gate open function (theplayer,thedimension)
  19. local skin = getElementModel (hitPlayer) -- hittest for collision area of the gate
  20.     if skin == 181 then -- the skin(s) that can open this gate
  21.     moveObject (frontGate,500,-2469.8000488281,-618.09997558594,141.39999389648)
  22.     -- moves the gate (gatename,ID,x,y,z,rot x,rot y,rot z)
  23.     else
  24.     killPed (hitPlayer) -- kills you if you are not the right skin
  25.     end
  26. end
  27. addEventHandler ('onMarkerHit', frontGateCol, gateOpen) -- the gate hittest EventHandler
  28.  
  29.  
  30. --//Front Gate Close
  31. function gateClose (hitPlayer,matchingDimesion)
  32.     moveObject (frontGate,500,-2469.8000488281,-618.09997558594,135.49999389648)
  33. end
  34. addEventHandler ("onMarkerLeave",frontGateCol, gateClose) -- the gate close function
Add Comment
Please, Sign In to add comment