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

[CSS] Realistic Grenade (Explodes if held for too many time)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
rodipm
Member
Join Date: Feb 2011
Location: Brazil
Plugin ID:
2686
Plugin Version:
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Your HE explodes if held for too many time
    Old 11-25-2011 , 23:14   [CSS] Realistic Grenade (Explodes if held for too many time)
    Reply With Quote #1

    Descriptions:

    With this plugin I tried to simulate what happens in games like call of duty that if you hold your He grenade "unlocked" (pressing MOUSE1) for too many time it explodes in your hand killing you.

    CVars:

    - "rg_time" - Sets the time you can hold your HE unlocked before it explodes | default "rg_time 10"

    Install:

    Just put the smx file in your addons folder and load it by the command: "sm plugins load realgrenades" without quotes by rcon.

    Thats all, hope you enjoy!
    Attached Files
    File Type: sp Get Plugin or Get Source (realgrenades.sp - 1832 views - 3.4 KB)
    __________________

    Last edited by rodipm; 11-26-2011 at 19:04.
    rodipm is offline
    blue zebra
    BANNED
    Join Date: Jun 2010
    Old 11-26-2011 , 04:12   Re: [CSS] Realistic Grenade (Explodes if holded for too many time)
    Reply With Quote #2

    Good works and thanks. But this method are not realistic.
    The he not explode untill you hold press the safety pin.
    blue zebra is offline
    javalia
    Senior Member
    Join Date: May 2009
    Location: korea, republic of
    Old 11-26-2011 , 07:09   Re: [CSS] Realistic Grenade (Explodes if holded for too many time)
    Reply With Quote #3

    bluezebra is correct, he grenades like things in css r not beginning to explode until saftygrip has released. but it is still odd that we can change weapon to other while we already taken safety pin off. it should bang.
    __________________
    javalia is offline
    rodipm
    Member
    Join Date: Feb 2011
    Location: Brazil
    Old 11-26-2011 , 08:37   Re: [CSS] Realistic Grenade (Explodes if holded for too many time)
    Reply With Quote #4

    Quote:
    Originally Posted by javalia View Post
    bluezebra is correct, he grenades like things in css r not beginning to explode until saftygrip has released. but it is still odd that we can change weapon to other while we already taken safety pin off. it should bang.
    Hmm, that wright! May I do it explode if change weapon after taking the safety pin off?
    __________________
    rodipm is offline
    javalia
    Senior Member
    Join Date: May 2009
    Location: korea, republic of
    Old 11-26-2011 , 09:00   Re: [CSS] Realistic Grenade (Explodes if holded for too many time)
    Reply With Quote #5

    hm..maybe that would be more realistic.k..or u just can block weapon switch.
    __________________
    javalia is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 11-26-2011 , 11:24   Re: [CSS] Realistic Grenade (Explodes if holded for too many time)
    Reply With Quote #6

    nah... IRL you can reinsert the safety pin after you pulled it, as long as you still have it

    Last edited by TnTSCS; 11-26-2011 at 11:25.
    TnTSCS is offline
    eyes of hunter
    Member
    Join Date: Dec 2011
    Old 12-28-2011 , 04:38   Re: [CSS] Realistic Grenade (Explodes if held for too many time)
    Reply With Quote #7

    But in css you can hear the sound of the pin dropped so that should mean you got rid of it and shouldn't be able to put it back and thus you have to keep ithe grenade pressed or it explodes.

    So like others said, what would be more like irl is not being able to change weapons or being able to do so but having the grenade explode on you, don't you yhink?
    eyes of hunter is offline
    cssBOT
    Senior Member
    Join Date: Apr 2009
    Old 09-21-2012 , 14:21   Re: [CSS] Realistic Grenade (Explodes if held for too many time)
    Reply With Quote #8

    So the way this plugin appears to works essentially is it checks when you left click/pull the pin/IN_ATTACK then will kill you if your holding it for as long as rg_time.

    Is it possible to code it so the hegrenade does a true hegrenade explosion after set rg_time time you left click it? This would be a more realistic experience. It would be as if when you left click you have pulled the pin and released the safety leaver to start the fuse burning.

    I don't think this is even possible though because I don't believe there is a way to trigger the grenade to explode after a timer.
    cssBOT is offline
    aSmig
    Junior Member
    Join Date: Nov 2008
    Old 10-11-2012 , 00:09   Re: [CSS] Realistic Grenade (Explodes if held for too many time)
    Reply With Quote #9

    My server is getting around 10 million instances per day of the following error in the sourcemod logs:

    L 10/08/2012 - 00:00:00: [SM] Native "KillTimer" reported: Invalid timer handle a6c903c9 (error 1)
    L 10/08/2012 - 00:00:00: [SM] Displaying call stack trace for plugin "realgrenades.smx":
    L 10/08/2012 - 00:00:00: [SM] [0] Line 82, /home/groups/alliedmodders/forums/files/1/1/6/1/9/0/95834.attach::OnPlayerRunCmd()

    Looks like you are using KillTimer instead of CloseHandle, then testing if it is still a handle (which it is) and trying to KillTimer on the same handle again (which errors). Since you aren't using any of the extra features of KillHandle, CloseHandle should do just fine in this case and resolve this error. My 2GB/day logs would like this to be fixed.
    aSmig is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 10-11-2012 , 10:24   Re: [CSS] Realistic Grenade (Explodes if held for too many time)
    Reply With Quote #10

    KillTimer and CloseHandle with both work...

    Just have to change this:

    ORG Code


    To this:
    Modified Code


    The code:
    PHP Code:
    Timer[client] = INVALID_HANDLE
    only executes under certain exact circumstances when it should execute when the timer expires no matter what since it doesn't appear to be a repeating timer...
    __________________
    View my Plugins | Donate

    Last edited by TnTSCS; 10-11-2012 at 10:26.
    TnTSCS 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 12:24.


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