Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <csx>
- #define PLUGIN "New Plug-In"
- #define VERSION "1.0"
- #define AUTHOR "author"
- new TASK_ID = 2254145
- new Float:fc4timer
- new Sync
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_event("HLTV", "pfn_round_start", "a", "1=0", "2=0")
- Sync = CreateHudSyncObj()
- }
- public bomb_planted()
- {
- set_task(0.1, "pfn_countdown", TASK_ID, _, _, "b")
- fc4timer = get_cvar_float("mp_c4timer")
- }
- public bomb_defused()
- {
- remove_task(TASK_ID)
- }
- public bomb_explode()
- {
- remove_task(TASK_ID)
- }
- public pfn_countdown(id)
- {
- fc4timer -=0.1
- if(fc4timer >= 10.0)
- {
- set_hudmessage(0, 255, 0, -1.0, 0.88, 0, 0.1, 0.2)
- ShowSyncHudMsg(0, Sync, "C4 %i", floatround(fc4timer))
- return PLUGIN_HANDLED
- }
- else if(5.0 <= fc4timer < 10.0)
- set_hudmessage(255, 255, 0, -1.0, 0.88, 0, 0.1, 0.2)
- else
- set_hudmessage(255, 0, 0, -1.0, 0.88, 0, 0.1, 0.2)
- ShowSyncHudMsg(0, Sync, "C4 %0.1f", fc4timer)
- if(fc4timer <= 0.0)
- remove_task(TASK_ID)
- return PLUGIN_HANDLED
- }
- public pfn_round_start()
- {
- if(task_exists(TASK_ID))
- remove_task(TASK_ID)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement