another thing, I think rocket launchers should have no damage fall off
PHP Code:
decl Float:Pos[3];
decl Float:Pos2[3];
GetEntPropVector(attacker, Prop_Send, "m_vecOrigin", Pos);//Spot of attacker
GetEntPropVector(client, Prop_Send, "m_vecOrigin", Pos2); //Spot of victim
new Float:dist = GetVectorDistance(Pos, Pos2, false); //Calculates the distance between target and attacker
new String:classname[64];
if (IsValidEdict(weapon)) GetEdictClassname(weapon, classname, sizeof(classname));
if (strcmp(classname, "tf_weapon_rocketlauncher", false) == 0 || strncmp(classname, "tf_weapon_flaregun", 18, false) == 0)
{
if (dist > 966.03) dist = 966.03;
if (dist < 512.0) dist = 512.0;
damage *= dist/512.0;
return Plugin_Changed;
}
Also, code for Market Gardener should be included as well.
PHP Code:
HookEvent("rocket_jump", OnRocketJump);
HookEvent("rocket_jump_landed", OnJumpLanded);
public Action:OnRocketJump(Handle:event, const String:name[], bool:dontBroadcast)
{
if (!Enabled) return Plugin_Continue;
new client = GetClientOfUserId(GetEventInt(event, "userid"));
g_bInJump[client] = true;
return Plugin_Continue;
}
public Action:OnJumpLanded(Handle:event, const String:name[], bool:dontBroadcast)
{
if (!Enabled) return Plugin_Continue;
new client = GetClientOfUserId(GetEventInt(event, "userid"));
g_bInJump[client] = false;
return Plugin_Continue;
}
case 416: //market gardener
{
if (!(GetEntityFlags(attacker) & FL_ONGROUND) && g_bInJump[attacker])
{
new Float:changedamage = HaleHealthMax * 0.025;
Damage[attacker] += RoundFloat(changedamage);
damage = changedamage;
HaleHealth -= RoundFloat(changedamage);
HaleRage += RoundFloat(changedamage);
HaleRage = (HaleRage > RageDMG) ? RageDMG : HaleRage;
return Plugin_Changed;
}
}
__________________