Raised This Month: $ Target: $400
 0% 

[L4D2] Lethal Weapon (Charge Shot)


Post New Thread Reply   
 
Thread Tools Display Modes
SonJazrin
Junior Member
Join Date: Dec 2010
Old 12-12-2010 , 03:51   Re: [L4D2] Lethal Weapon (Charge Shot)
Reply With Quote #51

2 Quick questions for you:

PHP Code:
public Action:Event_Bullet_Impact(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
    if (
ReleaseLock[client])
    {
        
decl Float:TargetPosition[3];
        
        
TargetPosition[0] = GetEventFloat(event,"x");
        
TargetPosition[1] = GetEventFloat(event,"y");
        
TargetPosition[2] = GetEventFloat(event,"z");
        
        
/* Explode effect */
        
ExplodeMain(TargetPosition);
    }
    return 
Plugin_Continue;
}

public 
Action:Event_Infected_Hurt(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"attacker"));
    
    if (
ReleaseLock[client])
    {
        
decl Float:TargetPosition[3];
        new 
target GetClientAimTarget(clientfalse);
        if (
target 0)
            return 
Plugin_Continue;
        
GetEntityAbsOrigin(targetTargetPosition);
        
        
/* Explode effect */
        
EmitSoundToAll(EXPLOSIONSOUNDtarget);
        
ExplodeMain(TargetPosition);
        
        
/* Reset Lethal Weapon lock */
        
ReleaseLock[client] = 0;
    }
    return 
Plugin_Continue;

These lines denote when the trigger is pressed, it causes an explosion correct? From what I've been reading is that the fire caused from the resulting explosion acts as a generic fire (Burning rooms, cars, barrels, etc), thus when anything is burned, credit is given to the environment, not the player. Is there anyway to substitute this explosion to be an exploded Molotov thrown by the player for example? Then the player will get proper credit. Not that I mind particularly when I shoot a witch and watch her stumble around on fire, not sure which way she should attack. (Hilarious BTW)

Second is your inclusion of force:

PHP Code:
public Action:Event_Player_Hurt(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"attacker"));
    new 
target GetClientOfUserId(GetEventInt(event"userid"));
    new 
dtype GetEventInt(event"type");
    
    if (
ReleaseLock[client] && dtype != 268435464)
    {
        new 
health GetEventInt(event,"health");
        new 
damage GetConVarInt(l4d2_lw_lethaldamage);
        
        
decl Float:AttackPosition[3];
        
decl Float:TargetPosition[3];
        
GetClientAbsOrigin(clientAttackPosition);
        
GetClientAbsOrigin(targetTargetPosition);
        
        
/* Explode effect */
        
EmitSoundToAll(EXPLOSIONSOUNDtarget);
        
ExplodeMain(TargetPosition);
        
        
/* Smash target */
        
if (GetConVarInt(l4d2_lw_lethalweapon) != 2)
            
Smash(clienttargetGetConVarFloat(l4d2_lw_lethalforce), 1.52.0);
        
        
/* Deal lethal damage */
        
if ((GetClientTeam(client) != GetClientTeam(target)) || GetConVarInt(l4d2_lw_ff))
            
SetEntProp(targetProp_Data"m_iHealth"health damage);
        
        
/* Reset Lethal Weapon lock */
        
ReleaseLock[client] = 0;
    }
    return 
Plugin_Continue;

The only example I could find, which seems to be used only to effect the survivors if I'm reading this correctly. Is there anyway to apply this concept to infected? For a long time, I've been trying to search for a way to cause weapons to push back infected as if they were launched from a cannon, causing them to ragdoll upon impact with whatever surface they hit. So far I've only be able to achieve minimal success with certain SI (Hunter and Smoker), by just increasing the damage output of a weapon but all other SI, common and uncommon infected yield pretty much the normal results.
SonJazrin is offline
delirium_trigger
SourceMod Donor
Join Date: Apr 2009
Location: Washington
Old 12-12-2010 , 20:13   Re: [L4D2] Lethal Weapon (Charge Shot)
Reply With Quote #52

Quote:
Originally Posted by SonJazrin View Post
2 Quick questions for you:

PHP Code:
public Action:Event_Bullet_Impact(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
    if (
ReleaseLock[client])
    {
        
decl Float:TargetPosition[3];
        
        
TargetPosition[0] = GetEventFloat(event,"x");
        
TargetPosition[1] = GetEventFloat(event,"y");
        
TargetPosition[2] = GetEventFloat(event,"z");
        
        
/* Explode effect */
        
ExplodeMain(TargetPosition);
    }
    return 
Plugin_Continue;
}

public 
Action:Event_Infected_Hurt(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"attacker"));
    
    if (
ReleaseLock[client])
    {
        
decl Float:TargetPosition[3];
        new 
target GetClientAimTarget(clientfalse);
        if (
target 0)
            return 
Plugin_Continue;
        
GetEntityAbsOrigin(targetTargetPosition);
        
        
/* Explode effect */
        
EmitSoundToAll(EXPLOSIONSOUNDtarget);
        
ExplodeMain(TargetPosition);
        
        
/* Reset Lethal Weapon lock */
        
ReleaseLock[client] = 0;
    }
    return 
Plugin_Continue;

These lines denote when the trigger is pressed, it causes an explosion correct? From what I've been reading is that the fire caused from the resulting explosion acts as a generic fire (Burning rooms, cars, barrels, etc), thus when anything is burned, credit is given to the environment, not the player. Is there anyway to substitute this explosion to be an exploded Molotov thrown by the player for example? Then the player will get proper credit. Not that I mind particularly when I shoot a witch and watch her stumble around on fire, not sure which way she should attack. (Hilarious BTW)

Second is your inclusion of force:

PHP Code:
public Action:Event_Player_Hurt(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"attacker"));
    new 
target GetClientOfUserId(GetEventInt(event"userid"));
    new 
dtype GetEventInt(event"type");
    
    if (
ReleaseLock[client] && dtype != 268435464)
    {
        new 
health GetEventInt(event,"health");
        new 
damage GetConVarInt(l4d2_lw_lethaldamage);
        
        
decl Float:AttackPosition[3];
        
decl Float:TargetPosition[3];
        
GetClientAbsOrigin(clientAttackPosition);
        
GetClientAbsOrigin(targetTargetPosition);
        
        
/* Explode effect */
        
EmitSoundToAll(EXPLOSIONSOUNDtarget);
        
ExplodeMain(TargetPosition);
        
        
/* Smash target */
        
if (GetConVarInt(l4d2_lw_lethalweapon) != 2)
            
Smash(clienttargetGetConVarFloat(l4d2_lw_lethalforce), 1.52.0);
        
        
/* Deal lethal damage */
        
if ((GetClientTeam(client) != GetClientTeam(target)) || GetConVarInt(l4d2_lw_ff))
            
SetEntProp(targetProp_Data"m_iHealth"health damage);
        
        
/* Reset Lethal Weapon lock */
        
ReleaseLock[client] = 0;
    }
    return 
Plugin_Continue;

The only example I could find, which seems to be used only to effect the survivors if I'm reading this correctly. Is there anyway to apply this concept to infected? For a long time, I've been trying to search for a way to cause weapons to push back infected as if they were launched from a cannon, causing them to ragdoll upon impact with whatever surface they hit. So far I've only be able to achieve minimal success with certain SI (Hunter and Smoker), by just increasing the damage output of a weapon but all other SI, common and uncommon infected yield pretty much the normal results.

Have you tried using AtomicStryker's Special Ammo Rewards as a reference? It includes Dum Dum ammo in which it pushes special infected very far, especially useful against tanks. I'm sure looking at this source, you could implement it to CI.


In theory you could take this plugin, which can calculate how much percentage or fraction of ammo it takes from each shot, and calculate and add a percentage to damage it does to each infected.
For example you take the push effect form Atomic's and then code it to deal damage as much as 95% of each target, then the remaining 5% of health they have should be taken away once hitting a surface.

This is a theory, I am not a coder so I have no clue if this is 100% possible, just throwing some suggestions out there to see if you get any ideas sparked

Last edited by delirium_trigger; 12-12-2010 at 20:19.
delirium_trigger is offline
MaiSiaoSiao
Junior Member
Join Date: Nov 2010
Location: On a Blue Planet
Old 12-12-2010 , 20:19   Re: [L4D2] Lethal Weapon (Charge Shot)
Reply With Quote #53

Is there a way to set the number of time i can use this shot beside once per round?Like 3 times maybe?
__________________
Did you know that when someone pisses you off, it takes 42 muscles to frown, but only 4 muscles to extend your arm and slap that retard? So do the smart thing, and enjoy life.
MaiSiaoSiao is offline
delirium_trigger
SourceMod Donor
Join Date: Apr 2009
Location: Washington
Old 12-12-2010 , 20:25   Re: [L4D2] Lethal Weapon (Charge Shot)
Reply With Quote #54

Quote:
Originally Posted by MaiSiaoSiao View Post
Is there a way to set the number of time i can use this shot beside once per round?Like 3 times maybe?

l4d2_lw_shootonce "0"
l4d2_lw_useammo "1"


Then I increased the amount of ammo the snipers have and it basically let me shoot it 3 times until ammo runs out.
delirium_trigger is offline
SonJazrin
Junior Member
Join Date: Dec 2010
Old 12-12-2010 , 20:37   Re: [L4D2] Lethal Weapon (Charge Shot)
Reply With Quote #55

Quote:
Originally Posted by delirium_trigger View Post
Have you tried using AtomicStryker's Special Ammo Rewards as a reference? It includes Dum Dum ammo in which it pushes special infected very far, especially useful against tanks. I'm sure looking at this source, you could implement it to CI.


In theory you could take this plugin, which can calculate how much percentage or fraction of ammo it takes from each shot, and calculate and add a percentage to damage it does to each infected.
For example you take the push effect form Atomic's and then code it to deal damage as much as 95% of each target, then the remaining 5% of health they have should be taken away once hitting a surface.

This is a theory, I am not a coder so I have no clue if this is 100% possible, just throwing some suggestions out there to see if you get any ideas sparked
I've used his plugin before, but I've never thought about taking it apart and using it as a reference. I'm going to try that.
SonJazrin is offline
MaiSiaoSiao
Junior Member
Join Date: Nov 2010
Location: On a Blue Planet
Old 12-12-2010 , 21:30   Re: [L4D2] Lethal Weapon (Charge Shot)
Reply With Quote #56

Quote:
Originally Posted by delirium_trigger View Post
l4d2_lw_shootonce "0"
l4d2_lw_useammo "1"


Then I increased the amount of ammo the snipers have and it basically let me shoot it 3 times until ammo runs out.
Oh thanks alot.
Oh and btw do you have any idea to restrict this shot to me only?Or to players i allow
__________________
Did you know that when someone pisses you off, it takes 42 muscles to frown, but only 4 muscles to extend your arm and slap that retard? So do the smart thing, and enjoy life.
MaiSiaoSiao is offline
Chronic1
SourceMod Donor
Join Date: Jun 2011
Old 10-12-2011 , 05:37   Re: [L4D2] Lethal Weapon (Charge Shot)
Reply With Quote #57

I am sad to say that this plugin is crashing the No Mercy Finale. Map wont even load, just crashes the server.
__________________
Chronic1 is offline
Zbeer
SourceMod Donor
Join Date: Aug 2010
Old 10-12-2011 , 12:41   Re: [L4D2] Lethal Weapon (Charge Shot)
Reply With Quote #58

Quote:
Originally Posted by Chronic1 View Post
I am sad to say that this plugin is crashing the No Mercy Finale. Map wont even load, just crashes the server.
No problems here!
Works like a charm!
Zbeer is offline
Chronic1
SourceMod Donor
Join Date: Jun 2011
Old 10-13-2011 , 03:07   Re: [L4D2] Lethal Weapon (Charge Shot)
Reply With Quote #59

Hmm thats weird. Must be another plugin of mine that is conflicting with it. After this last update there has been a lot of crashing going on in L4D2. I have the top 20 servers from gametracker in my HLSW server list and noticed some of them are crashing often.
__________________
Chronic1 is offline
disawar1
AlliedModders Donor
Join Date: Aug 2011
Location: Russian
Old 02-11-2012 , 08:54   Re: [L4D2] Lethal Weapon (Charge Shot)
Reply With Quote #60

Lethal Weapon Fix
Read me!
Guys you know about that the plugin does not work really, because Lethal Weapon do not cause any damage to the victim, except for damage by fire.

Fix:
1. Convar "l4d2_lw_lethaldamage" fixed and work correctly!
2. Invalid client index fix.
Code:
 L 02/10/2012 - 22:02:19: SourceMod error session started
L 02/10/2012 - 22:02:19: Info (map "c5m5_bridge") (file "errors_20120210.log")
L 02/10/2012 - 22:02:19: [SM] Native "GetClientAbsOrigin" reported: Client index 0 is invalid
L 02/10/2012 - 22:02:19: [SM] Displaying call stack trace for plugin "l4d2_lethal_weapon.smx":
L 02/10/2012 - 22:02:19: [SM]   [0]  Line 285, l4d2_lethal_weapon.sp::Event_Player_Hurt()
L 02/11/2012 - 01:22:24: Error log file session closed.
Attached Files
File Type: sp Get Plugin or Get Source (fix_l4d2_lethal_weapon.sp - 2241 views - 21.5 KB)
__________________

Last edited by disawar1; 02-11-2012 at 08:55.
disawar1 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode