AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [CS:S+GO] Afk Bomb (https://forums.alliedmods.net/showthread.php?t=152329)

RedSword 03-07-2011 13:10

[CS:S+GO] Afk Bomb
 
2 Attachment(s)
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).

sinblaster 03-07-2011 15:49

Re: [CSS] Afk Bomb
 
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 :P

RedSword 03-07-2011 18:08

Re: [CSS] Afk Bomb
 
Quote:

Originally Posted by sinblaster (Post 1429459)
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 :P

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.

sinblaster 03-07-2011 23:27

Re: [CSS] Afk Bomb
 
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 :P ). Naughty naughty terrorists need a smack from the alcida nanny.

Its great on its own anyhows ;)

RedSword 03-08-2011 01:05

Re: [CSS] Afk Bomb
 
Quote:

Originally Posted by sinblaster (Post 1429601)
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 :P ). 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.

sinblaster 03-08-2011 06:14

Re: [CSS] Afk Bomb
 
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.

RedSword 03-10-2011 17:39

Re: [CSS] Afk Bomb
 
Updated plugin : added ConVar so the displayed message saying that the afk is dropping the bomb is optional. Default = enabled.

OrzecH 03-13-2011 11:42

Re: [CSS] Afk Bomb
 
Don't work.

RedSword 03-13-2011 14:32

Re: [CSS] Afk Bomb
 
Quote:

Originally Posted by OrzecH (Post 1432633)
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) ;).

RedSword 03-24-2011 23:37

Re: [CSS] Afk Bomb
 
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 !


All times are GMT -4. The time now is 19:14.

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