Code: Select all
public drag_start(id){ if (gInfected[id] && iClass[id] == 3) { static Float:cdown cdown = get_pcvar_float(cvar_cooldown) if (!is_user_alive(id)) { client_print(id, print_chat, "You can't drag if you are dead!") return } if (g_hooksLeft[id] <= 0) { client_print(id, print_chat, "You can't drag anymore!") return } if (get_gametime() - g_lastHook[id] < cdown) { client_print(id, print_chat, "Wait %.fsec. to drag again!", get_pcvar_float(cvar_cooldown) - (get_gametime() - g_lastHook[id])) return } if (g_hooksLeft[id] > 0) { g_hooksLeft[id]-- client_print(id, print_chat, "Drags left %d %s", g_hooksLeft[id], (g_hooksLeft[id] < 2) ? "" : "s") } new hooktarget, body get_user_aiming(id, hooktarget, body) if (is_user_alive(hooktarget)) { if (get_user_team(hooktarget) != get_user_team(id)) { g_hooked[id] = hooktarget emit_sound(hooktarget, CHAN_BODY, g_sndamb, 1.0, ATTN_NORM, 0, PITCH_HIGH) } else { if (is_user_alive(hooktarget)) { if (get_pcvar_num(cvar_mates) == 0) { client_print(id, print_chat, "You can't drag teammates!") return } if (get_pcvar_num(cvar_mates) == 1) { g_hooked[id] = hooktarget emit_sound(hooktarget, CHAN_BODY, g_sndamb, 1.0, ATTN_NORM, 0, PITCH_HIGH) emit_sound(id, CHAN_VOICE, g_sndDrag, 1.0, ATTN_NORM, 0, PITCH_HIGH) } } else { g_hooked[id] = 33 noTarget(id) emit_sound(id, CHAN_BODY, g_sndMiss, 1.0, ATTN_NORM, 0, PITCH_HIGH) return } } new parm[2] parm[0] = id parm[1] = hooktarget if (!is_user_alive(id)) { set_task(0.1, "smoker_reelin", id, parm, 2, "b") } harpoon_target(id, parm) set_task(8.0,"drag_end_2",id + 850) } else { g_hooked[id] = 33 noTarget(id) emit_sound(hooktarget, CHAN_BODY, g_sndMiss, 1.0, ATTN_NORM, 0, PITCH_HIGH) remove_task(id + 850) } } }