This commit is contained in:
Jackzie 2022-01-19 14:52:52 -06:00
parent 755c2f24f9
commit 3c88c010ad
No known key found for this signature in database
GPG key ID: 1E834FE36520537A
17 changed files with 503 additions and 232 deletions

View file

@ -107,4 +107,33 @@ public Action Timer_InstaFailed(Handle h) {
gInstaSpecialType = -1;
gInstaSpecialTarget = 0;
}
}
public Action Timer_ShootReverse(Handle h, DataPack pack) {
pack.Reset();
int attacker = pack.ReadCell();
int target = pack.ReadCell();
int weapon = pack.ReadCell();
int ammo = pack.ReadCell();
if(!IsClientConnected(target) || !IsClientConnected(attacker) || attacker > MaxClients || target > MaxClients) return Plugin_Stop;
static float targetPos[3], botAngles[3], botPosition[3];
GetClientAbsOrigin(attacker, targetPos);
GetClientAbsAngles(attacker, botAngles);
GetClientAbsOrigin(attacker, botPosition);
botAngles[1] = RadToDeg(ArcTangent2( botPosition[1] - targetPos[1], botPosition[0] - targetPos[0])) + 180.0;
TeleportEntity(attacker, NULL_VECTOR, botAngles, NULL_VECTOR);
shootAtTargetLoops[attacker]--;
if(IsValidEntity(weapon))
SetEntProp(weapon, Prop_Send, "m_iClip1", ammo);
if(shootAtTargetLoops[attacker] > 0 && GetClientRealHealth(target) > shootAtTargetHP[target]) {
return Plugin_Continue;
} else {
shootAtTargetLoops[attacker] = 0;
shootAtTarget[attacker] = 0;
shootAtTargetHP[target] = 0;
return Plugin_Stop;
}
}