Advertisement
Guest User

/siren Filterscripts

a guest
Apr 12th, 2012
1,036
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. new Siren[MAX_VEHICLES];
  2. new SirenObject[MAX_VEHICLES];
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9. CMD:siren(playerid, params[])
  10. {
  11. if(IsACop(playerid)) {
  12. new string[128], type;
  13. new VID = GetPlayerVehicleID(playerid);
  14. if(sscanf(params, "d", type)) {
  15. SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /siren [type]");
  16. SendClientMessageEx(playerid, COLOR_GRAD2, "Type: 1 = Inside, 2 = Roof, 3 = Off.");
  17. return 1;
  18. }
  19. switch(type) {
  20. case 1:
  21. {
  22. if(Siren[VID] == 1) {
  23. SendClientMessageEx(playerid, COLOR_GRAD2, "This vehicle already has a siren!");
  24. return 1;
  25. }
  26. new sendername[MAX_PLAYER_NAME];
  27. Siren[VID] = 1;
  28. GetPlayerName(playerid, sendername, sizeof(sendername));
  29. SirenObject[VID] = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0);
  30. AttachObjectToVehicle(SirenObject[VID], VID, 0.0, 0.75, 0.275, 0.0, 0.1, 0.0);
  31. format(string, sizeof(string), "* %s puts the siren on the dashboard.", sendername);
  32. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  33. return 1;
  34. }
  35. case 2:
  36. {
  37. if(Siren[VID] == 1) {
  38. SendClientMessageEx(playerid, COLOR_GRAD2, "This vehicle already has a siren!");
  39. return 1;
  40. }
  41. Siren[VID] = 1;
  42. new sendername[MAX_PLAYER_NAME];
  43. GetPlayerName(playerid, sendername, sizeof(sendername));
  44. SirenObject[VID] = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0);
  45. AttachObjectToVehicle(SirenObject[VID], VID, -0.43, 0.0, 0.785, 0.0, 0.1, 0.0);
  46. format(string, sizeof(string), "* %s puts the siren on the roof.", sendername);
  47. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  48. return 1;
  49. }
  50. case 3:
  51. {
  52. if(Siren[VID] == 0) {
  53. SendClientMessageEx(playerid, COLOR_GRAD2, "This vehicle doesn't have a siren on it!");
  54. return 1;
  55. }
  56. Siren[VID] = 0;
  57. new sendername[MAX_PLAYER_NAME];
  58. GetPlayerName(playerid, sendername, sizeof(sendername));
  59. DestroyObject(SirenObject[VID]);
  60. format(string, sizeof(string), "* %s takes down the siren.", sendername);
  61. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  62. return 1;
  63. }
  64. default:
  65. {
  66. SendClientMessageEx(playerid, COLOR_WHITE, "Invalid license type! /siren [type]");
  67. SendClientMessageEx(playerid, COLOR_GRAD2, "Type: 1 = Roof, 2 = Inside, 3 = Off.");
  68. }
  69. }
  70. }
  71. else SendClientMessageEx(playerid, COLOR_GREY, "You're not authorised to use this command.");
  72. return 1;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement