This mod makes bots pretty stronger than vanilla bots Can not use together with other vscripts mods such as Rectus' Custom weapons, Admin System or any other mods of mine Mod Features - Cs weapons are unlocked - Bots have 150 shield po...
VSLib Developer Guide - Damage, Update, Chat Hooks
- 11K
- 0
Sharing is temporarily disabled
Left 4 Dead 2 Guide
InterceptChat() Hooks
Sometimes, you just want plain 'ol Valve InterceptChat(). You can access this by typing the following:
// str is the original string, and srcEnt is the CBaseEntity object that spoke
function MyInterceptChat ( str, srcEnt )
{
...
}
// Add the intercept chat hook
EasyLogic.AddInterceptChat ( MyInterceptChat );
// And here's how you remove the hook if needed
EasyLogic.RemoveInterceptChat ( MyInterceptChat );
Using this approach, you can have as many InterceptChat functions as you want...
AllowTakeDamage() Hooks
Creating the Hooks
The process for damage hooking is pretty simple. Just create a function somewhere with the following template:
function EasyLogic::OnTakeDamage::YourFunctionName ( damageTable )
{
... your code AllowTakeDamage code ...
}
You can have as many as you want. Just be sure to change the function name each time.
Filtering by Classname
There's also a handy feature to filter damage notifications by classname. For example, to only receive damage notifications on players and prop_physics:
// For dynamic props
function EasyLogic::OnDamage::prop_physics ( victim, attacker, damageDone, damageTable )
{
... your code for prop_physics damage calculation ...
}
// For players
function EasyLogic::OnDamage::player ( victim, attacker, damageDone, damageTable )
{
... your code for player damage calculation ...
}
You can define as many different classnames as you want, mix and match with the previous OnTakeDamage hooks, and whatnot. Hopefully that made sense.
Update() Hooks
Same process. Just create a function somewhere with the following template:
function EasyLogic::Update::YourFunctionName ( )
{
... your Update code ...
}
You can have as many as you want. Just be sure to change the function name each time.
Be the first to post a comment!