AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   TFC Quad,Invul,Invis Powerups (https://forums.alliedmods.net/showthread.php?t=45084)

jRaven 09-22-2006 00:16

TFC Quad,Invul,Invis Powerups
 
2 Attachment(s)
/**
|** Description:
|** Team Fortress Classic has quad damage, invisibility to
|** sentry guns, and godmode all as powerups you can get from
|** map entities. This plugin makes them available on command.
|** You can give any number of seconds, or a default of ~27 hours
|** worth of any powerup. You can also expire anyone's powerup(s).
|**
|** Background:
|** I had no commands on my server to give more than the what
|** NeoTF allowed (maximum of 30 seconds) worth of these powerups.
|** That wasn't good enough. I want to give more as needed.
|** Especially on skill/fun maps. This plugin makes that happen.
|**
|** Internally:
|** This creates an info_tfgoal entity with appropriate keyvals
|** at a player's location so they can get the affects,
|** spawning the entity, thinking it, forcing the target to
|** fake-touch it, and then flagging it to be killed/removed.
|**
|** VERY Special Thanks To: "XxAvalanchexX" ( See am44768 )
|**
|** Idea: Control fun powerups that last the player's lifetime!
|**
|** Usage(s):
|** amx_quad <name or #userid> [seconds] - give quad damage for seconds else lifelong
|** amx_invul <name or #userid> [seconds] - give invulnerability for seconds else lifelong
|** amx_invis <name or #userid> [seconds] - give SG invisibility for seconds else lifelong
|** amx_powerups <name or #userid> [seconds] - give quad,invis,invul for seconds else lifelong
|** ---removal commands--- (add "rem" after "amx_")
|** ---NOTE: These are exactly the same as giving a powerup for only 1 second!
|** amx_remquad <name or #userid> - remove a player's quad damage
|** amx_reminvul <name or #userid> - remove a player's invulnerability
|** amx_reminvis <name or #userid> - remove a player's SG invisibility
|** amx_rempowerups <name or #userid> - remove a player's quad,invis,invul
|**
|** Module Required: "engine" for entity manipulation stuff.
|**
|** Changelog:
|** 2007-01-01 @ v1.4 - precache sounds used by NeoTF.
|** ...see issue at http://forums.planetneotf.net/phpBB2/viewtopic.php?t=98
|** 2006-12-22 @ v1.3 - fixed typo where remove commands failed
|** 2006-12-05 @ v1.2 - cleaned code again. Thanks Hawk.
|** 2006-11-25 @ v1.1 - sizeof directives added for safety
|** 2006-11-25 @ v1.0 - added optional number of seconds, as Ramono suggested.
|** also cleaned up code, simplifying some things.
|** 2006-09-27 @ v0.91 - added "amx_rem*" commands to remove powerups.
|** Thank you to SpannerSpammer of NeoTF!
|** 2006-09-22 @ v0.9 - fixed typo in print_chat announce
|** 2006-09-22 @ v0.8 - major simplification of code via an enum, conditionals
|** 2006-09-22 @ v0.7 - fixes, optimizations, etc.
|** 2006-09-21 @ v0.6 - days of work pay off! the beast is alive!
*\*
**\
**/

GHW_Chronic 09-22-2006 01:31

Re: TFC Quad,Invul,Invis Powerups
 
Code:
    new target = cmd_target(id,arg,1)     if ( ! target || ! is_user_alive(target) ) {         return PLUGIN_HANDLED     } //if.!target
should be
Code:
    new target = cmd_target(id,arg,7)     if ( ! target ) {         return PLUGIN_HANDLED     } //if.!target
http://www.amxmodx.org/funcwiki.php?...rget&go=search


Edit:
you never told the admin if he sucessfully gave someone whatever he was trying to give them.

You could also combine all 3 commands into 1 function rather easily, and more efficiently.

Lt Llama 09-22-2006 01:47

Re: TFC Quad,Invul,Invis Powerups
 
Rocks jRaven! Now we dont have to use entmod which so many people nag on me to use to add quad. Tested and works without any issues from my side.
This have been requested by a lot of players on my server.

Just 2 requests, one easy and one hard :).

1. Make a command to turn the powers off. This can create quite some lag when all possible classes try to use quad on skills maps.

2. I know its maybe not in the scope of your plugin but it would be a cool function if an admin can also choose a certain class for a player, a class which doesnt exist in the map default. This would make many many of our skillsmaps possible to play for more classes. Possible to override the map's info_tf_detect and info_player_teamspawn?

