DoD Plugins

Go Back   DoD Plugins > DoD Plugins > Non Developer Plugins

Non Developer Plugins Plugins made by users not on the dev team

» Navigation
 > FAQ
» Forum Actions
» Programming
 > VERC
» Server Links
For Linking to Us
AvaMods
=|[76AD]|=
GameSpy Rangers
{DFH} Clan
AMX Mod X
Reply
 
Thread Tools Display Modes
  #1  
Old 12-07-2006, 03:57 PM
strontiumdog's Avatar
strontiumdog strontiumdog is offline
Junior Member
 
Join Date: Nov 2006
Posts: 27
DoD - Medic plugin

I'm sure this has been done before.
But I wrote this because I couldn't find it anywhere else for DoD
The Realism Mod in DoD:S has a medic function and I wanted something similar for DoD1.3!

----------------------------------------------------------------------

When a player's health get below a set level (default 20hp), they can heal themselves. The screen darkens to black, rendering them vulnerable. The player will yell out medic in their language. Their health then gets set to the max health level (default 60hp).


CVARS:
amx_medic_maxhealth: set maximum health when healed (default 60)
amx_medic_minhealth: set minimum health before healing can happen (default 20)

Players in-game:
say /medic
say medic

(or bound to a key: bind "k" "say /medic")
Attached Files
 
 Source (3.0 KB, 300 views)
File Type: zip medic.zip (246.6 KB, 480 views)
__________________

SourceMod Coders

Last edited by strontiumdog; 12-22-2006 at 06:04 PM.
Reply With Quote
  #2  
Old 12-07-2006, 04:24 PM
Box Cutter's Avatar
Box Cutter Box Cutter is offline
Senior Member
 
Join Date: Jun 2006
Location: Arizona
Posts: 155
This looks interesting. I will give it a try. Thank you.
__________________
Reply With Quote
  #3  
Old 12-08-2006, 01:44 AM
strontiumdog's Avatar
strontiumdog strontiumdog is offline
Junior Member
 
Join Date: Nov 2006
Posts: 27
BTW...code for anyone who wants it without downloading the zip...
Compiles just fine in 1.76b

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <dodx> // amx_medic coded/developed by StrontiumDog // Plugin in use at TheVille.Org II - DoD v1.3 Custom Map Server FF ON // 63.210.145.199:27015 // http://www.theville.org new g_msgFade public plugin_init() { register_plugin("amx_medic by StrontiumDog", "1.2b", "StrontiumDog") register_concmd("amx_medic", "heal_player", ADMIN_SLAY, "<part of nick> - Use this to heal a player") register_clcmd("say /medic","medic",0,"- Calls for medic when your health is below 20hp") register_clcmd("say medic","medic",0,"- Calls for medic when your health is below 20hp") register_cvar("amx_medic_maxhealth", "60") // max health a person can have when being healed(default 60) register_cvar("amx_medic_minhealth", "20") // max health a person can have when being healed(default 20) g_msgFade = get_user_msgid("ScreenFade") } public plugin_precache() { precache_sound("medic/bandage1.wav") precache_sound("medic/us_medic.wav") precache_sound("medic/germedic.wav") precache_sound("medic/britmedic.wav") } public medic(id,level,cid) { new med_health = get_user_health(id) // get player health new med_minhealth = get_cvar_num("amx_medic_minhealth") new med_maxhealth = get_cvar_num("amx_medic_maxhealth") // Is the map British or American (Thanks Diamond-Optic!) new uk = dod_get_map_info(MI_ALLIES_TEAM) new med_myname[33] get_user_name(id, med_myname, 32) // If player is dead, send message and exit if(!is_user_alive(id)) { client_print(id, print_chat, "[MEDIC] You are dead") return PLUGIN_HANDLED } // If player's health is not below minhealth var, send message and exit if(get_cvar_num("amx_medic_minhealth") < med_health) { client_print(id, print_chat, "[MEDIC] It's only a flesh wound. Get up and fight soldier!") return PLUGIN_HANDLED; } // Play US medic sound if ((get_user_team(id) == 1) && (uk == 0)) { emit_sound(id, CHAN_AUTO, "medic/us_medic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) } // Play German medic sound if (get_user_team(id) == 2) { emit_sound(id, CHAN_AUTO, "medic/germedic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) } // Play British medic sound if ((get_user_team(id) == 1) && (uk == 1)) { emit_sound(id, CHAN_AUTO, "medic/britmedic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) } //While player is being healed, fade the screen to black ftb(id) // Heal them // Play bandage sound while being healed set_user_health(id, med_maxhealth) client_print(0, print_chat, "[MEDIC] %s has been healed", med_myname) emit_sound(id, CHAN_AUTO, "medic/bandage1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) return PLUGIN_HANDLED; } // Fades screen to black while player is being healed public ftb(id) { message_begin(MSG_ONE, g_msgFade, {0,0,0}, id); write_short(floatround(2.0*4096.0)); // fade lasts this long duration write_short(floatround(4.0*4096.0)); // fade lasts this long hold time write_short(2); // fade type in/out write_byte(0); // fade red write_byte(0); // fade green write_byte(0); // fade blue write_byte(225); // fade alpha: Change to 255 for complete blackness and recompile message_end(); return PLUGIN_CONTINUE }

__________________

SourceMod Coders

Last edited by strontiumdog; 12-21-2006 at 03:07 PM.
Reply With Quote
  #4  
Old 12-08-2006, 07:34 PM
diamond-optic's Avatar
diamond-optic diamond-optic is offline
AvaMods.com Admin
Developer
Admin
 
Join Date: May 2005
Location: Upstate New York
Posts: 2,044
....you could cut down on precache and download size by using the medic voices already in the game.. but that doesnt really matter :-\ lol
__________________




