Advertisement
Guest User

pcosp_c.lua

a guest
Aug 28th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.25 KB | None | 0 0
  1. marker = createMarker (-25.58969, 1534.21106, 18.64447, "cylinder", 1, 0, 0, 255)
  2.  
  3. mojeW,mojeH = 640, 480
  4. sW,sH = guiGetScreenSize()
  5. width, height = (sW/mojeW), (sH/mojeH)
  6.  
  7. GUIEditor = {
  8. button = {}
  9. }
  10. addEventHandler("onClientResourceStart", resourceRoot,
  11. function()
  12. monitor = guiCreateStaticImage(112*width, 68*height, 426*width, 339*height, "images/monitor.png", false)
  13. guiSetVisible(monitor, false)
  14. zamknij = guiCreateButton(283*width, 278*height, 119*width, 29*height, "Zamknij system", false, monitor)
  15. kamera1 = guiCreateButton(24*width, 63*height, 119*width, 29*height, "Garaż 1", false, monitor)
  16. monitoring = guiCreateLabel(21*width, 25*height, 203*width, 33*height, "Monitoring:", false, monitor)
  17. guiSetFont(monitoring, "sa-header")
  18. guiLabelSetColor(monitoring, 0, 0, 0)
  19. guiLabelSetHorizontalAlign(monitoring, "left", true)
  20. kamera2 = guiCreateButton(24*width, 102*height, 119*width, 29*height, "Garaż 2", false, monitor)
  21. kamera3 = guiCreateButton(24*width, 141*height, 119*width, 29*height, "Garaż 3", false, monitor)
  22. kamera4 = guiCreateButton(24*width, 180*height, 119*width, 29*height, "Garaż 4", false, monitor)
  23. kamera5 = guiCreateButton(24*width, 219*height, 119*width, 29*height, "Przed budynkiem", false, monitor)
  24. kamera6 = guiCreateButton(24*width, 258*height, 119*width, 29*height, "W środku jednostki", false, monitor)
  25. alarm = guiCreateButton(254*width, 102*height, 119*width, 29*height, "Syrena OSP", false, monitor)
  26. wezwanie = guiCreateButton(254*width, 141*height, 119*width, 29*height, "Wezwij druhów", false, monitor)
  27. napisAlarm = guiCreateLabel(231*width, 26*height, 166*width, 32*height, "Alarm:", false, monitor)
  28. guiSetFont(napisAlarm, "sa-header")
  29. guiLabelSetColor(napisAlarm, 0, 0, 0)
  30. guiLabelSetHorizontalAlign(napisAlarm, "left", true)
  31. wylacz = guiCreateButton(418*width, 403*height, 212*width, 44*height, "Wyłącz podgląd z kamery", false)
  32. guiSetVisible(wylacz, false)
  33. wezwij = guiCreateWindow(92*width, 163*height, 470*width, 155*height, "Panel alarmowy Ochotniczej Straży Pożarnej", false)
  34. guiWindowSetSizable(wezwij, false)
  35. guiSetAlpha(wezwij, 1.00)
  36. guiSetVisible(wezwij, false)
  37. wyslij = guiCreateButton(10*width, 98*height, 185*width, 47*height, "Wyślij", false, wezwij)
  38. anuluj = guiCreateButton(275*width, 98*height, 185*width, 47*height, "Anuluj", false, wezwij)
  39. tekst = guiCreateEdit(10*width, 26*height, 450*width, 51*height, "", false, wezwij)
  40. end
  41. )
  42.  
  43.  
  44. function otworz ()
  45. guiSetVisible(monitor, true)
  46. showCursor(true)
  47. outputChatBox("Zalogowałeś/-aś się na komputer OSP.")
  48. end
  49. addEventHandler("onClientMarkerHit", marker, otworz)
  50.  
  51. function zamknij ()
  52. if source == zamknij then
  53. guiSetVisible (monitor, false)
  54. showCursor (false)
  55. outputChatBox ("Wylogowałeś/-aś się z systemu." )
  56. end
  57. end
  58. addEventHandler("onClientGUIClick", root, zamknij)
  59.  
  60.  
  61. --kamery + off kamer
  62.  
  63. function kameraJeden ()
  64. if source == kamera1 then
  65. guiSetVisible (monitor, false)
  66. setCameraMatrix (-114.7031, 1016.1692, 23.8511, -119.90000152588, 1021, 21)
  67. guiSetVisible (wylacz, true)
  68. showCursor (true)
  69. outputChatBox ("**Podgląd z kamery nr 1.")
  70. end
  71. end
  72. addEventHandler("onClientGUIClick", root, kameraJeden)
  73.  
  74. function kameraDwa ()
  75. if source == kamera2 then
  76. guiSetVisible (monitor, false)
  77. setCameraMatrix (-114.8578, 1007.6431, 23.9889, -122.59999847412, 1013.0999755859, 20.39999961853)
  78. guiSetVisible (wylacz, true)
  79. showCursor (true)
  80. outputChatBox ("**Podgląd z kamery nr 2.")
  81. end
  82. end
  83. addEventHandler("onClientGUIClick", root, kameraDwa)
  84.  
  85. function kameraTrzy ()
  86. if source == kamera3 then
  87. guiSetVisible (monitor, false)
  88. setCameraMatrix (-114.6912, 998.3926, 23.9341, -123.40000152588, 1004.4000244141, 20.39999961853)
  89. guiSetVisible (wylacz, true)
  90. showCursor (true)
  91. outputChatBox ("**Podgląd z kamery nr 3.")
  92. end
  93. end
  94. addEventHandler("onClientGUIClick", root, kameraTrzy)
  95.  
  96. function kameraCztery ()
  97. if source == kamera4 then
  98. guiSetVisible (monitor, false)
  99. setCameraMatrix (-115.7143, 989.5533, 23.6280, -124.90000152588, 995.09997558594, 20.39999961853)
  100. guiSetVisible (wylacz, true)
  101. showCursor (true)
  102. outputChatBox ("**Podgląd z kamery nr 4.")
  103. end
  104. end
  105. addEventHandler("onClientGUIClick", root, kameraCztery)
  106.  
  107. function kameraPiec ()
  108. if source == kamera5 then
  109. guiSetVisible (monitor, false)
  110. setCameraMatrix (-114.0060, 989.8550, 23.8644, -103.59999847412, 1004.299987793, 19.799999237061)
  111. guiSetVisible (wylacz, true)
  112. showCursor (true)
  113. outputChatBox ("**Podgląd z kamery nr 5.")
  114. end
  115. end
  116. addEventHandler("onClientGUIClick", root, kameraPiec)
  117.  
  118. function kameraSzesc ()
  119. if source == kamera6 then
  120. guiSetVisible (monitor, false)
  121. setCameraMatrix (-129.8901, 1023.9247, 27.9543, -122.40000152588, 1018.299987793, 26)
  122. guiSetVisible (wylacz, true)
  123. showCursor (true)
  124. outputChatBox ("**Podgląd z kamery nr 6.")
  125. end
  126. end
  127. addEventHandler("onClientGUIClick", root, kameraSzesc)
  128.  
  129. function kameraOff (thePlayer)
  130. if source == wylacz then
  131. guiSetVisible (wylacz, false)
  132. guiSetVisible (monitor, true)
  133. setCameraTarget ( localPlayer )
  134. end
  135. end
  136. addEventHandler("onClientGUIClick", root, kameraOff)
  137.  
  138.  
  139. --syrena alarmowa OSP
  140.  
  141. function syrenaOSP ()
  142. if source == alarm then
  143. local syrena = playSound3D("syrena.wav", -25.58969, 1534.21106, 18.64447, false)
  144. setSoundVolume(syrena,350)
  145. setSoundMaxDistance(syrena, 450)
  146. outputChatBox ("Uruchomiłeś syrenę alarmową OSP.")
  147. end
  148. end
  149. addEventHandler("onClientGUIClick", root, syrenaOSP)
  150.  
  151. -- panel alarmowy OSP
  152.  
  153. function wezwanie ()
  154. if source == wezwanie then
  155. guiSetVisible (monitor, false)
  156. guiSetVisible (wezwij, true)
  157. showChat(false)
  158. end
  159. end
  160. addEventHandler("onClientGUIClick", root, wezwanie)
  161.  
  162. function anulujWezwanie ()
  163. if source == anuluj then
  164. guiSetVisible(monitor, true)
  165. guiSetVisible(wezwij, false)
  166. showChat(true)
  167. end
  168. end
  169. addEventHandler("onClientGUIClick", root, anulujWezwanie)
  170.  
  171. function ST()
  172. if source == wyslij then
  173. local text = guiGetText(tekst)
  174. triggerServerEvent("NAOT", getLocalPlayer(), text)
  175. showChat(true)
  176. guiSetVisible(monitor, true)
  177. guiSetVisible(wezwij, false)
  178. end
  179. end
  180. addEventHandler("onClientGUIClick", root, ST)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement