Advertisement
Joksa

Automatic Gates System

Mar 9th, 2013
682
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.70 KB | None | 0 0
  1. // This is the Gates System with aumomatic Gates
  2. // This filterscript is made by >>>(((   Joksa   )))<<<
  3.  
  4. #include <a_samp>
  5.  
  6. new lspdg;
  7. new pdgate1;
  8.  
  9. forward GateClose(playerid);
  10.  
  11. #if defined FILTERSCRIPT
  12.  
  13. public OnFilterScriptInit()
  14. {
  15.     print("\n--------------------------------------");
  16.     print(" Gates System by Joksa >>>Is Loaded<<<");
  17.     print("--------------------------------------\n");
  18.     return 1;
  19. }
  20.  
  21. public OnFilterScriptExit()
  22. {
  23.     return 1;
  24. }
  25.  
  26. #else
  27.  
  28. main()
  29. {
  30.     print("\n----------------------------------");
  31.     print(" Gates System by Joksa >>>Is Loaded<<<");
  32.     print("----------------------------------\n");
  33. }
  34.  
  35. #endif
  36.  
  37. public OnGameModeInit()
  38. {
  39. pdgate1 = CreateObject(968,1544.6992188,-1623.8994141,13.0000000,0.0000000,88.0000000,265.9982300); // The gate is the PD garage
  40. return 1;
  41. }
  42.  
  43. public OnGameModeExit()
  44. {
  45. return 1;
  46. }
  47.  
  48. public OnPlayerCommandText(playerid, cmdtext[])
  49. {
  50. if (strcmp("/po", cmdtext, true, 10) == 0)
  51. {
  52. if(IsPlayerInRangeOfPoint(playerid, 15,1544.5923,-1627.1566,13.382)) // The gate is the PD garage
  53. {
  54. if(lspdg == 1) { SendClientMessage(playerid, 0xFF000000, "** The door is already open!"); return 1; }
  55. MoveObject(pdgate1,1544.6992188,-1623.8994141,13.0000000,10,0.0000000,8.0000000,265.9982300);
  56. SendClientMessage(playerid, 0xFF000000,"The door to the garage open, after 7 seconds it will automatically be lowered.");
  57. SetTimer("GateClose", 7000, 0);
  58. }
  59. return 1;
  60. }
  61. return 0;
  62. }
  63.  
  64. public GateClose(playerid)
  65. {
  66.       MoveObject(pdgate1, 1544.6992188,-1623.8994141,13.0000000,1.0,0.0000000,88.0000000,265.9982300); // The gate is the PD garage
  67.       PlayerPlaySound(playerid, 1153, 1589.053344,-1638.123168,14.122960);
  68.       lspdg = 0;
  69.       return 1;
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement