Quote:
Originally Posted by bullet28
Tried both 0 and -1, it's crashing server every time this code executed
|
it's true i should try that before sorry :s, but now try this and it seems to work fine:
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);
}
}
}
}
}