Quote:
Originally Posted by bullet28
ehh... not exactly fine heal animation continues to play and progress bar isn't disappearing
|
try this i think it works better now
PHP Code:
public Action OnTimerCheckIfInterrupted(Handle timer, any healerID) {
int healer = GetClientOfUserId(healerID);
if (healer > 0 && healingTarget[healer] != 0) {
if (isPlayerAliveSurvivor(healer)) {
int item = GetPlayerWeaponSlot(healer, 3);
int activeWeapon = GetEntPropEnt(healer, Prop_Send, "m_hActiveWeapon");
if (item != -1 && item == activeWeapon) {
char classname[32];
GetEntityClassname(item, classname, sizeof classname);
if (StrEqual(classname, "weapon_first_aid_kit")) {
//RemovePlayerItem(healer, item);
//AcceptEntityInput(item, "Kill");
//giveItem(healer, "first_aid_kit");
int target = GetEntPropEnt(healer, Prop_Send, "m_useActionTarget");
if(isPlayerAliveSurvivor(target)){
SetEntProp(target, Prop_Send, "m_iCurrentUseAction", 0);
SetEntProp(healer, Prop_Send, "m_iCurrentUseAction", 0);
SetEntPropEnt(target, Prop_Send, "m_useActionOwner", -1);
SetEntPropEnt(target, Prop_Send, "m_useActionTarget", -1);
SetEntPropEnt(healer, Prop_Send, "m_useActionTarget", -1);
SetEntPropEnt(healer, Prop_Send, "m_useActionOwner", -1);
SetEntPropFloat(target, Prop_Send, "m_flProgressBarDuration", 0.0);
SetEntPropFloat(target, Prop_Send, "m_flProgressBarStartTime", GetGameTime());
SetEntPropFloat(healer, Prop_Send, "m_flProgressBarDuration", 0.0);
SetEntPropFloat(healer, Prop_Send, "m_flProgressBarStartTime", GetGameTime());
}
SetEntPropEnt(healer, Prop_Send, "m_hActiveWeapon", -1);
}
}
}
}
}