View Single Post
nergal
Veteran Member
Join Date: Apr 2012
Old 07-15-2014 , 18:51   Re: Versus Saxton Hale 1.43 - Now with collaboration! (Last updated 7/15/2014)
Reply With Quote #22

another thing, I think rocket launchers should have no damage fall off

PHP Code:
    decl Float:Pos[3];
    
decl Float:Pos2[3];
    
GetEntPropVector(attackerProp_Send"m_vecOrigin"Pos);//Spot of attacker
    
GetEntPropVector(clientProp_Send"m_vecOrigin"Pos2); //Spot of victim
    
new Float:dist GetVectorDistance(PosPos2false); //Calculates the distance between target and attacker
    
new String:classname[64];
    if (
IsValidEdict(weapon)) GetEdictClassname(weaponclassnamesizeof(classname));
if (
strcmp(classname"tf_weapon_rocketlauncher"false) == || strncmp(classname"tf_weapon_flaregun"18false) == 0)
                {
                    if (
dist 966.03dist 966.03;
                    if (
dist 512.0dist 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;
                        }
                    } 
__________________

Last edited by nergal; 07-15-2014 at 19:01.
nergal is offline