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

[TF2] Cloak API


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Zabaniya
Junior Member
Join Date: Oct 2020
Location: Fyrestone
Plugin ID:
7804
Plugin Version:
1.0.0
Plugin Category:
Technical/Development
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    This is an API that provides hooks for developers to use to detect and/or change the behaviours of watches.
    Old 09-25-2021 , 16:12   [TF2] Cloak API
    Reply With Quote #1

    Cloak API

    Have you ever wanted to mess with watches, whether for a new custom effect or just detect it? You've come to the right place.

    This is an API that provides hooks for developers to use to detect and/or change the behaviours of watches.

    It has an SDKHook-like system and it automatically unhooks when a player disconnects, so you won't have to.

    Three Main Hooks

    - OnActivateInvisibilityWatch: Based on
    Code:
    CTFWeaponInvis::ActivateInvisibilityWatch()
    It gets called whenever a player activates or deactivates the watch.

    - OnCleanupInvisibilityWatch: Based on
    Code:
    CTFWeaponInvis::CleanupInvisibilityWatch()
    This function gets called when the player has changed loadouts or has done something else that causes it to clean up any side effects of the watch. It doesn't get called when a player dies for some reason, so I decided to make it call the forward myself. You've got an argument that tells you whether or not it was called because the player died, in case you don't want that behaviour.

    - OnUpdateCloakMeter: Based on
    Code:
    CTFPlayerShared::UpdateCloakMeter()
    It gets called every tick to manage the player's cloak drain & regen.

    Examples

    Here is an example of a plugin that utilizes the API.

    https://github.com/tsuza/attr_speed_bonus_during_cloak


    Download

    Github Repository

    Last edited by Zabaniya; 02-04-2024 at 17:42.
    Zabaniya 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 12:52.


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