| AvaMods | dodplugins | amxx plugins |

Reply With Quote
  #5  
Old 12-08-2006, 08:23 PM
strontiumdog's Avatar
strontiumdog strontiumdog is offline
Junior Member
 
Join Date: Nov 2006
Posts: 27
Slapping forehead....uh duh!
I forgot they had them built in, in the gcf!

BTW, is there any special way of calling them other than:

Code:
mit_sound(id, CHAN_AUTO, "player/germedic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)

Is this the right folder even though it's part of the gcf?
__________________

SourceMod Coders
Reply With Quote
  #6  
Old 12-08-2006, 08:28 PM
diamond-optic's Avatar
diamond-optic diamond-optic is offline
AvaMods.com Admin
Developer
Admin
 
Join Date: May 2005
Location: Upstate New York
Posts: 2,044
emit_sound is the right way to make it as if they are saying it, tho instead of CHAN_AUTO you could use CHAN_VOICE (but it shouldnt really matter either way)

the sounds in the gcf are located in the player/ directory

britmedic.wav
germedic.wav
usmedic.wav

so maybe adding a team check on allies to check whether to play brit or us medic voice..

theres also a 'stopbleed.wav' sound in there but its not quite like the bandage sound you have attached...


btw.. i like your signature :-)
__________________




| AvaMods | dodplugins | amxx plugins |

Reply With Quote
  #7  
Old 12-08-2006, 08:37 PM
strontiumdog's Avatar
strontiumdog strontiumdog is offline
Junior Member
 
Join Date: Nov 2006
Posts: 27
Thanks!!

One last question, and I won't bother you anymore.....

get_user_team(id)

1 is Allies
2 is Germans
3 is Spectators

How can you tell if the allied team is British....?
__________________

SourceMod Coders
Reply With Quote
  #8  
Old 12-08-2006, 08:38 PM
diamond-optic's Avatar
diamond-optic diamond-optic is offline
AvaMods.com Admin
Developer
Admin
 
Join Date: May 2005
Location: Upstate New York
Posts: 2,044
here's an example from the smoke grenade plugin:

Code:
new team = get_user_team(id) new is_brit = dod_get_map_info(MI_ALLIES_TEAM) // Check if its Allies, If so is it a brit map? if(team == 1 && is_brit == 1) sound_to_play = brit_smokeup // Check if its Allies, cant be brit otherwise previous statement would have got it else if(team == 1) sound_to_play = us_smokeup // otherwise must be german team else sound_to_play = ger_smokeup

so you get the map info for the allies team, 1=brit
__________________




| AvaMods | dodplugins | amxx plugins |


Last edited by diamond-optic; 12-08-2006 at 08:41 PM.
Reply With Quote
  #9  
Old 12-08-2006, 08:40 PM
strontiumdog's Avatar
strontiumdog strontiumdog is offline
Junior Member
 
Join Date: Nov 2006
Posts: 27
Thank you, sir...
You are awesome!

I'll make the changes and test it!
__________________

SourceMod Coders
Reply With Quote
  #10  
Old 12-08-2006, 09:25 PM
strontiumdog's Avatar
strontiumdog strontiumdog is offline
Junior Member
 
Join Date: Nov 2006
Posts: 27
For the meantime
I've left the sounds outside in a separate folder so that people have the option of putting their own mono 8 bit sounds in there....I've had people complain they can never change the sounds to what they want!!

If you are hurting for pre-cache then change

Code:
public plugin_precache() { precache_sound("medic/bandage1.wav") precache_sound("medic/us_medic.wav") precache_sound("medic/germedic.wav") precache_sound("medic/britmedic.wav") }

to

Code:
public plugin_precache() { precache_sound("medic/bandage1.wav") precache_sound("player/usmedic.wav") precache_sound("player/germedic.wav") precache_sound("player/britmedic.wav") }

and

Code:
// Play US medic sound if ((get_user_team(id) == 1) && (uk == 0)) { emit_sound(id, CHAN_AUTO, "medic/us_medic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) } // Play German medic sound if (get_user_team(id) == 2) { emit_sound(id, CHAN_AUTO, "medic/germedic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) } // Play British medic sound if ((get_user_team(id) == 1) && (uk == 1)) { emit_sound(id, CHAN_AUTO, "medic/britmedic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) }

to

Code:
// Play US medic sound if ((get_user_team(id) == 1) && (uk == 0)) { emit_sound(id, CHAN_AUTO, "player/usmedic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) } // Play German medic sound if (get_user_team(id) == 2) { emit_sound(id, CHAN_AUTO, "player/germedic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) } // Play British medic sound if ((get_user_team(id) == 1) && (uk == 1)) { emit_sound(id, CHAN_AUTO, "player/britmedic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) }

The us_medic.wav is from DoD:S and I think sounds much better....
__________________

SourceMod Coders

Last edited by strontiumdog; 12-08-2006 at 10:03 PM.
Reply With Quote
Reply

Bookmarks

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic Medic Hell Phoenix SourceMod Plugins 10 04-15-2010 10:14 PM
Specific medic plugin Sohood Requests for DoD Plugins 0 04-13-2010 01:27 AM
Realistic Medic Campbell [82nd AB] Requests for DoD Plugins 4 05-24-2008 12:44 PM

» Donations
If you like this website, and would like to give something in return, you can make a donation. Your donation will be used to pay for hosting service, domain, & maintenance costs only!

$

Select your donation amount and then press the Donate button.




» Log in
User Name:

Password:

Not a member yet?
Register Now!
Powered by vBadvanced CMPS v3.2.3

All times are GMT -3. The time now is 06:00 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
dodplugins.net