Elm0P2

Samp FilterScript Bomba Sistem

Nov 30th, 2014
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. //Bomba sistem by Elm0P2
  2.  
  3. #define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6.  
  7. new imabombu[MAX_PLAYERS];
  8.  
  9. #define DIALOG_BOMBAHELP 1
  10. #define BOMBA_SLOT 1
  11.  
  12. new bomba;
  13.  
  14. public OnFilterScriptInit()
  15. {
  16. print("\n--------------------------------------");
  17. print(" Bomba sistem by Elm0P2");
  18. print("--------------------------------------\n");
  19. CreatePickup(1252, 1, 1566.4193, 23.3089, 24.1641, -1);
  20. return 1;
  21. }
  22.  
  23. public OnPlayerConnect(playerid)
  24. {
  25. imabombu[playerid] = 0;
  26. return 1;
  27. }
  28.  
  29. public OnPlayerCommandText(playerid, cmdtext[])
  30. {
  31. if (strcmp("/bombahelp", cmdtext, true, 10) == 0)
  32. {
  33. ShowPlayerDialog(playerid, DIALOG_BOMBAHELP, DIALOG_STYLE_MSGBOX, "Bomba Help", "/bombalokacija\n/kupibombu\n/postavibombu\n/aktivirajbombu", "Ok", "Ok");
  34. return 1;
  35. }
  36. if (strcmp("/kupibombu", cmdtext, true, 10) == 0)
  37. {
  38. if(IsPlayerInRangeOfPoint(playerid,1.0, 1566.4193, 23.3089, 24.1641))
  39. {
  40. if(imabombu[playerid] == 0)
  41. {
  42. SetPlayerAttachedObject(playerid, BOMBA_SLOT, 1252, 6, 0.3, 0.1, 0,0,-90,0, 1.0, 1.0, 1.0, 0, 0);
  43. SendClientMessage(playerid, -1, "Kupili ste bombu");
  44. imabombu[playerid] = 1;
  45. }
  46. }
  47. return 1;
  48. }
  49. if (strcmp("/bombalokacija", cmdtext, true, 10) == 0)
  50. {
  51. SetPlayerPos(playerid,1553.5643,47.5134,24.7817);
  52. return 1;
  53. }
  54. if (strcmp("/postavibombu", cmdtext, true, 10) == 0)
  55. {
  56. new Float:x, Float:y, Float:z;
  57. GetPlayerPos(playerid, x, y, z);
  58. if(imabombu[playerid] == 1)
  59. {
  60. if(IsPlayerAttachedObjectSlotUsed(playerid, BOMBA_SLOT)) RemovePlayerAttachedObject(playerid, BOMBA_SLOT);
  61. bomba = CreateObject(1252, x, y, z, 0.0, 0.0, 96.0);
  62. SendClientMessage(playerid, -1, "Postavili ste bombu! Da je aktivirate /aktivirajbombu!");
  63. imabombu[playerid] = 0;
  64. return 1;
  65. }
  66. }
  67. if (strcmp("/aktivirajbombu", cmdtext, true, 10) == 0)
  68. {
  69. new Float:b1, Float:b2, Float:b3;
  70. GetObjectPos(bomba, b1, b2, b3);
  71. CreateExplosion(b1, b2, b3, 1, 9.0);
  72. CreateExplosion(b1, b2, b3, 1, 9.0);
  73. CreateExplosion(b1, b2, b3, 1, 9.0);
  74. CreateExplosion(b1, b2, b3, 1, 9.0);
  75. CreateExplosion(b1, b2, b3, 1, 9.0);
  76. DestroyObject(bomba);
  77. return 1;
  78. }
  79. return 0;
  80. }
Advertisement
Add Comment
Please, Sign In to add comment