Raised This Month: $ Target: $400
 0% 

[TF2] FriendlyFire Manager


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Afronanny
Veteran Member
Join Date: Aug 2009
Plugin ID:
1481
Plugin Version:
0.1.2
Plugin Category:
Admin Commands
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    A simple command to toggle Friendly Fire on players
    Unapprover:
    Reason for Unapproving:
    Not functional
    Old 02-19-2010 , 16:04   [TF2] FriendlyFire Manager
    Reply With Quote #1

    FriendlyFire Manager

    Toggle friendly fire on a player.



    I wrote this for TF2, but I see no reason why it shouldn't support the other games supported by SDKHooks. I'm releasing it as is for now. I will add Admin topmenu integration sometime in the near future



    CONVARS:



    sm_friendlyfire_enabledforall (def. 0) - Works like the normal mp_friendlyfire without this plugin. mp_friendlyfire must be 1



    mp_friendlyfire enables and disables the plugin. mp_friendlyfire is set to 1 upon plugin load, and back to 0 on plugin unload.



    COMMAND:



    sm_toggleff playername


    Toggles friendly fire on a player



    You need to download the .smx file as the web compiler does not have the SDKHooks include file.



    CHANGELOG:



    Code:
     
    0.1.2 - Placed hook in OnClientPutInServer so no extra hooks.
    0.1.1 - Fixed a lot of messy code (3/29)
    0.1 - Initial Release (2/19)
    Attached Files
    File Type: sp Get Plugin or Get Source (ffmanager.sp - 764 views - 2.5 KB)
    File Type: smx ffmanager.smx (3.5 KB, 950 views)

    Last edited by Afronanny; 05-27-2010 at 21:26.
    Afronanny is offline
    noodleboy347
    AlliedModders Donor
    Join Date: Mar 2009
    Old 02-19-2010 , 17:53   Re: [TF2] FriendlyFire Manager
    Reply With Quote #2

    Needs moar admin-friendly-fire.
    noodleboy347 is offline
    Afronanny
    Veteran Member
    Join Date: Aug 2009
    Old 03-29-2010 , 11:50   Re: [TF2] FriendlyFire Manager
    Reply With Quote #3

    Version 0.1.1 - Fixed a lot of messy code and the command callback now returns Plugin_Handled.
    Afronanny is offline
    DrWagstaff
    SourceMod Donor
    Join Date: Apr 2010
    Location: Livermore
    Old 05-17-2010 , 02:56   Re: [TF2] FriendlyFire Manager
    Reply With Quote #4

    Does this make it so engineer stuff works against your own team too? I've been wanting something that makes turrets also attack everyone for round end mayhem (arena). I would really like this feature if it doesn't already have it .
    DrWagstaff is offline
    Send a message via AIM to DrWagstaff
    psychonic

    BAFFLED
    Join Date: May 2008
    Old 05-27-2010 , 09:02   Re: [TF2] FriendlyFire Manager
    Reply With Quote #5

    @Afronanny

    If I remember correctly, at least in TF2, player_spawn can/will fire more than player_death. This will lead to extra hooks on clients in your current code.

    You are probably just better off hooking all clients as they are created (in OnClientPutInServer). This also means you don't have to deal with any manual unhooking (happens automatically on disconnect). Bonus points for then looping through and hooking all clients already in game during late load.
    psychonic is offline
    Afronanny
    Veteran Member
    Join Date: Aug 2009
    Old 05-27-2010 , 13:32   Re: [TF2] FriendlyFire Manager
    Reply With Quote #6

    Quote:
    Originally Posted by psychonic View Post
    @Afronanny

    If I remember correctly, at least in TF2, player_spawn can/will fire more than player_death. This will lead to extra hooks on clients in your current code.

    You are probably just better off hooking all clients as they are created (in OnClientPutInServer). This also means you don't have to deal with any manual unhooking (happens automatically on disconnect). Bonus points for then looping through and hooking all clients already in game during late load.

    Okay. Updated the source: got rid of event hooks, SDKHook is now in OnClientPutInServer

    Will upload a compiled binary when I get access to a compiler.

    EDIT: Just uploaded a compiled binary.

    Last edited by Afronanny; 05-27-2010 at 21:26.
    Afronanny is offline
    xomp
    BANNED
    Join Date: Jul 2008
    Old 03-19-2011 , 11:11   Re: [TF2] FriendlyFire Manager
    Reply With Quote #7

    Just tested and doesn't seem to target friendlyfire on individuals as it states. It simply turned FF on for everyone when enabled, and disabled with I used the /sm_toggleff player command.
    xomp is offline
    Send a message via Skype™ to xomp
    DJ Tsunami
    DJ Post Spammer
    Join Date: Feb 2008
    Location: The Netherlands
    Old 03-19-2011 , 12:02   Re: [TF2] FriendlyFire Manager
    Reply With Quote #8

    It's returning Plugin_Handled instead of Plugin_Changed in OnTakeDamage, so it always blocks friendly fire.
    __________________
    Advertisements | REST in Pawn - HTTP client for JSON REST APIs
    Please do not PM me with questions. Post in the plugin thread.
    DJ Tsunami is offline
    xomp
    BANNED
    Join Date: Jul 2008
    Old 03-19-2011 , 12:25   Re: [TF2] FriendlyFire Manager
    Reply With Quote #9

    Changed line 86 from return Plugin_Handled; to return Plugin_Changed; and recompiled/changed map. Same problem Blood splatters fine but no damage is being dealt to friendlies.
    xomp is offline
    Send a message via Skype™ to xomp
    xomp
    BANNED
    Join Date: Jul 2008
    Old 03-19-2011 , 13:49   Re: [TF2] FriendlyFire Manager
    Reply With Quote #10

    Thanks to databomb on IRC here's a working version of this plugin.

    (requires SDKHooks to compile)
    Attached Files
    File Type: sp Get Plugin or Get Source (ffmanager.sp - 1190 views - 2.6 KB)
    xomp is offline
    Send a message via Skype™ to xomp
    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 14:12.


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