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

[TF2] SetFlagCaps


Post New Thread Reply   
 
Thread Tools Display Modes
Author
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Plugin ID:
2497
Plugin Version:
1.0.1
Plugin Category:
Server Management
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    1 
    Plugin Description:
    Set the number of flag captures a team has. Plugin also provides natives that allow other plugins to get/set flag captures.
    Old 08-15-2011 , 21:28   [TF2] SetFlagCaps
    Reply With Quote #1

    [TF2] SetFlagCaps
    Version 1.0.1



    Description:
    Allows admins to get/set the number of flag captures each team has.
    Also provides natives for plugins to get/set flag captures.
    Commands:
    • sm_setflagcaps <Red/Blue> <0-127>
      • Sets the number of caps Red or Blue team has to a value from 0-127.
    • sm_getflagcaps
      • Debugging command: Prints the number of caps each team has.
        Might be handy for rcon use.

    Cvars:
    • sm_setflagcaps_version
      • Plugin version

    Install Instructions:
    1. Place SetFlagCaps.smx into your addons/sourcemod/plugins/ folder.

    Developers:
    PHP Code:
    /**
     * Sets red team's number of flag captures.
     *
     * @return        True on success, false if value is incorrect or unable to set.
     */
    native bool:SetFlagCaps_Red(numCaps);

    /**
     * Sets blue team's number of flag captures.
     *
     * @return        True on success, false if value is incorrect or unable to set.
     */
    native bool:SetFlagCaps_Blue(numCaps);

    /**
     * Gets the number of flag captures red team has.
     *
     * @return        Number of captures (int).
     */
    native GetFlagCaps_Red();

    /**
     * Gets the number of flag captures blue team has.
     *
     * @return        Number of captures (int).
     */
    native GetFlagCaps_Blue(); 


    Version History:
    • V1.0.0
      • Initial Release
    • V1.0.1
      • Minor code cleanup

    Total downloads as prior to last edit: 125

    Not writing a plugin? Then you don't need the inc file!
    Attached Files
    File Type: inc SetFlagCaps.inc (1.0 KB, 307 views)
    File Type: sp Get Plugin or Get Source (SetFlagCaps.sp - 809 views - 5.1 KB)
    __________________

    Last edited by DarthNinja; 11-03-2012 at 15:05.
    DarthNinja is offline
    meecrob
    Senior Member
    Join Date: Jan 2010
    Old 08-15-2011 , 23:41   Re: [TF2] SetFlagCaps
    Reply With Quote #2

    cool!

    why only up to 127?

    Edit:

    Also, this will not cause issues with your TF2 Ranks plugin would it?
    __________________

    Last edited by meecrob; 08-15-2011 at 23:45.
    meecrob is offline
    Tylerst
    Veteran Member
    Join Date: Oct 2010
    Old 08-16-2011 , 00:10   Re: [TF2] SetFlagCaps
    Reply With Quote #3

    Quote:
    Originally Posted by meecrob View Post
    cool!
    why only up to 127?
    m_nFlagCaptures is 8 bits(1 byte), thus the possible values are 00000000 to 11111111(signed int -128 to 127)
    Tylerst is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 08-16-2011 , 01:52   Re: [TF2] SetFlagCaps
    Reply With Quote #4

    Quote:
    Originally Posted by meecrob View Post
    Also, this will not cause issues with your TF2 Ranks plugin would it?
    This plugin does not fire the capture event, so it will have no effect on ranking plugins.
    __________________
    DarthNinja is offline
    Antithasys
    Moderator
    Join Date: Apr 2008
    Old 08-20-2011 , 02:25   Re: [TF2] SetFlagCaps
    Reply With Quote #5

    Don't get me wrong, I see the value of this. I am just wondering why it is a plugin, and not just a include file in the 'snippets' section.
    __________________
    [my plugins]

    When you think about asking a question... consider what have you tried?
    Antithasys is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 08-20-2011 , 05:33   Re: [TF2] SetFlagCaps
    Reply With Quote #6

    Quote:
    Originally Posted by Antithasys View Post
    Don't get me wrong, I see the value of this. I am just wondering why it is a plugin, and not just a include file in the 'snippets' section.
    It's intended to fit into the class of plugins like these. No particular reason other then that.

    __________________
    DarthNinja is offline
    Peace-Maker
    SourceMod Plugin Approver
    Join Date: Aug 2008
    Location: Germany
    Old 10-06-2012 , 19:00   Re: [TF2] SetFlagCaps
    Reply With Quote #7

    PHP Code:
    //Fix silly "never used" compiler warnings
        
    g_iTeamUnasOffset g_iTeamUnasOffset 0;
        
    g_iTeamSpecOffset g_iTeamSpecOffset 0
    Why do you define them at all, if you never use them?
    __________________
    Peace-Maker is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 10-07-2012 , 00:02   Re: [TF2] SetFlagCaps
    Reply With Quote #8

    This plugin started as a stock and still has some code left that I intended to use at some point.
    __________________
    DarthNinja is offline
    Reply


    Thread Tools
    Display Modes

    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 18:20.


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