Advertisement
_BzK_

[FS] Sistema de Homme Bomba by: BzK

Feb 7th, 2015
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.20 KB | None | 0 0
  1. // Sistema de Homem Bomba by: BzK
  2.  
  3. #include <a_samp>
  4. #include <zcmd>
  5.  
  6. new AtivouHomemBomba[MAX_PLAYERS];
  7. new PegarBombaTimer[MAX_PLAYERS];
  8. new HomemBombaTimer[MAX_PLAYERS];
  9.  
  10. forward Contador();
  11.  
  12. public OnFilterScriptInit()
  13. {
  14. print("\n--------------------------------------");
  15. print(" Sistema de Homem Bomba by: BzK");
  16. print("--------------------------------------\n");
  17.  
  18. SetTimer("Contador", 1000, true);
  19.  
  20. return 1;
  21. }
  22.  
  23. public OnPlayerConnect(playerid)
  24. {
  25. AtivouHomemBomba[playerid] = 0;
  26. HomemBombaTimer[playerid] = 0;
  27. PegarBombaTimer[playerid] = 0;
  28. return 1;
  29. }
  30.  
  31. public OnPlayerDeath(playerid, killerid, reason)
  32. {
  33. AtivouHomemBomba[playerid] = 0;
  34. return 1;
  35. }
  36.  
  37. public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
  38. {
  39. if(AtivouHomemBomba[damagedid] == 1)
  40. {
  41. new Float:x,Float:y,Float:z;
  42. GetPlayerPos(damagedid,x,y,z);
  43. CreateExplosion(x, y, z, 6, 2000.0);
  44. CreateExplosion(x+2, y+2, z+2, 6, 2000.0);
  45. CreateExplosion(x+3, y+3, z+3, 6, 2000.0);
  46. }
  47. return 1;
  48. }
  49.  
  50. public Contador()
  51. {
  52. for(new i = 0; i <= MAX_PLAYERS; i++)
  53. {
  54. if(HomemBombaTimer[i] <= 0)
  55. HomemBombaTimer[i] = 0;
  56. else
  57. HomemBombaTimer[i] -= 1;
  58.  
  59. if(PegarBombaTimer[i] <= 0)
  60. PegarBombaTimer[i] = 0;
  61. else
  62. PegarBombaTimer[i] -= 1;
  63. }
  64. }
  65.  
  66. CMD:pegarbomba(playerid, params[])
  67. {
  68. #pragma unused params
  69.  
  70. new stringloka[128];
  71. format(stringloka, 128, "[ERRO] Você já pegou uma bomba recentemente, espere mais %d segundos.", PegarBombaTimer[playerid]);
  72.  
  73. if(PegarBombaTimer[playerid] > 0)
  74. return SendClientMessage(playerid, -1, stringloka);
  75.  
  76. if(AtivouHomemBomba[playerid] == 1)
  77. return SendClientMessage(playerid, -1, "[Erro] Você já ativou a bomba.");
  78.  
  79. SetPlayerAttachedObject(playerid, 7, 363, 17, -0.20622876, 0.19777177, 0.15666486, 103.44262695, 68.12296295, -108.56298065);
  80. SetPlayerAttachedObject(playerid, 8, 363, 17, -0.30122867, -0.09822817, 0.15766486, 104.04261779, 74.02297210, -105.86302185);
  81.  
  82. AtivouHomemBomba[playerid] = 1;
  83. PegarBombaTimer[playerid] = 900;
  84. return 1;
  85. }
  86.  
  87. CMD:homembomba(playerid, params[])
  88. {
  89. #pragma unused params
  90. new stringloka[128];
  91. format(stringloka, 128, "[ERRO] Você já se explodiu recentemente, espere mais %d segundos.", HomemBombaTimer[playerid]);
  92.  
  93. if(HomemBombaTimer[playerid] > 0)
  94. return SendClientMessage(playerid, -1, stringloka);
  95.  
  96. if(IsPlayerInAnyVehicle(playerid))
  97. return SendClientMessage(playerid, -1, "[Erro] Você não pode usar este comando dentro de um veículo.");
  98.  
  99. if(AtivouHomemBomba[playerid] != 1)
  100. return SendClientMessage(playerid, -1, "[Erro] Você não pegou a bomba.");
  101.  
  102. new Float:x,Float:y,Float:z;
  103. GetPlayerPos(playerid, x, y, z);
  104. CreateExplosion(x, y, z, 6, 2000.0);
  105. CreateExplosion(x+2, y+2, z+2, 6, 2000.0);
  106. CreateExplosion(x+3, y+3, z+3, 6, 2000.0);
  107. SetPlayerHealth(playerid, 0);
  108. SetPlayerArmour(playerid, 0);
  109. HomemBombaTimer[playerid] = 900;
  110. SendClientMessage(playerid, -1, "[HOMEM BOMBA] Você se explodiu com sucesso!");
  111. return 1;
  112. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement