Raised This Month: $12 Target: $400
 3% 

SDK Hooks 2.1 - Updated 2011-9-10


Post New Thread Closed Thread   
 
Thread Tools Display Modes
psychonic

BAFFLED
Join Date: May 2008
Old 01-02-2010 , 14:28   Re: [EXTENSION] SDK Hooks 1.2 (Updated 12/13/09)
#271

Quote:
Originally Posted by =MaTi= View Post
Hmmm changing damage in tf2 doesn't seem to work... It works with flamethrower, but with any other weapon, it says that weapon used was "player". So instead of returning weapon edict, "infilctor" returns client id.
This has been mentioned multiple times already, but inflictor is not weapon, atleast not always.

In tf2, for hitscan weapons, inflictor is attacker (then you can get the attacker's weapon). For some projectiles, inflictor is the projectile (pipe, nade, rocket, maybe flare and arrow, can't remember. you can get the projectile's owner). For the needleguns, inflictor is the actual weapon entity.
psychonic is offline
=MaTi=
Member
Join Date: Jan 2008
Old 01-02-2010 , 15:31   Re: [EXTENSION] SDK Hooks 1.2 (Updated 12/13/09)
#272

Quote:
Originally Posted by psychonic View Post
This has been mentioned multiple times already, but inflictor is not weapon, atleast not always.

In tf2, for hitscan weapons, inflictor is attacker (then you can get the attacker's weapon). For some projectiles, inflictor is the projectile (pipe, nade, rocket, maybe flare and arrow, can't remember. you can get the projectile's owner). For the needleguns, inflictor is the actual weapon entity.
The problem is, I won't be able to modify the damage that way.
=MaTi= is offline
G@ngst@r
Member
Join Date: Dec 2009
Old 01-04-2010 , 07:49   Re: [EXTENSION] SDK Hooks 1.2 (Updated 12/13/09)
#273

Awesome, bravo. I have been looking for +attack hook, but I havent found anything, expect this =). Thx for this.

Last edited by G@ngst@r; 01-04-2010 at 07:52.
G@ngst@r is offline
G@ngst@r
Member
Join Date: Dec 2009
Old 01-04-2010 , 12:12   Re: [EXTENSION] SDK Hooks
#274

Quote:
Originally Posted by DJ Tsunami View Post
Examples
Blocking secondary attack:
Code:
public OnClientPutInServer(client)
{
    SDKHook(client, SDKHook_PreThink, OnPreThink);
}

public OnPreThink(client)
{
    new iButtons = GetClientButtons(client);
    if(iButtons & IN_ATTACK2)
    {
        iButtons &= ~IN_ATTACK2;
        SetEntProp(client, Prop_Data, "m_nButtons", iButtons);
    }
}
This thing doesnt work O_o How can i block client's attack, as well.
G@ngst@r is offline
Dragonshadow
BANNED
Join Date: Jun 2008
Old 01-04-2010 , 16:32   Re: [EXTENSION] SDK Hooks
#275

Quote:
Originally Posted by G@ngst@r View Post
This thing doesnt work O_o How can i block client's attack, as well.
PHP Code:
public OnClientPutInServer(client)
{
    
SDKHook(clientSDKHook_PreThinkOnPreThink);
}

public 
OnPreThink(client)
{
    new 
iButtons GetClientButtons(client);
    if(
iButtons IN_ATTACK2 || iButtons IN_ATTACK)
    {
        
iButtons &= ~IN_ATTACK;
        
iButtons &= ~IN_ATTACK2;
        
SetEntProp(clientProp_Data"m_nButtons"iButtons);
    }

Dragonshadow is offline
ShootTheCharger
Junior Member
Join Date: Jan 2010
Old 01-04-2010 , 18:05   Re: [EXTENSION] SDK Hooks 1.2 (Updated 12/13/09)
#276

Does this work with L4D2 ?
ShootTheCharger is offline
psychonic

BAFFLED
Join Date: May 2008
Old 01-04-2010 , 20:07   Re: [EXTENSION] SDK Hooks 1.2 (Updated 12/13/09)
#277

Quote:
Originally Posted by ShootTheCharger View Post
Does this work with L4D2 ?
Some of the hooks do.
psychonic is offline
Diavu
Junior Member
Join Date: Dec 2007
Old 01-05-2010 , 03:55   Re: [EXTENSION] SDK Hooks 1.2 (Updated 12/13/09)
#278

blargh.
i got it working.

Last edited by Diavu; 01-05-2010 at 16:59.
Diavu is offline
G@ngst@r
Member
Join Date: Dec 2009
Old 01-05-2010 , 04:50   Re: [EXTENSION] SDK Hooks 1.2 (Updated 12/13/09)
#279

Heh... attack is hooked but still isnt blocked O_o Whats wrong?
G@ngst@r is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 01-05-2010 , 05:28   Re: [EXTENSION] SDK Hooks 1.2 (Updated 12/13/09)
#280

Why do you guys need extension for this? You can modify client's buttons in SM 1.3 with OnPlayerRunCmd.
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
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 20:12.


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