Guest User

Untitled

a guest
Dec 31st, 2011
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.49 KB | None | 0 0
  1. if(strcmp(cmd, "/crb", true) == 0 || strcmp(cmd, "/createroadblock", true) == 0)
  2. {
  3. if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid))
  4. {
  5. tmp = strtok(cmdtext, idx);
  6. if(!strlen(tmp))
  7. {
  8. SendClientMessage(playerid, COLOR_WHITE, "USAGE: /crb [Roadblock ID]");
  9. SendClientMessage(playerid, COLOR_LIGHTBLUE, "Available Roadblocks:");
  10. SendClientMessage(playerid, COLOR_GRAD1, "| 1: Small Roadblock | 2: Medium Roadblock |");
  11. SendClientMessage(playerid, COLOR_GRAD1, "| 3: Big Roadblock | 4: Cone | 5: Detour Sign |");
  12. SendClientMessage(playerid, COLOR_GRAD1, "| 6: Will Be Sign | 7: Line Closed Sign |");
  13. return 1;
  14. }
  15. new rb = strval(tmp);
  16. if (rb == 1)
  17. {
  18. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  19. new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
  20. GetPlayerPos(playerid, plocx, plocy, plocz);
  21. GetPlayerFacingAngle(playerid,ploca);
  22. CreateRoadblock(1459,plocx,plocy,plocz,ploca);
  23. format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(1) at his position, over.",sendername);
  24. SendRadioMessage(1,COLOR_BLUE,string);
  25. GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
  26. return 1;
  27. }
  28. else if (rb == 2)
  29. {
  30. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  31. new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
  32. GetPlayerPos(playerid, plocx, plocy, plocz);
  33. GetPlayerFacingAngle(playerid,ploca);
  34. CreateRoadblock(978,plocx,plocy,plocz+0.6,ploca);
  35. format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(2) at his position, over.",sendername);
  36. SendRadioMessage(1,COLOR_BLUE,string);
  37. GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
  38. return 1;
  39. }
  40. else if (rb == 3)
  41. {
  42. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  43. new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
  44. GetPlayerPos(playerid, plocx, plocy, plocz);
  45. GetPlayerFacingAngle(playerid,ploca);
  46. CreateRoadblock(981,plocx,plocy,plocz+0.9,ploca+180);
  47. format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(3) at his position, over.",sendername);
  48. SendRadioMessage(1,COLOR_BLUE,string);
  49. GameTextForPlayer(playerid,"~w~Roadblock ~g~Placed!",3000,1);
  50. SafeSetPlayerPos(playerid, plocx, plocy+1.3, plocz);
  51. return 1;
  52. }
  53. else if (rb == 4)
  54. {
  55. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  56. new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
  57. GetPlayerPos(playerid, plocx, plocy, plocz);
  58. GetPlayerFacingAngle(playerid,ploca);
  59. CreateRoadblock(1238,plocx,plocy,plocz+0.2,ploca);
  60. format(string,sizeof(string),"[HQ]: Officer %s has placed a Traffic Cone(1) at his position, over.",sendername);
  61. SendRadioMessage(1,COLOR_BLUE,string);
  62. GameTextForPlayer(playerid,"~w~Cone ~g~Placed!",3000,1);
  63. return 1;
  64. }
  65. else if (rb == 5)
  66. {
  67. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  68. new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
  69. GetPlayerPos(playerid, plocx, plocy, plocz);
  70. GetPlayerFacingAngle(playerid,ploca);
  71. CreateRoadblock(1425,plocx,plocy,plocz+0.6,ploca);
  72. format(string,sizeof(string),"[HQ]: Officer %s has placed a Detour Sign(4) at his position, over.",sendername);
  73. SendRadioMessage(1,COLOR_BLUE,string);
  74. GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
  75. return 1;
  76. }
  77. else if (rb == 6)
  78. {
  79. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  80. new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
  81. GetPlayerPos(playerid, plocx, plocy, plocz);
  82. GetPlayerFacingAngle(playerid,ploca);
  83. CreateRoadblock(3265,plocx,plocy,plocz-0.5,ploca);
  84. format(string,sizeof(string),"[HQ]: Officer %s has placed a Will Be Sign(5) at his position, over.",sendername);
  85. SendRadioMessage(1,COLOR_BLUE,string);
  86. GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
  87. return 1;
  88. }
  89. else if (rb == 7)
  90. {
  91. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  92. new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
  93. GetPlayerPos(playerid, plocx, plocy, plocz);
  94. GetPlayerFacingAngle(playerid,ploca);
  95. CreateRoadblock(3091,plocx,plocy,plocz+0.5,ploca+180);
  96. format(string,sizeof(string),"[HQ]: Officer %s has placed a Line Closed Sign(6) at his position, over.",sendername);
  97. SendRadioMessage(1,COLOR_BLUE,string);
  98. GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
  99. return 1;
  100. }
  101. new y, m, d;
  102. new h,mi,s;
  103. getdate(y,m,d);
  104. gettime(h,mi,s);
  105. format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /createroadblock %d",d,m,y,h,mi,s,sendername, rb);
  106. CommandLog(string);
  107. }
  108. return 1;
  109. }
  110.  
  111. if (strcmp(cmd,"/rub",true) == 0 || strcmp(cmd, "/removeroadblock", true) == 0)
  112. {
  113. if(IsPlayerConnected(playerid) && IsACop(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
  114. {
  115. DeleteClosestRoadblock(playerid);
  116. format(string,sizeof(string),"[HQ]: Officer %s has removed a Roadblock, over.",sendername);
  117. SendRadioMessage(1,COLOR_BLUE,string);
  118. GameTextForPlayer(playerid,"~w~Roadblock ~r~Removed!",3000,1);
  119. new y, m, d;
  120. new h,mi,s;
  121. getdate(y,m,d);
  122. gettime(h,mi,s);
  123. format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /removeroadblock",d,m,y,h,mi,s,sendername);
  124. CommandLog(string);
  125. }
  126. return 1;
  127. }
  128.  
  129. if (strcmp(cmd,"/rrball",true) == 0 || strcmp(cmd, "/removeroadblockall", true) == 0)
  130. {
  131. if(IsPlayerConnected(playerid) && IsACop(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
  132. {
  133. if(PlayerInfo[playerid][pRank] >= 5 || PlayerInfo[playerid][pAdmin] >= 2) // This being the default Chief rank in LA-RP change if neccesary.
  134. {
  135. DeleteAllRoadblocks(playerid);
  136. format(string,sizeof(string),"[HQ]: Officer %s has removed all Roadblocks in the area, over.",sendername);
  137. SendRadioMessage(1,COLOR_BLUE,string);
  138. GameTextForPlayer(playerid,"~b~All ~w~Roadblocks ~r~Removed!",3000,1);
  139. new y, m, d;
  140. new h,mi,s;
  141. getdate(y,m,d);
  142. gettime(h,mi,s);
  143. format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /removeroadblockall",d,m,y,h,mi,s,sendername);
  144. CommandLog(string);
  145. }
  146. }
  147. return 1;
  148. }
Advertisement
Add Comment
Please, Sign In to add comment