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

[CSS/GO+~DODS/HL2DM+Any?] Grenade Delay


Post New Thread Reply   
 
Thread Tools Display Modes
Author
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Plugin ID:
3746
Plugin Version:
1.1.0
Plugin Category:
Fun Stuff
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    2 
    Plugin Description:
    Delay explosion of grenades
    Old 07-11-2013 , 21:35   [CSS/GO+~DODS/HL2DM+Any?] Grenade Delay
    Reply With Quote #1

    Grenade Delay

    v. 1.1.0

    Based on the thread : https://forums.alliedmods.net/showthread.php?t=220132

    Features :
    • Increase or reduce the delay before the grenade explosion.
    • Possibility to randomize it.
    • Note : behaviour vary on the type of grenade and the game itself. See the rest of this post for more info.

    Known bugs :
    • None.

    CVars :
    • grenadedelayversion: Gives version -_-'
    • ----------
    • grenadedelay : What is the average delay before the bomb explode ? (if grenadedelay=0, plugin is disabled; Def. 5.0)
    • grenadedelay_random : The maximum time value added or substracted to 'grenadedelay' before the grenade can explode. Will be random. 0.0 = no random, which is the default.
    • grenadedelay_string : What are the projectile (put classnames) that will have their delay changed. Separate by a space different ones. New 1.1 default : "hegrenade_projectile flashbang_projectile". See bottom of this post for more classnames.

    i.e. you have grenadedelay at 3.0 and grenadedelay_random at 5.0. A grenade explosion will take between 0.1 (hardcoded minimum) and 8.0 seconds before exploding.

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

    Changelog :
    • 1.0.0 Initial release. (11-07-2013)
    • 1.0.1 Changed grenadedelay_string's default to "hegrenade_" rather than "grenade_", so smoke can explode <.< . (12-07-2013)
    • 1.0.2 (12-07-2013)
      • Put "m_nNextThinkTick" to 1, so if the grenade cannot be exploded via damage, it still does its logic.
      • ^ ==> This means smokes can now be delayed, thought they won't explode before their normal delay (which is when they stop moving; or when they have a "certain" movement).
      • Now uses OnEntitySpawned.
    • 1.0.3 (12-07-2013)
      • Changed minimum delay between spawning time from 0.1 to 0.0.
      • ^ ==> This possible apparently because the timers are created OnEntitySpawned rather than OnEntityCreated.
    • 1.1.0 (13-07-2013)
      • Tested under CS:GO.
      • ConVar "grenadedelay_string" now works differently. Each projectile's classname must be specified (no more StrContains(); which was problematic if you wanted more than 1 projectile with really different name).
      • Since "grenadedelay_string"'s function works differently, you really should delete your config file, or be sure to change the value in the .cfg (since new default "grenadedelay_string"'s value won't be effective if you already tried my plugin)
    • No version change (13-03-2015)
      • Changed forum compiler to 1.5 and removed the .smx
      • Tested under NMRIH.

    Credits :
    • blodia (manual explosion of grenade's code)
    • thetwistedpanda (delay explosion)
    • xf117 for asking; I did ask in the past and didn't get an answer :@ ! (was on forum I think, as well as IRC)
    • rOOT¯ --> allowed indirectly to reduce delay from 0.1 to 0.0 before grenade explosion.
    • alencore : HL2DM's frag grenade's report.

    Note :
    • I mostly assembled what blodia and twisted showed.
    • Tested only under CSS/DODS (below are the different behaviours).
    • Projectiles (names and behaviour per mod):
      • For CSS
      • HEGrenade : classname is "hegrenade_projectile" can be exploded before and after their normal timing.
      • Flashbang : classname is "flashbang_projectile" can be exploded before and after their normal timing.
      • Smoke grenade : classname is "smokegrenade_projectile" can be exploded after their normal timing, thought not before (once it has stopped moving).
      • For CSGO
      • HEGrenade : Classname and behaviour identical to CSS
      • Flashbang : Classname and behaviour identical to CSS
      • Smoke grenade : Classname and behaviour identical to CSS
      • Decoy grenade : Classname "decoy_projectile"; behaviour similar to the smoke (need to be ~immobile to starts; can be delayed)
      • Incendiary grenade : see below @ Molotov
      • Molotov : classname is "molotov_projectile" : Can explode in the air (easy when jumping). If exploding when in the air, the molotov will be negated. If the delay is still not over when the projectile crashes, the molotov will explode normally.
      • Random fact : The 5 different grenades in your hand have a classname like "weapon_*" : putting that as a string will make grenades disappears and the grenade can't be thrown
      • ^==> This means that the plugin ~~"works" with CSGO, however it will also explode after a specific delay when picked up (=bought). Hot potato :/.dafuk ?
      • I could see who has the certain type of grenade, and see if the thrower mmmm
      • For DODS
      • HE Grenade* : classname is "grenade_frag_us"/"grenade_frag_ger" can be exploded before and after their normal timing.
      • Smokegrenade : classname is "grenade_smoke_us"/"grenade_smoke_ger" can be exploded after their normal timing, thought not before (once it has stopped moving).
      • *Cooldown is canceled when grenade is taken from the ground :$. This is because entity no longer exists.
      • ^==> Therefore I recommend values where you'll be sure to never take it :$. Too bad there doesn't seem to be an easy way to get the ent ID of a grenade that got taken (without doing something hackish that could possibly "transfer" a nade to someone else if 2 grenades are taken in the same frame).
      • For NMRIH
      • Frag grenade : classname is "grenade_projectile" and can be exploded before and after their normal timing.
      • Molotov : classname is "molotov_projectile" and can explode in the air. If the delay is still not over when the projectile crashes, the molotov will explode normally.
      • TNT : classname is "tnt_projectile" and can be exploded before and after their normal timing.
    Attached Files
    File Type: sp Get Plugin or Get Source (grenadedelay.sp - 2127 views - 5.0 KB)
    __________________
    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; 03-13-2015 at 20:00. Reason: 56smx; comp14->15
    RedSword is offline
    Furibaito
    Member
    Join Date: Aug 2012
    Location: Colossal Titan
    Old 07-11-2013 , 21:54   Re: [Any] Grenade Delay
    Reply With Quote #2

    Hey, nice work there

    Can you make smoke-grenade detonate in mid air with this? D:

    edit : maybe you should post the .smx ^^
    __________________
    フリー

    Currently making : ZRiot - like mod in CS:GO - - 45%

    Can do private plugins or private community maps for small money.

    Last edited by Furibaito; 07-11-2013 at 22:10.
    Furibaito is offline
    RedSword
    SourceMod Plugin Approver
    Join Date: Mar 2006
    Location: Quebec, Canada
    Old 07-12-2013 , 00:11   Re: [CSS+Any?] Grenade Delay
    Reply With Quote #3

    Hi & thanks for reporting the missing .smx :$

    I've no idea @ smoke. I didn't even try "m_nNextThinkTick" + 1 ; which might work.

    But I don't think this is to add; since I strongly believe the smoke of a smokegrenade is immobile (and it is maybe a temp ent...

    I'd have to list all entities when there is a smoke... and if so attach it). I might have time this weekend, but I do not promise anything. And if by friday I didn't release anything, you might be better forgetting it for the next 2 months :$.

    I think I'll give it a try in < 48h.

    I changed the default so smoke now explodes (normally); and I re-uploaded @ v1.0.1, as well as attached .smx (and wtf SM, including SDKHooks, but not including it in the online compiler...)

    zzz,

    Red
    __________________
    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; 07-12-2013 at 00:12.
    RedSword is offline
    Root_
    Veteran Member
    Join Date: Jan 2012
    Location: ryssland
    Old 07-12-2013 , 06:38   Re: [CSS+Any?] Grenade Delay
    Reply With Quote #4

    Cool idea!
    But why you using timer when entity created instead of SDKHooks_Spawn? Sometimes entity can be created, but not yet spawned for whatever reason, also its more flexibility I guess. (correct me if I am wrong)
    __________________


    dodsplugins.com - Plugins and Resources for Day of Defeat
    http://twitch.tv/zadroot
    Root_ is offline
    RedSword
    SourceMod Plugin Approver
    Join Date: Mar 2006
    Location: Quebec, Canada
    Old 07-12-2013 , 21:55   Re: [CSS+Any?] Grenade Delay
    Reply With Quote #5

    Quote:
    Originally Posted by Root_ View Post
    Cool idea!
    But why you using timer when entity created instead of SDKHooks_Spawn? Sometimes entity can be created, but not yet spawned for whatever reason, also its more flexibility I guess. (correct me if I am wrong)
    Since I'm using entities reference it doesn't matter ? I did change it since it is really 2 steps however.

    Updated to 1.0.2.

    Edited : it seems OnEntitySpawned is done the frame after OnEntityCreated. I noticed that because I can now allow 0.0 seconds timers. You can now easily deal 99 dmg to yourself via nading your ninja feet.

    Updated to 1.0.3

    EDIT : Tested with DODS. Works correctly (as in CSS), unless someone takes the grenade. From that point cooldown reset :$. Since there doesn't seem to be an easy way to get the new ent ID of the "transformed" entity, I probably won't push further DODS.
    __________________
    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; 07-12-2013 at 23:07.
    RedSword is offline
    RedSword
    SourceMod Plugin Approver
    Join Date: Mar 2006
    Location: Quebec, Canada
    Old 07-13-2013 , 01:54   Re: [CSS/GO+~DODS+Any?] Grenade Delay
    Reply With Quote #6

    Released 1.1.0 :
    • Tested under CS:GO.
    • ConVar "grenadedelay_string" now works differently. Each projectile's classname must be specified (no more StrContains(); which was problematic if you wanted more than 1 projectile with really different name).
    • Since "grenadedelay_string"'s function works differently, you really should delete your config file, or be sure to change the value in the .cfg (since new default "grenadedelay_string"'s value won't be effective if you already tried my plugin)

    Red
    __________________
    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
    RedSword is offline
    rinkashime14
    Junior Member
    Join Date: Sep 2013
    Old 09-22-2013 , 10:33   Re: [CSS/GO+~DODS+Any?] Grenade Delay
    Reply With Quote #7

    I dont get any errors and the smx loads succesfully and I can adjust the settings in console but when I throw a grenade it explode at the default time nothing changes
    __________________
    rinkashime14 is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 09-22-2013 , 10:36   Re: [CSS/GO+~DODS+Any?] Grenade Delay
    Reply With Quote #8

    post the output of the following rcon command:

    find grenadedelay
    __________________
    View my Plugins | Donate
    TnTSCS is offline
    RedSword
    SourceMod Plugin Approver
    Join Date: Mar 2006
    Location: Quebec, Canada
    Old 09-22-2013 , 13:01   Re: [CSS/GO+~DODS+Any?] Grenade Delay
    Reply With Quote #9

    game ? CSS, as said in PM; doesn't mean everyone would have known...
    grenade type ?
    sm version ?

    Thanks for helping people help you...
    __________________
    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-22-2013 at 13:02.
    RedSword is offline
    alencore
    Senior Member
    Join Date: Oct 2011
    Old 10-18-2013 , 01:19   Re: [CSS/GO+~DODS+Any?] Grenade Delay
    Reply With Quote #10

    Cool totally works on all class of dods with nades with this config...

    grenadedelay_string "grenade_frag_us grenade_frag_ger grenade_riflegren_us grenade_riflegren_ger"


    btw what are the grenade string or whatever for hl2dm or we're can I look for it?
    hope it also works there.

    Last edited by alencore; 10-18-2013 at 07:28.
    alencore 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 20:21.


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