View Single Post
waylaidwanderer
SourceMod Donor
Join Date: Aug 2012
Old 11-09-2012 , 18:03   Re: [Tf2] Randomly force a player to medic?
Reply With Quote #7

Here's what I cobbled together. I'm not sure if it works, but it compiles fine.

If someone could test it, that'd be great.

Description:
Forces a random player to medic.
Commands:
  • sm_pickmedic | Randomly chooses a player, and then forces them to become a medic. Can be also triggered by typing !pickmedic or /pickmedic into chat. | Default Flag: GENERIC | Override: sm_pickmedic

Cvars:
  • sm_pickmedic_version | Plugin version. Do not edit.
  • sm_pickmedic_enabled | 0 = Disable plugin, 1 = Enable plugin | Default Value: 1
  • sm_pickmedic_immune | Are admins immune to the plugin? | 0 = No, 1 = Yes | Default Value: 1 --- NOT WORKING CURRENTLY

Installation:
Place pickmedic.smx into your addons/sourcemod/plugins folder.

Oh, and I forgot to add an admin flag to the command (derp!), so I'll change it later when I have time, assuming the plugin works. If not, I'll have to fix up those errors first.

Edit: did some testing and the current way I tried writing in admin immunity breaks the code. However, without that code, picking and setting a random person to be medic works fine. Reuploaded plugin.

Edit 2: Question: Do you want to only pick a medic on the same team you are? Or just a medic from anyone on the server?
Attached Files
File Type: sp Get Plugin or Get Source (pickmedic.sp - 346 views - 2.5 KB)

Last edited by waylaidwanderer; 11-10-2012 at 00:58. Reason: Reuploaded pickmedic plugin, added admin flag. + a question!
waylaidwanderer is offline