Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <hamsandwich>
- #define PLUGIN_NAME "HE Grenade Blocker"
- #define PLUGIN_VERSION "1.0"
- #define PLUGIN_AUTHOR "LondoN eXtream"
- #define CHAT_MSG "^x01Grenada o poti folosi dupa primile^x04 15^x01 secunde de cand a inceput runda!"
- new g_pCvarSeconds;
- new bool:g_bAttack;
- public plugin_init()
- {
- register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
- g_pCvarSeconds = register_cvar("he_block_in_seconds", "15");
- RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_hegrenade", "fw_WeaponPrimaryAttack");
- register_event("HLTV", "ev_newround", "a");
- }
- public ev_newround()
- {
- g_bAttack = false;
- set_task(float(get_pcvar_num(g_pCvarSeconds)), "can_use_he");
- return PLUGIN_CONTINUE;
- }
- public can_use_he() g_bAttack = true;
- public fw_WeaponPrimaryAttack ( iEntity )
- {
- if ( !g_bAttack )
- {
- new id = get_pdata_cbase ( iEntity, 41, 4);
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"));
- write_byte(id);
- write_string(CHAT_MSG);
- message_end();
- return HAM_SUPERCEDE;
- }
- return HAM_IGNORED;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement