Advertisement
Guest User

Untitled

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