Monthly Target: $400 Donations: $126
 31% 

[CS:S] Move Bomb


Post New Thread Reply   
 
Thread Tools Display Modes
Author
TnTSCS
SourceMod Donor
Join Date: Oct 2010
Location: Undisclosed...
Plugin ID:
2532
Plugin Version:
1.2
Plugin Category:
Fun Stuff
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
    6 
    Plugin Description:
    Allows the planted bomb to be moved
    Old 08-31-2011 , 12:58   [CS:S] Move Bomb
    Reply With Quote #1

    DESCRIPTION:
    This plugin will move the planted bomb to your players feet (or the feet of the player you're spectating), or, if you're in free camera mode, it will put the bomb at eye level

    This plugin is designed to be for fun. For when chicken CTs don't try to defuse, admins can "move" the bomb so that it will explode near the fleeing CT. The planter of the bomb still gets the points if it explodes.

    It is defaulted to allow admins with CHEAT flag persmission to use this command. You can customize access to this command using the admin_overrides.cfg and adding whatever flag you want to the "sm_movebomb", example:

    "sm_movebomb" "o"

    That would set the permission for this command to be the CUSTOM1 flag

    CVARS:
    sm_movebomb from in-game consle (or /movebomb and !movebomb from chat, assuming you have "!" set as your PublicChatTrigger in core.cfg)
    - You cannot use this from out-of-game console (such as HLSW)

    CREDITS:
    xaider for code samples from Advanced Commands
    - regarding vectors

    Bacardi for previous plugin help with the NoBombDamage
    - regarding OnEntityCreated and OnEntityDestroyed
    - and for help with optimizing this plugin (I still have a lot to learn)

    Changelog
    Version 1.0
    - Initial public release

    Version 1.1
    - Changed from RegConsoleCmd to RegAdminCmd and removed CheckCommandAccess

    Version 1.2
    - Removed unneeded SDKHooks and OnConfigsExecuted per Bacardi's suggestions
    - Removed SDKHooks and used HookEvent instead
    - Removed unneeded check if planted_c4 != -1 (thanks KyleS)

    INSTALLATION:
    Put the MoveBomb.smx in your cstrike/addons/sourcemod/plugins folder and either load the plugin manually, change the map, or restart the server.

    Admins with the "z" flag will always have access to this command (sm_movebomb) regardless of what you set it to in admin_overrides.cfg file.
    Attached Files
    File Type: sp Get Plugin or Get Source (MoveBomb.sp - 602 views - 3.1 KB)

    Last edited by TnTSCS; 09-01-2011 at 11:35. Reason: Update from 1.1 to 1.2
    TnTSCS is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: Battlefield 1 fields
    Old 08-31-2011 , 13:44   Re: [CS:S] Move Bomb
    Reply With Quote #2

    HAhaha.
    By the way, you could change RegConsoleCmd to RegAdminCmd
    and forget CheckCommandAccess
    Then you can override in SM using "sm_command" same way

    PHP Code:
    RegAdminCmd("sm_movebomb"MoveBombADMFLAG_CHEATS"Moves the planted bomb"); 
    __________________

    Last edited by Bacardi; 08-31-2011 at 13:46. Reason: more
    Bacardi is offline
    TnTSCS
    SourceMod Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 08-31-2011 , 13:47   Re: [CS:S] Move Bomb
    Reply With Quote #3

    That's true... Less checks too... I'll update it in a couple of hours. In a meeting now

    What's funny is I had it that way first, then switched it

    Last edited by TnTSCS; 08-31-2011 at 13:51.
    TnTSCS is offline
    TnTSCS
    SourceMod Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 08-31-2011 , 18:26   Re: [CS:S] Move Bomb
    Reply With Quote #4

    Updated to 1.1

    Changed from RegConsoleCmd to RegAdminCmd and go rid of CheckCommandAccess check.
    TnTSCS is offline
    KyleS
    SourceMod Plugin Approver
    Join Date: Jul 2009
    Location: Segmentation Fault.
    Old 09-01-2011 , 11:08   Re: [CS:S] Move Bomb
    Reply With Quote #5

    Nice plugin!

    On line 94 you're checking if planted_ct is equal to -1, then if it is (since this is your safety value), you're dropping out (This is good). Then on line 100 you're checking that planted_ct is not equal to -1 in the same function. Since it's inherited that it will pass from the above check, why have the second check?
    KyleS is offline
    TnTSCS
    SourceMod Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 09-01-2011 , 11:30   Re: [CS:S] Move Bomb
    Reply With Quote #6

    Updated to version 1.2... took suggestions form Bacardi and KyleS to make this a better plugin with cleaner, more effecient code.

    Thanks to both of you
    TnTSCS is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: Battlefield 1 fields
    Old 09-01-2011 , 11:36   Re: [CS:S] Move Bomb
    Reply With Quote #7

    Ok @TnTSCS
    There is one thing to do also and do it yourself.
    About spectators+dead people


    *edit
    unless you want plugin work taht way, then ignore this
    __________________
    Bacardi is offline
    TnTSCS
    SourceMod Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 09-01-2011 , 12:00   Re: [CS:S] Move Bomb
    Reply With Quote #8

    I'm not sure what you mean by fixing it for spectators and dead players...

    the command, sm_movebomb will move the bomb around on the map... even if the admin performing the command is dead or a spectator If they are dead and spectating another player, it will place the bomb at the feet of the player they are spectating. If they are in free camera mode then the bomb will be placed at the top of where the head were to be if they were a player.

    This was by design - the admin doens't have to be alive to be able to move the bomb... and since I'm not using @aim for the teleport location, moving the bomb as an admin when I'm alive would only put the bomb at my feet and blow me up

    is that what you meant?

    But yes, if I wanted to restrict it to be used by admins who were alive, it would be

    PHP Code:
    if(IsClientInGame(client) && IsPlayerAlive(client))
    {
         
    //perform code stuff here...

    right
    TnTSCS is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: Battlefield 1 fields
    Old 09-01-2011 , 12:14   Re: [CS:S] Move Bomb
    Reply With Quote #9

    More like this, player should already in game when execute command.
    PHP Code:
    if(IsPlayerAlive(client))
    {
        
    // Do stuff

    But not need change, let plugin work that way
    __________________

    Last edited by Bacardi; 09-01-2011 at 12:16. Reason: maybe not need look teams
    Bacardi 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 04:30.


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