Advertisement
Guest User

Lift v 2.0

a guest
Oct 4th, 2012
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.73 KB | None | 0 0
  1. //Acest script este creeat si apartine in totalitate lui Flashhiee
  2.  
  3. #define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6.  
  7. #if defined FILTERSCRIPT
  8.  
  9. #define BackTime 12000 // Timpul in care liftul revine la pozitia initiala
  10.  
  11. new pdlift;
  12.  
  13. forward PdLift();
  14. forward IsACop(playerid);
  15. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  16.  
  17. public OnFilterScriptInit()
  18. {
  19. CreateObject(1649,1552.09997559,-1654.19995117,14.19999981,0.00000000,0.00000000,0.00000000); //object(wglasssmash) (1)
  20. CreateObject(1649,1552.09997559,-1654.19995117,17.50000000,0.00000000,0.00000000,0.00000000); //object(wglasssmash) (6)
  21. CreateObject(1649,1552.09997559,-1654.19995117,20.70000076,0.00000000,0.00000000,0.00000000); //object(wglasssmash) (7)
  22. CreateObject(1649,1552.09997559,-1654.19995117,24.00000000,0.00000000,0.00000000,0.00000000); //object(wglasssmash) (8)
  23. CreateObject(1649,1552.09997559,-1654.19995117,27.20000076,0.00000000,0.00000000,0.00000000); //object(wglasssmash) (9)
  24. CreateObject(1649,1552.09997559,-1654.19995117,30.50000000,0.00000000,0.00000000,0.00000000); //object(wglasssmash) (10)
  25. CreateObject(1649,1549.90002441,-1652.00000000,17.50000000,0.00000000,0.00000000,270.00000000); //object(wglasssmash) (11)
  26. CreateObject(1649,1549.90002441,-1652.00000000,20.70000076,0.00000000,0.00000000,270.00000000); //object(wglasssmash) (12)
  27. CreateObject(1649,1549.90002441,-1652.00000000,24.00000000,0.00000000,0.00000000,270.00000000); //object(wglasssmash) (13)
  28. CreateObject(1649,1549.90002441,-1652.00000000,27.20000076,0.00000000,0.00000000,270.00000000); //object(wglasssmash) (14)
  29. CreateObject(1649,1549.90002441,-1652.00000000,30.50000000,0.00000000,0.00000000,270.00000000); //object(wglasssmash) (15)
  30. CreateObject(1649,1552.19995117,-1654.19995117,14.19999981,0.00000000,0.00000000,180.00000000); //object(wglasssmash) (16)
  31. CreateObject(1649,1549.90002441,-1652.00000000,30.50000000,0.00000000,0.00000000,90.00000000); //object(wglasssmash) (17)
  32. CreateObject(1649,1552.19995117,-1654.19995117,17.50000000,0.00000000,0.00000000,180.00000000); //object(wglasssmash) (18)
  33. CreateObject(1649,1552.19995117,-1654.19995117,20.70000076,0.00000000,0.00000000,180.00000000); //object(wglasssmash) (19)
  34. CreateObject(1649,1552.19995117,-1654.19995117,24.00000000,0.00000000,0.00000000,180.00000000); //object(wglasssmash) (20)
  35. CreateObject(1649,1552.19995117,-1654.19995117,27.20000076,0.00000000,0.00000000,180.00000000); //object(wglasssmash) (21)
  36. CreateObject(1649,1552.19995117,-1654.19995117,30.50000000,0.00000000,0.00000000,180.00000000); //object(wglasssmash) (22)
  37. CreateObject(1649,1549.90002441,-1652.00000000,17.50000000,0.00000000,0.00000000,90.00000000); //object(wglasssmash) (23)
  38. CreateObject(1649,1549.90002441,-1652.00000000,20.70000076,0.00000000,0.00000000,90.00000000); //object(wglasssmash) (24)
  39. CreateObject(1649,1549.90002441,-1652.00000000,24.00000000,0.00000000,0.00000000,90.00000000); //object(wglasssmash) (25)
  40. CreateObject(1649,1549.90002441,-1652.00000000,27.20000076,0.00000000,0.00000000,90.00000000); //object(wglasssmash) (26)
  41. CreateObject(1649,1552.09997559,-1649.80004883,27.20000076,0.00000000,0.00000000,0.00000000); //object(wglasssmash) (27)
  42. CreateObject(1649,1552.09997559,-1649.80004883,30.39999962,0.00000000,0.00000000,0.00000000); //object(wglasssmash) (28)
  43. CreateObject(3055,1553.80004883,-1650.09997559,14.19999981,0.00000000,0.00000000,0.00000000); //object(kmb_shutter) (1)
  44. CreateObject(3055,1553.80004883,-1650.09997559,19.10000038,0.00000000,0.00000000,0.00000000); //object(kmb_shutter) (2)
  45. CreateObject(3055,1553.80004883,-1650.09997559,24.10000038,0.00000000,0.00000000,0.00000000); //object(kmb_shutter) (3)
  46. CreateObject(3055,1554.09997559,-1650.30004883,14.80000019,0.00000000,0.00000000,90.00000000); //object(kmb_shutter) (4)
  47. CreateObject(3055,1554.19995117,-1650.30004883,19.70000076,0.00000000,0.00000000,270.00000000); //object(kmb_shutter) (5)
  48. CreateObject(3055,1554.19995117,-1650.30004883,24.50000000,0.00000000,0.00000000,270.00000000); //object(kmb_shutter) (6)
  49. CreateObject(1649,1552.09997559,-1649.80004883,27.20000076,0.00000000,0.00000000,180.00000000); //object(wglasssmash) (31)
  50. CreateObject(1649,1552.09997559,-1649.80004883,30.39999962,0.00000000,0.00000000,180.00000000); //object(wglasssmash) (32)
  51. CreateObject(9131,1549.90002441,-1649.80004883,28.50000000,0.00000000,0.00000000,0.00000000); //object(shbbyhswall13_lvs) (1)
  52. CreateObject(9131,1549.90002441,-1649.80004883,30.60000038,0.00000000,0.00000000,0.00000000); //object(shbbyhswall13_lvs) (2)
  53. CreateObject(9131,1549.90002441,-1654.19995117,13.69999981,0.00000000,0.00000000,0.00000000); //object(shbbyhswall13_lvs) (3)
  54. CreateObject(9131,1549.90002441,-1654.19995117,15.80000019,0.00000000,0.00000000,0.00000000); //object(shbbyhswall13_lvs) (4)
  55. CreateObject(9131,1549.90002441,-1654.19995117,17.89999962,0.00000000,0.00000000,0.00000000); //object(shbbyhswall13_lvs) (5)
  56. CreateObject(9131,1549.90002441,-1654.19995117,20.00000000,0.00000000,0.00000000,0.00000000); //object(shbbyhswall13_lvs) (6)
  57. CreateObject(9131,1549.90002441,-1654.19995117,22.00000000,0.00000000,0.00000000,0.00000000); //object(shbbyhswall13_lvs) (7)
  58. CreateObject(9131,1549.90002441,-1654.19995117,24.00000000,0.00000000,0.00000000,0.00000000); //object(shbbyhswall13_lvs) (8)
  59. CreateObject(9131,1549.90002441,-1654.19995117,26.10000038,0.00000000,0.00000000,0.00000000); //object(shbbyhswall13_lvs) (9)
  60. CreateObject(9131,1549.90002441,-1654.19995117,28.10000038,0.00000000,0.00000000,0.00000000); //object(shbbyhswall13_lvs) (10)
  61. CreateObject(9131,1549.90002441,-1654.19995117,28.50000000,0.00000000,0.00000000,0.00000000); //object(shbbyhswall13_lvs) (11)
  62. CreateObject(9131,1549.90002441,-1654.19995117,30.60000038,0.00000000,0.00000000,0.00000000); //object(shbbyhswall13_lvs) (12)
  63. CreateObject(9131,1554.09997559,-1649.80004883,28.50000000,0.00000000,0.00000000,0.00000000); //object(shbbyhswall13_lvs) (13)
  64. CreateObject(9131,1554.09997559,-1649.80004883,30.60000038,0.00000000,0.00000000,0.00000000); //object(shbbyhswall13_lvs) (14)
  65. CreateObject(9131,1554.19995117,-1654.19995117,28.50000000,0.00000000,0.00000000,0.00000000); //object(shbbyhswall13_lvs) (15)
  66. CreateObject(9131,1554.19995117,-1654.19995117,30.60000038,0.00000000,0.00000000,0.00000000); //object(shbbyhswall13_lvs) (16)
  67. CreateObject(3095,1551.69995117,-1652.19995117,31.60000038,0.00000000,0.00000000,0.00000000); //object(a51_jetdoor) (1)
  68. CreateObject(1250,1549.50000000,-1654.40002441,13.69999981,0.00000000,0.00000000,0.00000000); //object(smashbarpost) (1)
  69. CreateObject(1250,1554.50000000,-1649.69995117,28.39999962,0.00000000,0.00000000,178.00000000); //object(smashbarpost) (2)
  70. CreateObject(2922,1554.90002441,-1649.80004883,28.70000076,0.00000000,0.00000000,270.00000000); //object(kmb_keypad) (1)
  71. CreateObject(2922,1549.09997559,-1654.30004883,14.10000038,0.00000000,0.00000000,90.00000000); //object(kmb_keypad) (2)
  72. CreateObject(2921,1553.50000000,-1660.59997559,21.00000000,0.00000000,0.00000000,0.00000000); //object(kmb_cam) (1)
  73.  
  74. //Lift
  75. pdlift = CreateObject(3095,1554.09997559,-1649.69995117,12.60000038,0.00000000,180.00000000,0.00000000); //object(a51_jetdoor) (2)
  76.  
  77. print("\n--------------------------------------");
  78. print(" Poolice Lift V2.0 Loaded");
  79. print("--------------------------------------\n");
  80. return 1;
  81. }
  82.  
  83. public OnFilterScriptExit()
  84. {
  85. return 1;
  86. }
  87.  
  88.  
  89.  
  90.  
  91. public OnPlayerCommandText(playerid, cmdtext[])
  92. {
  93. if (strcmp("/pdlift", cmdtext, true, 10) == 0) {
  94. if(PlayerToPoint(5.0,playerid,1551.6097,-1652.1990,13.5966) || PlayerToPoint(5.0,playerid,1555.4459,-1651.9706,28.3956)) {
  95. if(!IsObjectMoving(pdlift)) {
  96. MoveObject(pdlift,1554.50000000,-1649.80004883,27.29999924,1.5);
  97. SetTimer("PdLift",BackTime,false); } else {
  98. SendClientMessage(playerid,-1,"Lift is already used."); }
  99. } else {
  100. SendClientMessage(playerid,-1,"You must be close to lift."); }
  101. return 1;
  102. }
  103. return 0;
  104. }
  105.  
  106.  
  107. public PdLift()
  108. {
  109. MoveObject(pdlift,1554.09997559,-1649.69995117,12.60000038,1.5);
  110. return 1;
  111. }
  112.  
  113. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  114. {
  115. if(IsPlayerConnected(playerid))
  116. {
  117. new Float:oldposx, Float:oldposy, Float:oldposz;
  118. new Float:tempposx, Float:tempposy, Float:tempposz;
  119. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  120. tempposx = (oldposx -x);
  121. tempposy = (oldposy -y);
  122. tempposz = (oldposz -z);
  123. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  124. {
  125. return 1;
  126. }
  127. }
  128. return 0;
  129. }
  130.  
  131. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement