[Tf2] Randomly force a player to medic?
Hey all!
I'm looking to make a plugin whereby, once a PUG server has 12 players, I can type 'sm_pickmedic' and it will pick one player at random (and thus swap them to medic or merely print in console repeatedly they're medic). Further, could I give immunity: 'sm_pickmedic_immunity <#userid|name>' ? Players can also type '!medic' in chat to elect to be medic, they can also type '!whoismedic' to see who was randomly selected. How does one hook into what players type in chat? I don't know where to start, is there any documentation that can steer me or could some nice soul give me some starting points? Thanks |
Re: [Tf2] Randomly force a player to medic?
This seems like an interesting plugin. I could probably code the first part easily enough, but I'm not sure about the second part... I think I could probably do it too though.
|
Re: [Tf2] Randomly force a player to medic?
Second part I think is something like the following..
PHP Code:
|
Re: [Tf2] Randomly force a player to medic?
Instead of doing that, why not just create a new command? That way /whoismedic will work as well, for example.
Anyway, I'm still coding the plugin and I'm making good progress. |
Re: [Tf2] Randomly force a player to medic?
I imagine it would be easier for new users to just use the say channel. That way they won't have to open up the console (possibly enable first), and type a new command. Plus, not everyone reads the motd, and by hooking the say command, the existence of the new commands can be picked up from others.
best of both? PHP Code:
|
Re: [Tf2] Randomly force a player to medic?
Quote:
PHP Code:
|
Re: [Tf2] Randomly force a player to medic?
1 Attachment(s)
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:
Cvars:
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? |
Re: [Tf2] Randomly force a player to medic?
Thank you all so much! I would thank you all individually, but I'm still getting used to using these forums.
I'll test out some of the things, and get back to you asap. |
Re: [Tf2] Randomly force a player to medic?
Quote:
And oh yes, please let me know if you want to target just your team or everyone. |
Re: [Tf2] Randomly force a player to medic?
in my random medic system when ever a client is chosen i whitelist them (write them to a file) and when the random call is picked if it finds there steamid in the medic whtelist file it will choose another one, my problem is that it doesnt always work
do you think you could add a proper whitelist option, would be nice to play pugs were medics arnt chosen twice |
All times are GMT -4. The time now is 06:35. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.