AlliedModders

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

TnTSCS 08-31-2011 11:58

[CS:S] Move Bomb
 
1 Attachment(s)
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.

Bacardi 08-31-2011 12:44

Re: [CS:S] Move Bomb
 
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"); 


TnTSCS 08-31-2011 12:47

Re: [CS:S] Move Bomb
 
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

TnTSCS 08-31-2011 17:26

Re: [CS:S] Move Bomb
 
Updated to 1.1

Changed from RegConsoleCmd to RegAdminCmd and go rid of CheckCommandAccess check.

KyleS 09-01-2011 10:08

Re: [CS:S] Move Bomb
 
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? :P

TnTSCS 09-01-2011 10:30

Re: [CS:S] Move Bomb
 
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 :)

Bacardi 09-01-2011 10:36

Re: [CS:S] Move Bomb
 
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 :D

TnTSCS 09-01-2011 11:00

Re: [CS:S] Move Bomb
 
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 :)

Bacardi 09-01-2011 11:14

Re: [CS:S] Move Bomb
 
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


All times are GMT -4. The time now is 18:34.

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