+Karma for making another useful tfc plugin

/Lt.

GHW_Chronic 09-22-2006 01:53

Re: TFC Quad,Invul,Invis Powerups
 
I don't understand how your #1 would cause lag
ur #2 would be a different plugin if im understanding u correctly.

Lt Llama 09-22-2006 02:11

Re: TFC Quad,Invul,Invis Powerups
 
Quote:

Originally Posted by GHW_Chronic (Post 383682)
I don't understand how your #1 would cause lag
ur #2 would be a different plugin if im understanding u correctly.

#1 A couple of people asks for quad to do map as Demoman. Some guys starts spamming MIRV grenades. Server starts lagging. You turn off quad to make them stop. Well, can be solved in other ways to, but there could be other reasons for wanting to turn it off.

#2 As I said, its really a differant thing to add to this plugin. But for a skills server it would be the two most wanted addons: quad and more player classes. Some maps have restricted the possible player classes, even though it would be possible to play the map if you had Soldier for example. But there is no point in adding soldier class if you dont have quad.

The best example is concmap_exist. Someone made a concmap_exist_rjhax version just with added quad and soldier class to it. Its a classic map by now, and when it had been done as concer it was natural to wanna try it as soldier.

I can make a plugin request, jRaven, if you also thinks this belongs in a separate plugin.

jRaven, can i bribe you with some more Karma?

/Lt.

jRaven 09-22-2006 09:33

Re: TFC Quad,Invul,Invis Powerups
 
Quote:

Originally Posted by Lt Llama (Post 383677)
1. Make a command to turn the powers off. This can create quite some lag when all possible classes try to use quad on skills maps.

2. I know its maybe not in the scope of your plugin but it would be a cool function if an admin can also choose a certain class for a player, a class which doesnt exist in the map default. This would make many many of our skillsmaps possible to play for more classes. Possible to override the map's info_tf_detect and info_player_teamspawn?

Lt. Llama:
#1: I tried earlier in developing this to disable quad with map entities with value of zero or negative values. It didn't work. So if you want to take it away, you'll have to slay them.

#2: It would be easy to find the info_tfdetect and change it's maxammo_ class limiting keyvals. I'll put that in a different plugin for two reasons both being organization related. There are some alternatives for this by the way... NeoTF lets you "neotf_change_class player classNum" and instantly their class is changed, skin reflects it, but weapons require a respawn. I know this isn't what you were asking for but it came to mind. Another way to do this is with ripent, where you can mod entities on the server's bsp of the map. That too is sort of ugly. I'll make a plugin to interact with the info_tfdetect. I hope TFC will chew on the changes after map has loaded. We'll find out...

Also, GHW_Chronic, I'll get some code changes done in awhile. I'd like to get things totally worked out before this one is approved.

jRaven 09-22-2006 09:36

Re: TFC Quad,Invul,Invis Powerups
 
Re: Your #1 again: if people are idiots, freeze them! :D Hooray ice!

Lt Llama 09-22-2006 09:57

Re: TFC Quad,Invul,Invis Powerups
 
Quote:

Originally Posted by jRaven (Post 383739)
Re: Your #1 again: if people are idiots, freeze them! :D Hooray ice!

Hmm, freeze :). Ill give it a try. But what happens if i use amx_rocket on a player who is froozen? Does he get an eternal flame in his ass?

Ups! Sorry, off topic.

/Lt.

jRaven 09-22-2006 10:07

Re: TFC Quad,Invul,Invis Powerups
 
Yeah, since amx_rocket seems like a dirty hack by relying on user gravity,maxspeed and even a jump forced... they will be kept at location by freeze and have the eternal flame up their rear. That combo may make for a severe punishment. :) (off topic too. ooh well.)

Edit: Since they aren't moving upwards, they will probably just explode as if they had hit a ceiling.

jRaven 09-22-2006 10:16

Re: TFC Quad,Invul,Invis Powerups
 
Changed to make better use of cmd_target flags.
Added client_print print_console notify to admin using a command.

I had previously used 3 relay calls to 1 function, but the problem came up when I tried to call the 4th all-powerups that without more logic there would be 3x spam messages. It doesn't matter. The code is cloned, fat, and slightly ugly, but simple(kiss).

Edit: change not tested yet, but client_print(id,print_console,"msg %s",target_name) should work.


All times are GMT -4. The time now is 01:48.

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