Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <hamsandwich>
  3.  
  4. #define PLUGIN_NAME "HE Grenade Blocker"
  5. #define PLUGIN_VERSION "1.0"
  6. #define PLUGIN_AUTHOR "LondoN eXtream"
  7.  
  8. #define CHAT_MSG "^x01Grenada o poti folosi dupa primile^x04 15^x01 secunde de cand a inceput runda!"
  9.  
  10. new g_pCvarSeconds;
  11. new bool:g_bAttack;
  12.  
  13. public plugin_init()
  14. {
  15. register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
  16.  
  17. g_pCvarSeconds = register_cvar("he_block_in_seconds", "15");
  18.  
  19. RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_hegrenade", "fw_WeaponPrimaryAttack");
  20.  
  21. register_event("HLTV", "ev_newround", "a");
  22. }
  23.  
  24. public ev_newround()
  25. {
  26. g_bAttack = false;
  27.  
  28. set_task(float(get_pcvar_num(g_pCvarSeconds)), "can_use_he");
  29. return PLUGIN_CONTINUE;
  30. }
  31.  
  32. public can_use_he() g_bAttack = true;
  33.  
  34. public fw_WeaponPrimaryAttack ( iEntity )
  35. {
  36. if ( !g_bAttack )
  37. {
  38. new id = get_pdata_cbase ( iEntity, 41, 4);
  39.  
  40. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"));
  41. write_byte(id);
  42. write_string(CHAT_MSG);
  43. message_end();
  44.  
  45. return HAM_SUPERCEDE;
  46. }
  47.  
  48. return HAM_IGNORED;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement