Raised This Month: $ Target: $400
 0% 

SDK Hooks 2.1 - Updated 2011-9-10


Post New Thread Closed Thread   
 
Thread Tools Display Modes
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 06-08-2012 , 18:47   Re: SDK Hooks 2.1 - Updated 2011-9-10
#1881

Quote:
Originally Posted by TnTSCS View Post
huh? I get the "if boxenabled bool is true" part... but what do you want to stop from happening?

You want players to have god mode? Or just no damage from self or world? I don't understand the "bug the damage"
People dont getting hurt, only by players.
i need to fix it.
__________________
retired
shavit is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 06-08-2012 , 19:10   Re: SDK Hooks 2.1 - Updated 2011-9-10
#1882

So, you want to stop people from getting hurt by fall damage? Or any other damage that isn't dealt by other players, including blocking damage done by self?
__________________
View my Plugins | Donate
TnTSCS is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 06-08-2012 , 19:19   Re: SDK Hooks 2.1 - Updated 2011-9-10
#1883

Quote:
Originally Posted by TnTSCS View Post
So, you want to stop people from getting hurt by fall damage? Or any other damage that isn't dealt by other players, including blocking damage done by self?
Here is my plugin.
http://pastebin.com/WJNRSMhW
I want that the damage from world will be normal, as usual without this plugin.
And the damage will be 0.0 only from CT team killings.
__________________
retired
shavit is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 06-09-2012 , 03:40   Re: SDK Hooks 2.1 - Updated 2011-9-10
#1884

Quote:
Originally Posted by shavit View Post
Here is my plugin.
http://pastebin.com/WJNRSMhW
I want that the damage from world will be normal, as usual without this plugin.
And the damage will be 0.0 only from CT team killings.

PHP Code:
public Action:dmg(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
    if(
attacker && attacker <= MaxClients// Attacker have valid client index, not "world" or any other entity index.
    
{
        if(
IsClientInGame(attacker)) // Let's make sure player is still in game, he could throw grenade and disconnect from game.
        
{
            if(
attacker != victim && GetClientTeam(attacker) == GetClientTeam(victim)) // attacker is not victim itself and attack own team mate.
            
{
                return 
Plugin_Handled;
            }
        }
        else 
// Ok, disconnected player is attacking players, do you want block those damages ? Up to you.
        
{
            
//return Plugin_Handled;
        
}
    }
    return 
Plugin_Continue;

Bacardi is offline
TheAvengers2
BANNED
Join Date: Jul 2011
Old 06-09-2012 , 09:41   Re: SDK Hooks 2.1 - Updated 2011-9-10
#1885

Quote:
Originally Posted by psychonic View Post
Short and lazy version:
New 2.2b4 available
http://users.alliedmods.net/~psychonic/builds/sdkhooks/2.2/

New since last beta:
CS:GO support.
Fixed GroundEntChanged gamedata lookup.
Fixed one potential crash when bad or missing gamedata.
Improved error messages.

Known quirks:
For bots joining server, OnEntityCreated fires before SM thinks that the bot's client index is a valid entity. I haven't decided on the best way to fix this yet.

If no issues, I'll soon make this the official release as 2.1 is aging badly on some games.
A few days ago, I put 2.2b4 on my active servers. The CSS servers have continued to run smoothly ever since. Nice work!

Last edited by TheAvengers2; 06-09-2012 at 09:41.
TheAvengers2 is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 06-10-2012 , 06:40   Re: SDK Hooks 2.1 - Updated 2011-9-10
#1886

Same. 2.1, 2.2 always gave me crashes but 2.2.0b4 runs really good.
Visual77 is offline
Ambit
Junior Member
Join Date: May 2012
Old 06-18-2012 , 14:47   Re: SDK Hooks 2.1 - Updated 2011-9-10
#1887

Is it possible in OnTakeDamagePost to figure out the actual damage from an attack? I was under the impression that the damage value in OnTakeDamagePost was distance and crit modified already. That's the reason I am using it in addition to OnTakeDamage. However, I just checked and the value it gives me is the base damage of the attack and not the final damage.
Ambit is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 06-18-2012 , 15:16   Re: SDK Hooks 2.1 - Updated 2011-9-10
#1888

Quote:
Originally Posted by Ambit View Post
crit modified already
too hard to divide by three?
Leonardo is offline
Ambit
Junior Member
Join Date: May 2012
Old 06-18-2012 , 15:38   Re: SDK Hooks 2.1 - Updated 2011-9-10
#1889

Quote:
Originally Posted by Leonardo View Post
too hard to divide by three?
You obviously didn't read my post because the problem is that modifiers have NOT been applied yet. Yes I could just multiply by 3 to get the crit value, but that doesn't solve the other problems.

There's more to the calculation such as the random damage modifier and the distance modifiers. Plus I have no way of knowing if the crit was a full crit or a minicrit. They both fall under the damage type DMG_CRIT.

I could certainly do the entire calculation myself, but that's just wrong if it's not necessary. I'd be calculating something that's already been calculated. Plus if the formula changes or there are exceptions to it, my code would be wrong. Also, since there are random numbers involved, the number that displays to the player will probably be incorrect because I may calculate something with different numbers than what the game's damage calculation uses. It also causes an issue with random crits because there is more to determining a random crit than a random number. The function that figures out whether there should be a crit or not would be called twice which would mess up the random crit calculation.

EDIT: Solved the problem myself. Since I only need the victim, the attacker, and the final amount of damage done, hooking player_hurt works perfectly.

Last edited by Ambit; 06-19-2012 at 16:05.
Ambit is offline
adrianman
Senior Member
Join Date: Sep 2010
Old 06-20-2012 , 09:20   Re: SDK Hooks 2.1 - Updated 2011-9-10
#1890

2.2 still crashing alot for l4d2
__________________
The best thing in life's for free
adrianman is offline
Closed Thread



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 07:13.


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