Advertisement
Guest User

Untitled

a guest
Feb 27th, 2011
853
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.81 KB | None | 0 0
  1. /******************Police Panel v1.0 by ArenaGames Roleplay*****************
  2. * *
  3. *Scriptat de amaru de pe sa-mp.ro *
  4. *Credite la: Geso de pe sa-mp.com pentru cop tools *
  5. * Steven Paul de pe sa-mp.com pentru Police Panel *
  6. *Am combinat scripturile, luand ce am nevoie si a iesit asta. *
  7. *In viitor o sa mai adaug la script si alte functii interesante. *
  8. * *
  9. * *
  10. ****************************************************************************
  11. */
  12.  
  13. #include <a_samp>
  14.  
  15. #define COLOR_WHITE 0xFFFFFFAA
  16. #define COLOR_BLUE 0x2641FEAA
  17. #define TEAM_HIT_COLOR 0xFFFFFF00
  18. #define TEAM_BLUE_COLOR 0x8D8DFF00
  19. #define COLOR_DARKNICERED 0x9D000096
  20. #define COLOR_GREY 0xAFAFAFAA
  21. #pragma tabsize 0
  22. new reqbackup[MAX_PLAYERS];
  23. forward BackupClear(playerid, calledbytimer);
  24. public BackupClear(playerid, calledbytimer)
  25. {
  26. if(IsPlayerConnected(playerid))
  27. {
  28. if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 288 || GetPlayerSkin(playerid) == 284)
  29. {
  30. if (reqbackup[playerid] = 1)
  31. {
  32. for(new i = 0; i < MAX_PLAYERS; i++)
  33. {
  34. if(IsPlayerConnected(i))
  35. {
  36. if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 288 || GetPlayerSkin(playerid) == 284)
  37. {
  38. SetPlayerMarkerForPlayer(i, playerid, TEAM_HIT_COLOR);
  39. }
  40. }
  41. }
  42. if (calledbytimer != 1)
  43. {
  44. SendClientMessage(playerid, TEAM_BLUE_COLOR, "Cererea ta de ajutor a fost stearsa.");
  45. }
  46. else
  47. {
  48. SendClientMessage(playerid, TEAM_BLUE_COLOR, "Cererea ta de ajutor a fost stearsa automat.");
  49. }
  50. reqbackup[playerid] = 0;
  51. }
  52. else
  53. {
  54. if (calledbytimer != 1)
  55. {
  56. SendClientMessage(playerid, COLOR_DARKNICERED, "Nu ai o cerere activa!");
  57. }
  58. }
  59. }
  60. else
  61. {
  62. if (calledbytimer != 1)
  63. {
  64. SendClientMessage(playerid, COLOR_GREY, "Nu esti politist!");
  65. }
  66. }
  67. }
  68. return 1;
  69. }
  70.  
  71. PutRiotShieldOnBack(playerid)
  72. {
  73. if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
  74. SetPlayerAttachedObject(playerid, 1 , 18637, 1, 0, -0.1, 0.18, 90, 0, 272, 1, 1, 1);
  75. }
  76.  
  77. PutRiotShieldOnArm(playerid)
  78. {
  79. if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
  80. SetPlayerAttachedObject(playerid, 1, 18637, 4, 0.3, 0, 0, 0, 170, 270, 1, 1, 1);
  81. }
  82.  
  83. GiveFlashLight(playerid)
  84. {
  85. if(IsPlayerAttachedObjectSlotUsed(playerid,2)) RemovePlayerAttachedObject(playerid,2);
  86. SetPlayerAttachedObject(playerid, 2,18641, 5, 0.1, 0.02, -0.05, 0, 0, 0, 1, 1, 1);
  87. }
  88.  
  89. GiveTazer(playerid)
  90. {
  91. if(IsPlayerAttachedObjectSlotUsed(playerid,2)) RemovePlayerAttachedObject(playerid,2);
  92. SetPlayerAttachedObject(playerid, 2,18642, 5, 0.12, 0.02, -0.05, 0, 0, 45,1,1,1);
  93. }
  94.  
  95. public OnFilterScriptInit()
  96. {
  97. print("\n");
  98. print("----Police Panel by ArenaGames Roleplay---");
  99. print("Scriptat de amaru de pe sa-mp.ro");
  100. print("Credite pentru: Geso de pe sa-mp.com pentru cop tools");
  101. print("Steven Paul de pe sa-mp.com pentru Police Panel");
  102. print("\n");
  103. return 1;
  104. }
  105.  
  106.  
  107.  
  108. public OnPlayerConnect(playerid)
  109. {
  110. SendClientMessage(playerid, COLOR_WHITE, "This server is using amaru's police panel.");
  111. return 1;
  112. }
  113.  
  114.  
  115. public OnPlayerCommandText(playerid, cmdtext[])
  116. {
  117. if (strcmp("/panel", cmdtext, true, 10) == 0)
  118. {
  119. if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 288 || GetPlayerSkin(playerid) == 284)
  120. {
  121. ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "{00CED1}Police Panel","Air Support\nWater Support\nBackup\nClear Backup\nAnnounce\nItems","Select","Cancel");
  122. }
  123. else
  124. {
  125. SendClientMessage(playerid, COLOR_WHITE, "Nu esti politist");
  126. }
  127. return 1;
  128. }
  129. return 0;
  130. }
  131.  
  132.  
  133. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  134. {
  135. new string[128];
  136. if(response)
  137. {
  138. if(dialogid == 8)
  139. {
  140. if(listitem == 0)
  141. {
  142. new sendername[MAX_PLAYER_NAME];
  143. GetPlayerName(playerid, sendername, sizeof(sendername));
  144. if (reqbackup[playerid] != 1)
  145. {
  146. format(string, sizeof(string), "Catre toate unitatile: %s are nevoie de suport aerian. A fost marcat pe GPS", sendername);
  147. reqbackup[playerid] = 1;
  148. for(new i = 0; i < MAX_PLAYERS; i++)
  149. {
  150. if(IsPlayerConnected(i))
  151. {
  152. if(GetPlayerSkin(i) == 280 || GetPlayerSkin(i) == 281 || GetPlayerSkin(i) == 282 || GetPlayerSkin(i) == 283 || GetPlayerSkin(i) == 288 || GetPlayerSkin(i) == 284)
  153. {
  154. SetPlayerMarkerForPlayer(i, playerid, 0xFF0000FF);
  155. SendClientMessage(i, TEAM_BLUE_COLOR, string);
  156. }
  157. }
  158. }
  159. SetTimerEx("BackupClear", 180000, false, "ii", playerid, 1);
  160. }
  161. else
  162. {
  163. SendClientMessage(playerid, COLOR_GREY, "Deja ai o cerere activa!");
  164. }
  165. }
  166. if(listitem == 1)
  167. {
  168. new sendername[MAX_PLAYER_NAME];
  169. GetPlayerName(playerid, sendername, sizeof(sendername));
  170. if (reqbackup[playerid] != 1)
  171. {
  172. format(string, sizeof(string), "Catre toate unitatile: %s are nevoie de suport acvatic. A fost marcat pe GPS", sendername);
  173. reqbackup[playerid] = 1;
  174. for(new i = 0; i < MAX_PLAYERS; i++)
  175. {
  176. if(IsPlayerConnected(i))
  177. {
  178. if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(i) == 281 || GetPlayerSkin(i) == 282 || GetPlayerSkin(i) == 283 || GetPlayerSkin(i) == 288 || GetPlayerSkin(i) == 284)
  179. {
  180. SetPlayerMarkerForPlayer(i, playerid, 0xFF0000FF);
  181. SendClientMessage(i, TEAM_BLUE_COLOR, string);
  182. }
  183. }
  184. }
  185. SetTimerEx("BackupClear", 180000, false, "ii", playerid, 1);
  186. }
  187. else
  188. {
  189. SendClientMessage(playerid, COLOR_GREY, "Deja ai o cerere activa!");
  190. }
  191. }
  192. if(listitem == 2)
  193. {
  194. if (reqbackup[playerid] != 1)
  195. {
  196. new sendername[MAX_PLAYERS];
  197. GetPlayerName(playerid, sendername, sizeof(sendername));
  198. format(string, sizeof(string), "Catre toate unitatile: %s are nevoie de ajutor. A fost marcat pe GPS", sendername);
  199. reqbackup[playerid] = 1;
  200. for(new i = 0; i < MAX_PLAYERS; i++)
  201. {
  202. if(IsPlayerConnected(i))
  203. {
  204. if(GetPlayerSkin(i) == 280 || GetPlayerSkin(i) == 281 || GetPlayerSkin(i) == 282 || GetPlayerSkin(i) == 283 || GetPlayerSkin(i) == 288 || GetPlayerSkin(i) == 284)
  205. {
  206. SetPlayerMarkerForPlayer(i, playerid, 0xFF0000FF);
  207. SendClientMessage(i, TEAM_BLUE_COLOR, string);
  208. }
  209. }
  210. }
  211. SetTimerEx("BackupClear", 180000, false, "ii", playerid, 1);
  212. }
  213. else
  214. {
  215. SendClientMessage(playerid, COLOR_GREY, "Deja ai o cerere activa!");
  216. }
  217. }
  218. if(listitem == 3)
  219. {
  220. BackupClear(playerid, 0);
  221. }
  222. if(listitem == 4)
  223. {
  224. ShowPlayerDialog(playerid, 115, DIALOG_STYLE_INPUT, "Anunt", "Scrie anuntul aici.", "SEND", "CLOSE");
  225. }
  226. if(listitem == 5)
  227. {
  228. ShowPlayerDialog(playerid, 9, DIALOG_STYLE_LIST,"{00CED1}Items menu","Scut (mana)\nScut (spate)\nLanterna\nTazer\nScoate elemente","Select", "Cancel");
  229. }
  230. }
  231. if(dialogid == 9)
  232. {
  233. if(listitem == 0)
  234. {
  235. PutRiotShieldOnArm(playerid);
  236. }
  237. if(listitem == 1)
  238. {
  239. PutRiotShieldOnBack(playerid);
  240. }
  241. if(listitem == 2)
  242. {
  243. GiveFlashLight(playerid);
  244. }
  245. if(listitem == 3)
  246. {
  247. GiveTazer(playerid);
  248. }
  249. if(listitem == 4)
  250. {
  251. if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
  252. if(IsPlayerAttachedObjectSlotUsed(playerid,2)) RemovePlayerAttachedObject(playerid,2);
  253. }
  254. }
  255. if(dialogid == 115) //<<< NEW >>>//
  256. {
  257.  
  258. new idx;
  259. new sendername[MAX_PLAYER_NAME];
  260. GetPlayerName(playerid, sendername, sizeof(sendername));
  261. new length = strlen(inputtext);
  262. while ((idx < length) && (inputtext[idx] <= ' '))
  263. {
  264. idx++;
  265. }
  266. new offset = idx;
  267. new result[64];
  268. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  269. {
  270. result[idx - offset] = inputtext[idx];
  271. idx++;
  272. }
  273. result[idx - offset] = EOS;
  274. SendClientMessageToAll(COLOR_WHITE, "|___________ Cop Announcement ___________|");
  275. format(string, sizeof(string), "Officer %s: %s", sendername, result);
  276. SendClientMessageToAll(COLOR_BLUE, string);
  277. return false;
  278. }
  279. }
  280. return 1;
  281. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement