Medic plugin
by strontiumdog · 2006-12-07 · 17 replies · 24691 views · 802 downloads
From the first post
rnBut I wrote this because I couldn't find it anywhere else for DoD :D
rnThe Realism Mod in DoD:S has a medic function and I wanted something similar for DoD1.3!
rn
rn----------------------------------------------------------------------
rn
rnWhen 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).
rn
rn
rnCVARS:
rnamx_medic_maxhealth: set maximum health when healed (default 60)
rnamx_medic_minhealth: set minimum health before healing can happen (default 20)
rn
rnPlayers in-game:
rnsay /medic
rnsay medic
rn
rn(or bound to a key: bind "k" "say /medic")
Files
| dod_medic.sma | Plugin Source | 3 KB | 308 dl | Download Compile |
| medic.zip | Archive | 247 KB | 494 dl | Download |
The thread
All 18 posts from 6 people on Medic plugin, kept as they were written.
Threads: 6
Joined: Nov 2006
I'm sure this has been done before.rnBut I wrote this because I couldn't find it anywhere else for DoD :D rnThe Realism Mod in DoD:S has a medic function and I wanted something similar for DoD1.3!rnrn----------------------------------------------------------------------rnrnWhen 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).rnrnrnCVARS:rnamx_medic_maxhealth: set maximum health when healed (default 60)rnamx_medic_minhealth: set minimum health before healing can happen (default 20)rnrnPlayers in-game:rnsay /medicrnsay medicrnrn(or bound to a key: bind "k" "say /medic")
Threads: 7
Joined: Jun 2006
This looks interesting. I will give it a try. Thank you.
Threads: 6
Joined: Nov 2006
BTW...code for anyone who wants it without downloading the zip...nCompiles just fine in 1.76bnn
#include <amxmodx>n#include <amxmisc>n#include <fun>n#include <dodx>nn// amx_medic coded/developed by StrontiumDogn// Plugin in use at TheVille.Org II - DoD v1.3 Custom Map Server FF ONn// 63.210.145.199:27015n// http://www.theville.org nnnnew g_msgFadennpublic plugin_init()n{n register_plugin("amx_medic by StrontiumDog", "1.2b", "StrontiumDog")n register_concmd("amx_medic", "heal_player", ADMIN_SLAY, "<part of nick> - Use this to heal a player")n register_clcmd("say /medic","medic",0,"- Calls for medic when your health is below 20hp")n register_clcmd("say medic","medic",0,"- Calls for medic when your health is below 20hp")n register_cvar("amx_medic_maxhealth", "60") // max health a person can have when being healed(default 60)n register_cvar("amx_medic_minhealth", "20") // max health a person can have when being healed(default 20)n g_msgFade = get_user_msgid("ScreenFade")n}nnpublic plugin_precache() n{n precache_sound("medic/bandage1.wav")n precache_sound("medic/us_medic.wav")n precache_sound("medic/germedic.wav")n precache_sound("medic/britmedic.wav")n}nnpublic medic(id,level,cid)n{n new med_health = get_user_health(id) // get player healthn new med_minhealth = get_cvar_num("amx_medic_minhealth")n new med_maxhealth = get_cvar_num("amx_medic_maxhealth")n n // Is the map British or American (Thanks Diamond-Optic!)n new uk = dod_get_map_info(MI_ALLIES_TEAM)n n new med_myname[33]n get_user_name(id, med_myname, 32)n n // If player is dead, send message and exitn if(!is_user_alive(id))n {n client_print(id, print_chat, "[MEDIC] You are dead")n return PLUGIN_HANDLEDn }n n // If player's health is not below minhealth var, send message and exitn if(get_cvar_num("amx_medic_minhealth") < med_health)n {n client_print(id, print_chat, "[MEDIC] It's only a flesh wound. Get up and fight soldier!")n return PLUGIN_HANDLED;n }n n // Play US medic soundn if ((get_user_team(id) == 1) && (uk == 0))n {n emit_sound(id, CHAN_AUTO, "medic/us_medic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)n }n n // Play German medic soundn if (get_user_team(id) == 2) n {n emit_sound(id, CHAN_AUTO, "medic/germedic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)n }n n // Play British medic soundn if ((get_user_team(id) == 1) && (uk == 1))n {n emit_sound(id, CHAN_AUTO, "medic/britmedic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)n }n n //While player is being healed, fade the screen to blackn ftb(id)n n // Heal themn // Play bandage sound while being healednn set_user_health(id, med_maxhealth)n client_print(0, print_chat, "[MEDIC] %s has been healed", med_myname)n emit_sound(id, CHAN_AUTO, "medic/bandage1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)n n return PLUGIN_HANDLED;n}nnn// Fades screen to black while player is being healednpublic ftb(id)n{n message_begin(MSG_ONE, g_msgFade, {0,0,0}, id); n write_short(floatround(2.0*4096.0)); // fade lasts this long duration n write_short(floatround(4.0*4096.0)); // fade lasts this long hold time n write_short(2); // fade type in/outn write_byte(0); // fade red n write_byte(0); // fade green n write_byte(0); // fade blue n write_byte(225); // fade alpha: Change to 255 for complete blackness and recompilen message_end(); nn return PLUGIN_CONTINUEn}nnnThreads: 103
Joined: May 2005
....you could cut down on precache and download size by using the medic voices already in the game.. but that doesnt really matter :- lol
Threads: 6
Joined: Nov 2006
Slapping forehead....uh duh!rnI forgot they had them built in, in the gcf!rnrnBTW, is there any special way of calling them other than:rnrn
mit_sound(id, CHAN_AUTO, "player/germedic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)rnrnIs this the right folder even though it's part of the gcf?Threads: 103
Joined: May 2005
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)nnthe sounds in the gcf are located in the player/ directorynnbritmedic.wavngermedic.wavnusmedic.wavnnso maybe adding a team check on allies to check whether to play brit or us medic voice..nntheres also a 'stopbleed.wav' sound in there but its not quite like the bandage sound you have attached...nnn btw.. i like your signature :-)
Threads: 6
Joined: Nov 2006
Thanks!!rnrnOne last question, and I won't bother you anymore.....:D rnrnget_user_team(id)rnrn1 is Alliesrn2 is Germansrn3 is SpectatorsrnrnHow can you tell if the allied team is British....?
Threads: 103
Joined: May 2005
here's an example from the smoke grenade plugin:nn
new team = get_user_team(id)nnew is_brit = dod_get_map_info(MI_ALLIES_TEAM)nn // Check if its Allies, If so is it a brit map?n if(team == 1 && is_brit == 1)n sound_to_play = brit_smokeupn // Check if its Allies, cant be brit otherwise previous statement would have got itn else if(team == 1)n sound_to_play = us_smokeupn // otherwise must be german teamn elsen sound_to_play = ger_smokeupso you get the map info for the allies team, 1=britThreads: 6
Joined: Nov 2006
Thank you, sir...nYou are awesome!nnI'll make the changes and test it!
Threads: 6
Joined: Nov 2006
For the meantimenI'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!!nnIf you are hurting for pre-cache then changenn
public plugin_precache() n{n precache_sound("medic/bandage1.wav")n precache_sound("medic/us_medic.wav")n precache_sound("medic/germedic.wav")n precache_sound("medic/britmedic.wav")n}nntonnpublic plugin_precache() n{n precache_sound("medic/bandage1.wav")n precache_sound("player/usmedic.wav")n precache_sound("player/germedic.wav")n precache_sound("player/britmedic.wav")nn}nnand nn // Play US medic soundn if ((get_user_team(id) == 1) && (uk == 0))n {n emit_sound(id, CHAN_AUTO, "medic/us_medic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)n }n n // Play German medic soundn if (get_user_team(id) == 2) n {n emit_sound(id, CHAN_AUTO, "medic/germedic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)n }n n // Play British medic soundn if ((get_user_team(id) == 1) && (uk == 1))n {n emit_sound(id, CHAN_AUTO, "medic/britmedic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)n }nntonn // Play US medic soundn if ((get_user_team(id) == 1) && (uk == 0))n {n emit_sound(id, CHAN_AUTO, "player/usmedic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)n }n n // Play German medic soundn if (get_user_team(id) == 2) n {n emit_sound(id, CHAN_AUTO, "player/germedic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)n }n n // Play British medic soundn if ((get_user_team(id) == 1) && (uk == 1))n {n emit_sound(id, CHAN_AUTO, "player/britmedic.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)n }nnThe us_medic.wav is from DoD:S and I think sounds much better....:DThreads: 103
Joined: May 2005
you should also precache the defualt dod medic sound files too when using them instead of the new ones
Threads: 6
Joined: Nov 2006
Yup...did that and changed it....after making the server go boom!rnThanks for your help!
Threads: 47
Joined: Sep 2006
so i take it the sound wav. file is included and i dont have to roll up my sleeves to install this plug in ?? or do i have to bang my head then roll up sleeves ??
Threads: 33
Joined: Sep 2008
Just what im looking for, thank you sooo much!
Threads: 47
Joined: Sep 2006
i installed this plug in but cant get it to work ?? any ideas what i did wrong ?rni put the amxx in the plug ins folder and the sounds in the sound folder but cant seem to get it to work ??
Threads: 47
Joined: Sep 2006
here is what my modules.ini looks like :rnrnrnrn;;;rn; To enable a module, remove the semi-colon (;) in front of its name.rn; If it's not here, simply add it its name, one per line.rn; You don't need to write the _amxx part or the file extension.rn;;;rnrn;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rn;; SQL Modules usually need to be enabled manually ;;rn;; You can have any number on at a time. Use ;;rn;; amx_sql_type in sql.cfg to specify the default ;;rn;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rnrn;mysqlrn;sqliternrn;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rn;; Put third party modules below here. ;;rn;; You can just list their names, without the _amxx ;;rn;; or file extension. ;;rn;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rnrnrnrn;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rn;; These modules will be auto-detected and loaded ;;rn;; as needed. You do not need to enable them here ;;rn;; unless you have problems. ;;rn;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rnrnfunrn;enginern;fakemetarn;geoiprn;socketsrn;regexrn;nvaultrndodfunrndodxrn;hamsandwichrnrnrnrnrnthese are my plug ins :rnrnrn; AMX Mod X pluginsrnrn; Admin Base - Always one has to be activatedrnadmin.amxx ; admin base (required for any admin-related)rn;admin_sql.amxx ; admin base - SQL version (comment admin.amxx)rnrn; Basicrnadmincmd.amxx ; basic admin console commandsrnadminhelp.amxx ; help command for admin console commandsrnadminslots.amxx ; slot reservationrnmultilingual.amxx ; Multi-Lingual managementrnrn; Menusrnmenufront.amxx ; front-end for admin menusrncmdmenu.amxx ; command menu (speech, settings)rnplmenu.amxx ; players menu (kick, ban, client cmds.)rn;telemenu.amxx ; teleport menu (Fun Module required!)rnmapsmenu.amxx ; maps menu (vote, changelevel)rnpluginmenu.amxx ; Menus for commands/cvars organized by pluginrnrn; Chat / Messagesrnadminchat.amxx ; console chat commandsrnantiflood.amxx ; prevent clients from chat-flooding the serverrnscrollmsg.amxx ; displays a scrolling messagernimessage.amxx ; displays information messagesrnadminvote.amxx ; vote commandsrnrn; Map relatedrnnextmap.amxx ; displays next map in mapcyclern;mapchooser.amxx ; allows to vote for next maprntimeleft.amxx ; displays time left on maprnrn; Configurationrnpausecfg.amxx ; allows to pause and unpause some pluginsrnstatscfg.amxx ; allows to manage stats plugins via menu and commandsrnrn; Day of Defeatrnstats.amxx ; stats on death or round end (DoD Module required!)rnstatssounds.amxx ; precache plugin for stats pluginsrnstats_logging.amxx ; weapons stats logging (DoD Module required!)rnrn; Enable to use AMX Mod pluginsrnamxmod_compat.amxx ; AMX Mod backwards compatibility layerrnrn; Custom - Add 3rd party plugins herernrnrnloadingsounddir.amxxrnps_heatmaps.amxxrndod_kamikaze.amxxrndod_blockexploits.amxxrnWeaponsMod2.amxxrndod_teammanager.amxxrndod_respawnctrl.amxxrndod_eviladmin.amxxrndod_dropgrenades2.amxxrndod_tkrevenge.amxxrnamx_parachute.amxxrndod_giveammo.amxxrndod_gore_custom.amxxrndod_improved_registry.amxxrndod_killinfo.amxxrndod_meleebonus.amxxrndod_customize_flags.amxxrndeagsmapmanager.amxxrndod_rocketclass.amxxrnhd_main.amxxrnhd_bhophacks.amxxrnhd_kzhack.amxxrndod_medic.amxxrnrnrnI still can't figure out what the heck is going on ??
Threads: 47
Joined: Sep 2006
after a long day of looking at each plugin finally found out that th eweapons mod2 plugin is conflicting with the other plug ins i have so now my medic is working woohoo
Threads: 0
Joined: Sep 2012
all done change all files not a sound:mad:

