Raised This Month: $32 Target: $400
 8% 

TFC Quad,Invul,Invis Powerups


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Team Fortress Classic        Category:   Fun Stuff        Approver:   Xanimos (85)
jRaven
AMX Mod X Beta Tester
Join Date: Jan 2006
Location: IA, USA
Old 09-22-2006 , 00:16   TFC Quad,Invul,Invis Powerups
Reply With Quote #1

/**
|** 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!
*\*
**\
**/
Attached Files
File Type: sma Get Plugin or Get Source (jr_powerups.sma - 2160 views - 11.2 KB)

Last edited by jRaven; 01-01-2007 at 22:47. Reason: support for neotf precache issue in v1.4
jRaven is offline
Send a message via ICQ to jRaven Send a message via AIM to jRaven
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 09-22-2006 , 01:31   Re: TFC Quad,Invul,Invis Powerups
Reply With Quote #2

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.

Last edited by GHW_Chronic; 09-22-2006 at 01:34.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
Lt Llama
Senior Member
Join Date: Aug 2004
Old 09-22-2006 , 01:47   Re: TFC Quad,Invul,Invis Powerups
Reply With Quote #3

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.
__________________
A dodo: Used to describe someone without common sense and who always has the pathetic confused look on their face when a question is asked.
Lt Llama is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 09-22-2006 , 01:53   Re: TFC Quad,Invul,Invis Powerups
Reply With Quote #4

I don't understand how your #1 would cause lag
ur #2 would be a different plugin if im understanding u correctly.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
Lt Llama
Senior Member
Join Date: Aug 2004
Old 09-22-2006 , 02:11   Re: TFC Quad,Invul,Invis Powerups
Reply With Quote #5

Quote:
Originally Posted by GHW_Chronic View Post
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.
__________________
A dodo: Used to describe someone without common sense and who always has the pathetic confused look on their face when a question is asked.

Last edited by Lt Llama; 09-22-2006 at 02:15.
Lt Llama is offline
jRaven
AMX Mod X Beta Tester
Join Date: Jan 2006
Location: IA, USA
Old 09-22-2006 , 09:33   Re: TFC Quad,Invul,Invis Powerups
Reply With Quote #6

Quote:
Originally Posted by Lt Llama View Post
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 is offline
Send a message via ICQ to jRaven Send a message via AIM to jRaven
jRaven
AMX Mod X Beta Tester
Join Date: Jan 2006
Location: IA, USA
Old 09-22-2006 , 09:36   Re: TFC Quad,Invul,Invis Powerups
Reply With Quote #7

Re: Your #1 again: if people are idiots, freeze them! Hooray ice!
jRaven is offline
Send a message via ICQ to jRaven Send a message via AIM to jRaven
Lt Llama
Senior Member
Join Date: Aug 2004
Old 09-22-2006 , 09:57   Re: TFC Quad,Invul,Invis Powerups
Reply With Quote #8

Quote:
Originally Posted by jRaven View Post
Re: Your #1 again: if people are idiots, freeze them! 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.
__________________
A dodo: Used to describe someone without common sense and who always has the pathetic confused look on their face when a question is asked.
Lt Llama is offline
jRaven
AMX Mod X Beta Tester
Join Date: Jan 2006
Location: IA, USA
Old 09-22-2006 , 10:07   Re: TFC Quad,Invul,Invis Powerups
Reply With Quote #9

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.

Last edited by jRaven; 09-22-2006 at 12:40.
jRaven is offline
Send a message via ICQ to jRaven Send a message via AIM to jRaven
jRaven
AMX Mod X Beta Tester
Join Date: Jan 2006
Location: IA, USA
Old 09-22-2006 , 10:16   Re: TFC Quad,Invul,Invis Powerups
Reply With Quote #10

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.

Last edited by jRaven; 09-22-2006 at 10:43.
jRaven is offline
Send a message via ICQ to jRaven Send a message via AIM to jRaven
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 18:51.


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