Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.03 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. //#define FILTERSCRIPT
  4.  
  5. #define FILTERSCRIPT
  6.  
  7. #include <a_samp>
  8. #include <foreach>
  9. #include <zcmd>
  10.  
  11.  
  12. #if !defined isnull
  13. #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
  14. #endif
  15.  
  16. #define DONOVAN_HESLO "1358"
  17.  
  18. #define DIALOG_DONOVAN_PASS 900
  19.  
  20. #define SOUND_RADIUS 15.0
  21.  
  22. new DonovanObj[50], bool:DonovanDoor;
  23.  
  24. #if defined FILTERSCRIPT
  25.  
  26. public OnFilterScriptInit()
  27. {
  28. DonovanDoor = false;
  29. //DONOVAN
  30. DonovanObj[0] = CreateObject(1726, 1817.97644, -1299.59570, 119.24284, 0.00000, 0.00000, -139.56000);
  31. DonovanObj[1] = CreateObject(2370, 1815.87537, -1299.09790, 119.13321, 0.00000, 0.00000, 40.19999);
  32. DonovanObj[2] = CreateObject(1727, 1814.37537, -1300.51196, 119.25663, 0.00000, 0.00000, 130.13995);
  33. DonovanObj[3] = CreateObject(1727, 1817.22876, -1296.76917, 119.25660, 0.00000, 0.00000, -49.47998);
  34. DonovanObj[4] = CreateObject(19362, 1793.86792, -1296.40173, 120.98759, 0.00000, 0.00000, -36.42000);
  35. DonovanObj[5] = CreateObject(19362, 1793.87585, -1296.40564, 122.97260, 0.00000, 0.00000, -36.42000);
  36. DonovanObj[6] = CreateObject(19391, 1791.96375, -1298.98193, 120.97546, 0.00000, 0.00000, -36.42000);
  37. DonovanObj[7] = CreateObject(19435, 1792.05298, -1298.87402, 122.85730, 90.00000, 0.00000, -36.36000);
  38. DonovanObj[8] = CreateObject(19435, 1792.05103, -1298.87195, 123.91940, 90.00000, 0.00000, -36.42000);
  39. DonovanObj[9] = CreateObject(19435, 1790.54712, -1300.90063, 120.94728, 0.00000, 0.00000, -36.42000);
  40. DonovanObj[10] = CreateObject(19435, 1790.54907, -1300.90259, 122.57080, 0.00000, 0.00000, -36.42000);
  41. DonovanObj[11] = CreateObject(19435, 1790.47705, -1301.00061, 120.94730, 0.00000, 0.00000, -36.42000);
  42. DonovanObj[12] = CreateObject(19435, 1790.47913, -1301.00061, 122.55170, 0.00000, 0.00000, -36.42000);
  43. DonovanObj[13] = CreateObject(19999, 1823.29028, -1282.60022, 119.26730, 0.00000, 0.00000, -90.00000);
  44. DonovanObj[14] = CreateObject(11691, 1821.37988, -1281.63562, 119.26630, 0.00000, 0.00000, -90.00000);
  45. DonovanObj[15] = CreateObject(19999, 1823.29028, -1280.96814, 119.26730, 0.00000, 0.00000, -87.33100);
  46. DonovanObj[16] = CreateObject(19999, 1823.29028, -1279.33618, 119.26730, 0.00000, 0.00000, -91.71600);
  47. DonovanObj[17] = CreateObject(11691, 1821.37988, -1278.64355, 119.26630, 0.00000, 0.00000, -90.00000);
  48. DonovanObj[18] = CreateObject(19999, 1823.29028, -1277.77222, 119.26730, 0.00000, 0.00000, -75.01100);
  49. DonovanObj[19] = CreateObject(19999, 1821.36401, -1275.99939, 119.26730, 0.00000, 0.00000, 3.00000);
  50. DonovanObj[20] = CreateObject(19999, 1819.56677, -1277.80847, 119.26730, 0.00000, 0.00000, 90.00000);
  51. DonovanObj[21] = CreateObject(19999, 1819.56677, -1279.23645, 119.26730, 0.00000, 0.00000, 77.86770);
  52. DonovanObj[22] = CreateObject(19999, 1819.56677, -1280.93652, 119.26730, 0.00000, 0.00000, 100.82070);
  53. DonovanObj[23] = CreateObject(19999, 1819.56677, -1282.50049, 119.26730, 0.00000, 0.00000, 94.91850);
  54. DonovanObj[24] = CreateObject(19893, 1821.35388, -1277.61548, 120.04390, 0.00000, 0.00000, -180.18010);
  55. DonovanObj[25] = CreateObject(11724, 1816.66479, -1273.01135, 119.78560, 0.00000, 0.00000, 30.00000);
  56. DonovanObj[26] = CreateObject(11725, 1816.72559, -1273.10840, 119.67650, 0.00000, 0.00000, 30.00000);
  57. DonovanObj[27] = CreateObject(19173, 1816.52417, -1272.77795, 121.48611, 0.00000, 0.00000, 30.00000);
  58. DonovanObj[28] = CreateObject(1536, 1792.43005, -1298.35974, 119.26010, 0.00000, 0.00000, 233.52000); //DVERE
  59. DonovanObj[29] = CreateObject(2198, 1795.55432, -1298.30566, 119.26662, 0.00000, 0.00000, 163.86011);
  60. DonovanObj[30] = CreateObject(1811, 1795.27441, -1296.66895, 119.86260, 0.00000, 0.00000, 86.64001);
  61. DonovanObj[31] = CreateObject(2193, 1809.30188, -1299.98914, 119.26650, 0.00000, 0.00000, -90.15999);
  62. DonovanObj[32] = CreateObject(2172, 1806.90588, -1301.04138, 119.26790, 0.00000, 0.00000, 90.16000);
  63. DonovanObj[33] = CreateObject(1811, 1809.23682, -1301.10828, 119.84504, 0.00000, 0.00000, -130.49997);
  64. DonovanObj[34] = CreateObject(1811, 1807.63953, -1300.07422, 119.84504, 0.00000, 0.00000, 71.82000);
  65. DonovanObj[35] = CreateObject(2187, 1795.84460, -1297.13550, 119.26674, 0.00000, 0.00000, 166.08002);
  66. DonovanObj[36] = CreateObject(2773, 1792.49670, -1300.58582, 119.78265, 0.00000, 0.00000, -105.06004);
  67. DonovanObj[37] = CreateObject(2773, 1795.01392, -1301.19421, 119.78265, 0.00000, 0.00000, -105.06004);
  68. DonovanObj[38] = CreateObject(2773, 1797.78662, -1300.71289, 119.78265, 0.00000, 0.00000, -11.28003);
  69. DonovanObj[39] = CreateObject(2773, 1797.11267, -1299.04285, 119.78265, 0.00000, 0.00000, -103.92002);
  70. DonovanObj[40] = CreateObject(19362, 1782.86255, -1307.23230, 120.98759, 0.00000, 0.00000, -31.08001);
  71. DonovanObj[41] = CreateObject(19362, 1781.20557, -1309.97961, 120.98760, 0.00000, 0.00000, -31.08000);
  72. DonovanObj[42] = CreateObject(19362, 1781.20361, -1309.97754, 122.60740, 0.00000, 0.00000, -31.08000);
  73. DonovanObj[43] = CreateObject(19362, 1782.86047, -1307.22827, 122.80960, 0.00000, 0.00000, -31.08000);
  74. DonovanObj[44] = CreateObject(19305, 1791.36902, -1299.83423, 120.37894, 0.00000, 0.00000, 53.57999);
  75. DonovanObj[45] = CreateObject(19305, 1791.33472, -1299.79968, 120.37890, 0.00000, 0.00000, -126.19997);
  76. DonovanObj[46] = CreateObject(1727, 1781.19653, -1305.66919, 119.25660, 0.00000, 0.00000, 180.00000);
  77. DonovanObj[47] = CreateObject(2370, 1780.35046, -1303.99292, 119.13320, 0.00000, 0.00000, 0.00000);
  78. DonovanObj[48] = CreateObject(1726, 1782.47180, -1302.60022, 119.24280, 0.00000, 0.00000, -90.00000);
  79. DonovanObj[49] = CreateObject(1726, 1778.86182, -1304.61621, 119.24280, 0.00000, 0.00000, 90.00000);
  80.  
  81. /////////
  82. return 1;
  83. }
  84.  
  85. public OnFilterScriptExit()
  86. {
  87. for(new i=0; i < 51; i++)
  88. {
  89. DestroyObject(DonovanObj[i]);
  90. }
  91. return 1;
  92. }
  93.  
  94. #endif
  95.  
  96.  
  97.  
  98. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  99. {
  100. if(newkeys == KEY_SECONDARY_ATTACK)
  101. {
  102. if(IsPlayerInRangeOfPoint(playerid, 3, 1792.5344, -1298.9337, 120.2656))
  103. {
  104. if(DonovanDoor == true)
  105. {
  106. print("DONOVANDOOR TRUE");
  107. SendClientMessageToAll(-1,"DONOVANDOOR TRUE");
  108. PlaySound(playerid, 21001, SOUND_RADIUS);
  109. ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 10.0, 0, 0, 0, 0, 0);
  110. MoveObject(DonovanObj[28], 1792.43005, -1298.35974, 119.26010, 2.00, 0.00000, 0.00000, 233.52000);
  111. DonovanDoor = false;
  112. } else {
  113. ShowPlayerDialog(playerid, DIALOG_DONOVAN_PASS, DIALOG_STYLE_INPUT, "Kódový zámek", "Tyto dveře jsou na kódový zámek, zadej kód:", "Potvrdit", "Zrušit");
  114. }
  115. }
  116. }
  117. return 1;
  118. }
  119.  
  120. stock PlaySound(playerid, sound, Float:range)
  121. {
  122. new Float:pX, Float:pY, Float:pZ;
  123. GetPlayerPos(playerid, pX, pY, pZ);
  124. print("Stock PlaySound");
  125. SendClientMessageToAll(-1,"Stock PlaySound");
  126. foreach(new i : Player)
  127. {
  128. if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
  129. {
  130. if(IsPlayerInRangeOfPoint(i, range, pX, pY, pZ))
  131. {
  132. PlayerPlaySound(i, sound, pX, pY, pZ);
  133. }
  134. }
  135. }
  136. return 1;
  137. }
  138.  
  139.  
  140. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  141. {
  142. if(dialogid == DIALOG_DONOVAN_PASS)
  143. {
  144. print("Nad PlaySound");
  145. SendClientMessageToAll(-1,"Nad PlaySound");
  146. PlaySound(playerid, 21001, SOUND_RADIUS);
  147. ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 10.0, 0, 0, 0, 0, 0);
  148. SendClientMessage(playerid, 0x0797f7FF, "> Zadaný kód byl správný.");
  149. MoveObject(DonovanObj[28], 1792.43005, -1298.35974, 119.26010, 2.00, 0.00000, 0.00000, 338.93991);
  150. DonovanDoor = true;
  151. }
  152. return 1;
  153. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement