Raised This Month: $182 Target: $400
 45% 

[CS:S+GO] Afk Bomb


Post New Thread Reply   
 
Thread Tools Display Modes
Author
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Plugin ID:
2266
Plugin Version:
1.5.0
Plugin Category:
Gameplay
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    118 
    Plugin Description:
    Drop the bomb if the player appears afk. Also possible to give to a random T since 1.4.0.
    Old 03-07-2011 , 13:10   [CS:S+GO] Afk Bomb
    Reply With Quote #1

    Afk Bomb

    v. 1.5.0

    Features :
    • Prevent short-afking from breaking a full round's gameplay :
    • Give the bomb to a random teamate if the bomber is afk at the beginning of the round. (or drop it)
    • Drop the bomb if the bomber is afk and make bomber teamsay that he's dropping the bomb. (or give to a teamate)

    How it works :
    • For the first check of the round :
    • Check the "state" of the bomber at round start (1.0 sec after it to be exact).
    • Check for a new delayed "state" after a certain amount of time to see if it is the same.
    • If over a certain amount of time the "state" of the player didn't change, then he is considered afk : the bomb is dropped/given to a teamate (depending on afkbomb_action) and a message is displayed.
    • For the other checks :
    • After the first check, the same process is repeated, but it uses the convar "afkbomb_lateCheckDelay" for the delay between two checks.
    • When the total number of checks where the player didn't change his state equals the value of the convar "afkbomb_lateCheck", then the bomb is dropped/given to a teamate (depending on afkbomb_latecheckaction).

    Known bugs/exploits :
    • The bomber can drop his bomb in an unfinite loop (rare; depends on spawn location; if it happens someone can stick him where he throws the bomb to get it, so it isn't a real problem). Since 1.3.1 this is way less frequent (throw is harder).
    • -------The following are since 1.4.0 and updated since 1.5.0-------
    • The random person can be AFK (ONLY if no players are moving since 1.5.0).
    • A player could exploit "afkbomb_latecheckaction 0" feature by fake-afking and therefore send the bomb to a random teamate elsewhere on the map. (in 1.5.0, I did split afkbomb_action into the same CVar and afkbomb_latecheckaction )

    CVars :
    • afkbombversion: Gives version -_-'
    • -------------------------
    • afkbomb : How long, in seconds, before the delayed "state" check. 0 = plugin disabled. 1+ = enabled. Default 2.
    • afkbomb_freezetime : If "mp_freezetime" value is added to the timer that will run the delayed "state" first check. Default 0 (disabled).
    • -------------------------
    • afkbomb_msg : Notify team when bomb is dropped (afkbomb_action=1) / Notify everyone when bomb is given to a random terrorist (afkbomb_action=0 ). 0 = no, 1 = yes. Default 1.
    • -------------------------
    • afkbomb_latecheck : Number of latechecks to do before dropping the bomb. 0 = disable latechecks. Default 2.
    • afkbomb_latecheckdelay : Time between 2 latechecks to drop the bomb, in seconds. Min. 1.0, Default 5.0.
    • --------since 1.4.0--------
    • afkbomb_action : What to do when someone is considered afk at the beginning of the round. 1=Drop. 0=Give to random player. Default 0.
    • --------since 1.5.0--------
    • afkbomb_latecheckaction : What to do when someone is considered afk after the beginning of the round. 1=Drop. 0=Give to random player (not recommended since it could be exploited). Default 1. (This is afkbomb_action for latechecks)

    Notes :
    • Place "afkbomb.phrases.txt" in "translations" folder.
    • To manually bomb drop and other useful bomb related commands, use Bomb Commands (has menu and a tell-me-who-threw-the-bomb-in-an-unreachable-spot thing).

    --------------

    Any suggestions/comments on the code or the plugin are welcomed and appreciated.

    Credits to :
    • dalto : for his drop bomb code (http://forums.alliedmods.net/showthread.php?p=523188)
    • AltPluzF4 : for his sig-scanning thread that made me correct dalto's drop bomb code (SDK Call with invalid parameters; http://forums.alliedmods.net/archive...p/t-78309.html)
    • AtomicStryker : For having in the past the same problem as me (wrong function signature usage via SDKCall() ) and posting for help. (http://forums.alliedmods.net/showthread.php?t=121145)
    • Dr!fter : for the second sig-function, so it can now work correctly with CSS : DM (no invalid handle). Also for his use of the SDKCall (in [CSS] Weapon Restrict plugin) with the 4th & 5th argument different than me, making the bomb drop further.
    • sinblaster : for testing & bugreporting.
    • psychonic : for reporting a memory leak and approving.
    • TnTSCS : for bringing me (07-11-2011) signature for drop-weapon function.
    • Translators :
      Spoiler

    Changelog :
    Spoiler


    Todo list :
    • Nothing at the moment. You're free to suggest things (doesn't mean I'll accept).
    Attached Files
    File Type: sp Get Plugin or Get Source (afkbomb.sp - 3628 views - 12.7 KB)
    File Type: txt afkbomb.phrases.txt (1.7 KB, 1128 views)
    __________________
    My plugins :
    Red Maze
    Afk Bomb
    RAWR (per player/rounds Awp Restrict.)
    Kill Assist
    Be Medic

    You can also Donate if you appreciate my work

    Last edited by RedSword; 09-26-2013 at 13:03. Reason: sk+cze; 709dl+1355trl
    RedSword is offline
    sinblaster
    Grim Reaper
    Join Date: Feb 2010
    Location: Australia
    Old 03-07-2011 , 15:49   Re: [CSS] Afk Bomb
    Reply With Quote #2

    very cool. Any chance you could add a penalty system where as a player could be drugged or something for being AFK or maybe switched to spec after bomb drops? or something .. I put no thought into that at all I'll get back to you
    __________________
    Happy Happy Joy Joy


    Last edited by sinblaster; 03-07-2011 at 15:52.
    sinblaster is offline
    RedSword
    SourceMod Plugin Approver
    Join Date: Mar 2006
    Location: Quebec, Canada
    Old 03-07-2011 , 18:08   Re: [CSS] Afk Bomb
    Reply With Quote #3

    Quote:
    Originally Posted by sinblaster View Post
    very cool. Any chance you could add a penalty system where as a player could be drugged or something for being AFK or maybe switched to spec after bomb drops? or something .. I put no thought into that at all I'll get back to you
    Thanks for the feedback.

    There are already 3 afk managers plugins doing that (kicking/switching to spec.) :
    Also the main point of my plugin was to avoid "short afking" (people alt-tabing for short breaks; 5-10 secs; or simply noobs that take 1 hour to buy; missing the freezetime to buy) from completly destroying a game because bomber isn't present to rush with the team (I kind'a rage in those moments "hey lets plant - oh wait - the bomb is afk !" --> "fuuuuuuu"). I didn't intend in anyway to prevent "real" afking.

    I don't see why you couldn't use my plugin with one afk manager quoted above... that would do the job IMO.

    Last edited by RedSword; 03-07-2011 at 21:38.
    RedSword is offline
    sinblaster
    Grim Reaper
    Join Date: Feb 2010
    Location: Australia
    Old 03-07-2011 , 23:27   Re: [CSS] Afk Bomb
    Reply With Quote #4

    Sure Red I could use an afk management but then the noobs wouldnt be punished for being AFK specifically for being AFK when they have the bomb ( like loosing 16000 dollars which would hurt my players ). Naughty naughty terrorists need a smack from the alcida nanny.

    Its great on its own anyhows ;)
    __________________
    Happy Happy Joy Joy

    sinblaster is offline
    RedSword
    SourceMod Plugin Approver
    Join Date: Mar 2006
    Location: Quebec, Canada
    Old 03-08-2011 , 01:05   Re: [CSS] Afk Bomb
    Reply With Quote #5

    Quote:
    Originally Posted by sinblaster View Post
    Sure Red I could use an afk management but then the noobs wouldnt be punished for being AFK specifically for being AFK when they have the bomb ( like loosing 16000 dollars which would hurt my players ). Naughty naughty terrorists need a smack from the alcida nanny.

    Its great on its own anyhows ;)
    Humm... so for you, being afk with the bomb should be punished heavily while normal afk not ? I have to disagree with your way to think...

    Also, do you own a server ?

    If so, and if you really want a heavy punishment for bombs-afk only just tell me what you want it to be (don't give my anything too complex, I prefer to use my time on public plugins and i'm still newb to SourcePawn coding) so I might (MIGHT; not will) make you a custom build.

    Last edited by RedSword; 03-08-2011 at 01:09.
    RedSword is offline
    sinblaster
    Grim Reaper
    Join Date: Feb 2010
    Location: Australia
    Old 03-08-2011 , 06:14   Re: [CSS] Afk Bomb
    Reply With Quote #6

    You could say I own a couple yeah

    Well a normal AFK isnt really hurting anyone unless theres a massacre going on and every man is needed, or a player is taking up a slot. An AFK that is AFK whilst in charge of the bomb is preventing a team win. But like I said its good enough as it is.

    I have spent over $1800 in here on custom plugs for my games in the past 16 months I am not really looking for anything else at the moment. I am overloaded. Thanks for the offer though.
    __________________
    Happy Happy Joy Joy


    Last edited by sinblaster; 03-08-2011 at 06:17.
    sinblaster is offline
    RedSword
    SourceMod Plugin Approver
    Join Date: Mar 2006
    Location: Quebec, Canada
    Old 03-10-2011 , 17:39   Re: [CSS] Afk Bomb
    Reply With Quote #7

    Updated plugin : added ConVar so the displayed message saying that the afk is dropping the bomb is optional. Default = enabled.
    RedSword is offline
    OrzecH
    New Member
    Join Date: Jun 2010
    Old 03-13-2011 , 11:42   Re: [CSS] Afk Bomb
    Reply With Quote #8

    Don't work.
    OrzecH is offline
    RedSword
    SourceMod Plugin Approver
    Join Date: Mar 2006
    Location: Quebec, Canada
    Old 03-13-2011 , 14:32   Re: [CSS] Afk Bomb
    Reply With Quote #9

    Quote:
    Originally Posted by OrzecH View Post
    Don't work.
    It's still working..... I just tested...

    Check is done at round start, not at player spawn, so at first round it may not trigger. Also you should be using steam...

    EDIT : Updated version so it check at 1.0 seconds after round start rather than 0.5... I did some extra test for you and you were somewhat right (on some spawn points for de_dust2, don't know about other maps) ;).

    Last edited by RedSword; 03-14-2011 at 02:15.
    RedSword is offline
    RedSword
    SourceMod Plugin Approver
    Join Date: Mar 2006
    Location: Quebec, Canada
    Old 03-24-2011 , 23:37   Re: [CSS] Afk Bomb
    Reply With Quote #10

    Updated (1.2.2). Corrected a bug where I was GettingClientOfInvalidUserId(). That was happening when afkbomb would leave between the two scans (could be more trouble to server with high afkbomb ConVar value).

    Thanks to people using it !
    RedSword 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 14:39.


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