1
0

PublicWorks.inc 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. // PROJECT LOS ANGELES ROLEPLAY
  2. // (C) 2010 GTAPoliceMods.com
  3. #include <a_samp>
  4. #define MAX_DIVERTS 80
  5. #define MAX_ROADCLOSED 80
  6. // DIVERT SIGNS
  7. enum dInfo
  8. {
  9. dCreated,
  10. Float:dX,
  11. Float:dY,
  12. Float:dZ,
  13. dObject,
  14. };
  15. new DivertInfo[MAX_DIVERTS][dInfo];
  16. stock CreateDivert(Float:x,Float:y,Float:z,Float:Angle)
  17. {
  18. for(new i = 0; i < sizeof(DivertInfo); i++)
  19. {
  20. if(DivertInfo[i][dCreated] == 0)
  21. {
  22. DivertInfo[i][dCreated]=1;
  23. DivertInfo[i][dX]=x;
  24. DivertInfo[i][dY]=y;
  25. DivertInfo[i][dZ]=z-0.7;
  26. DivertInfo[i][dObject] = CreateObject(1425, x, y, z-0.9, 0, 0, Angle, 500);
  27. return 1;
  28. }
  29. }
  30. return 0;
  31. }
  32. stock DeleteAllDivert()
  33. {
  34. for(new i = 0; i < sizeof(DivertInfo); i++)
  35. {
  36. if(DivertInfo[i][dCreated] == 1)
  37. {
  38. DivertInfo[i][dCreated]=0;
  39. DivertInfo[i][dX]=0.0;
  40. DivertInfo[i][dY]=0.0;
  41. DivertInfo[i][dZ]=0.0;
  42. DestroyObject(DivertInfo[i][dObject]);
  43. }
  44. }
  45. return 0;
  46. }
  47. stock DeleteClosestDivert(playerid)
  48. {
  49. for(new i = 0; i < sizeof(DivertInfo); i++)
  50. {
  51. if(IsPlayerInRangeOfPoint(playerid, 2.0, DivertInfo[i][dX], DivertInfo[i][dY], DivertInfo[i][dZ]))
  52. {
  53. if(DivertInfo[i][dCreated] == 1)
  54. {
  55. DivertInfo[i][dCreated]=0;
  56. DivertInfo[i][dX]=0.0;
  57. DivertInfo[i][dY]=0.0;
  58. DivertInfo[i][dZ]=0.0;
  59. DestroyObject(DivertInfo[i][dObject]);
  60. return 1;
  61. }
  62. }
  63. }
  64. return 0;
  65. }
  66. ///////
  67. enum LCInfo
  68. {
  69. LCCreated,
  70. Float:LCX,
  71. Float:LCY,
  72. Float:LCZ,
  73. LCObject,
  74. };
  75. new LineClosedInfo[MAX_ROADCLOSED][LCInfo];
  76. stock CreateLineClosed(Float:x,Float:y,Float:z,Float:Angle)
  77. {
  78. for(new i = 0; i < sizeof(LineClosedInfo); i++)
  79. {
  80. if(LineClosedInfo[i][LCCreated] == 0)
  81. {
  82. LineClosedInfo[i][LCCreated]=1;
  83. LineClosedInfo[i][LCX]=x;
  84. LineClosedInfo[i][LCY]=y;
  85. LineClosedInfo[i][LCZ]=z-0.7;
  86. LineClosedInfo[i][LCObject] = CreateObject(3091, x, y, z-0.9, 0, 0, Angle, 500);
  87. return 1;
  88. }
  89. }
  90. return 0;
  91. }
  92. stock DeleteAllLineClosed()
  93. {
  94. for(new i = 0; i < sizeof(LineClosedInfo); i++)
  95. {
  96. if(LineClosedInfo[i][LCCreated] == 1)
  97. {
  98. LineClosedInfo[i][LCCreated]=0;
  99. LineClosedInfo[i][LCX]=0.0;
  100. LineClosedInfo[i][LCY]=0.0;
  101. LineClosedInfo[i][LCZ]=0.0;
  102. DestroyObject(LineClosedInfo[i][LCObject]);
  103. }
  104. }
  105. return 0;
  106. }
  107. stock DeleteClosestLineClosed(playerid)
  108. {
  109. for(new i = 0; i < sizeof(LineClosedInfo); i++)
  110. {
  111. if(IsPlayerInRangeOfPoint(playerid, 2.0, LineClosedInfo[i][LCX], LineClosedInfo[i][LCY], LineClosedInfo[i][LCZ]))
  112. {
  113. if(LineClosedInfo[i][LCCreated] == 1)
  114. {
  115. LineClosedInfo[i][LCCreated]=0;
  116. LineClosedInfo[i][LCX]=0.0;
  117. LineClosedInfo[i][LCY]=0.0;
  118. LineClosedInfo[i][LCZ]=0.0;
  119. DestroyObject(LineClosedInfo[i][LCObject]);
  120. return 1;
  121. }
  122. }
  123. }
  124. return 0;
  125. }