Guest User

Bomba System

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