Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <csx>
- #define PLUGIN "Nuevo Plugin"
- #define VERSION "1.0"
- #define AUTHOR "Sugisaki"
- #define MAX_SOUNDS 10
- #define TASK_ID 5544132
- new iSounds[MAX_SOUNDS+1][20]
- //////////////////// Configurable /////////////
- new Folder[] = "myfolder"
- ///////////////////////////////////////
- new countdown
- new szCvar[] = "mp_c4timer"
- new HudSync
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_logevent("task_check", 2, "1=Round_End")
- register_logevent("task_check", 2, "1=Round_Start")
- HudSync = CreateHudSyncObj()
- }
- public task_check()
- {
- if(task_exists(TASK_ID)) remove_task(TASK_ID)
- }
- public plugin_precache()
- {
- for(new i = 1; i <= MAX_SOUNDS ; i++)
- {
- formatex(iSounds[i], charsmax(iSounds[]), "%s/%i.wav", Folder, i)
- precache_sound(iSounds[i])
- }
- }
- public bomb_planted()
- {
- if(task_exists(TASK_ID)) remove_task(TASK_ID)
- countdown = get_cvar_num(szCvar) - 1
- set_task(1.0, "fw_countdown", TASK_ID, _, _,"b")
- }
- public fw_countdown(id)
- {
- if(countdown)
- {
- if(countdown > 13) set_hudmessage(0, 102, 204, -1.0, 0.80, 0, 1.0, 1.0, 0.01, 0.01, -1);
- else if(countdown > 7) set_hudmessage(255, 0, 255, -1.0, 0.80, 0, 1.0, 1.0, 0.01, 0.01, -1);
- else set_hudmessage(150, 0, 0, -1.0, 0.80, 0, 1.0, 1.0, 0.01, 0.01, -1);
- ShowSyncHudMsg(0, HudSync, "|===========|^n| Tiempo de C4: %d |^n|===========|", countdown);
- if(countdown <= MAX_SOUNDS)
- {
- client_cmd(0, "spk ^"%s^"", iSounds[countdown])
- }
- }
- else
- {
- remove_task(id)
- }
- countdown--
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement