Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local objGateg = createObject(17951,1287.9000000,-1006.1000000,31.1000000,0.0000000,0.0000000,90.0000000)
- local objGateg2 = createObject(17951,1287.9000000,-966.4000200,34.8000000,0.0000000,0.0000000,90.0000000)
- local open = false
- local open2 = false
- -- Kapu
- function useGate(thePlayer)
- local x, y, z = getElementPosition(thePlayer)
- local distance = getDistanceBetweenPoints3D(1289.009765625, -1005.787109375, 30.876438140869, x, y, z) -- Pozíciót írd át
- local distance2 = getDistanceBetweenPoints3D(1287.6708984375, -967.275390625, 34.430938720703, x, y, z) -- Pozíciót írd át
- local factionid = getElementData(thePlayer, "faction")
- if (factionid==123) then
- if (distance<=10) and (open==false) then
- open = true
- outputChatBox("Garázs ajtó nyitva!", thePlayer, 0, 255, 0)
- moveObject(objGateg, 1000, 1287.9000000,-1006.1000000,28.0000000, 0, 0, 0) -- Pozíciót írd át
- setTimer(close, 5000, 1, thePlayer)
- elseif (distance2<=10) and (open2==false) then
- open2 = true
- outputChatBox("Garázs ajtó nyitva!", thePlayer, 0, 255, 0)
- moveObject(objGateg2, 1000, 1287.9000000,-966.4000200,31.7000000, 0, 0, 0) -- Pozíciót írd át
- setTimer(close2, 5000, 1, thePlayer)
- end
- end
- end
- addCommandHandler("gate", useGate) -- Parancs amivel nyitod
- function close(thePlayer)
- setTimer(resetState, 1000, 1) -- Vissza csukási időzitő
- moveObject(objGateg, 1000, 1287.9000000,-1006.1000000,31.1000000, 0, 0, 0) -- Pozíciót írd át
- end
- function close2(thePlayer)
- setTimer(resetState2, 1000, 1) -- Vissza csukási időzitő
- moveObject(objGateg2, 1000, 1287.9000000,-966.4000200,34.8000000, 0, 0, 0) -- Pozíciót írd át
- end
- function resetState()
- open = true -- Vissza csukódjon
- end
- function resetState2()
- open2 = true -- Vissza csukódjon
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement