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

CTakeDamageInfo for the sdkhooks and the new syntax


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xerox8521
Senior Member
Join Date: Sep 2011
Old 05-06-2017 , 14:29   CTakeDamageInfo for the sdkhooks and the new syntax
Reply With Quote #1

Hi,

so um i thought of maybe adding the CTakeDamageInfo to sourcemod (maybe as handle type ?) so the sdkhooks take damage would change to (example):

PHP Code:
public Action OnTakeDamage(CTakeDamageInfo info)
{
    
info.GetAttacker();
    
info.SetAttacker();
    
info.GetDamage();
    
info.SetDamage();
    
    
// etc
    
    // Alternative if used just as handle:
    
    
DamageInfo_GetAttacker(info);
    
DamageInfo_SetAttacker(info);
    
DamageInfo_GetDamage(info);
    
DamageInfo_SetDamage(info);

Usage in SDKHooks_TakeDamageEx
PHP Code:
CTakeDamageInfo info = new CTakeDamageInfo();

info.SetVictim(someEntity);
info.SetDamage(100.0);
info.SetDamageType(DMG_BULLET);
info.SetAttacker(someAttacker);
info.SetInflictor(attackersActiveWeapon);

// Note: Changed it to TakeDamageEx to still allow the old one to be used
SDKHooks_TakeDamageEx(info); 

Thoughts?
xerox8521 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 01:05.


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