[TF2-specific] How would I write a plugin that runs commands on point capture?
Hia, first post, just learning the language for these plugins and having some trouble digging into it unguided. I'm trying to be able to run create a script that makes the console run a command only once on capture of a point. Do I need to have it once per point (like an index of each point across cp_dustbowl) with an array or something? Or is there a cleaner way to do it?
As a point of reference, the command I wish to run is sm_addtime 600. |
Re: [TF2-specific] How would I write a plugin that runs commands on point capture?
Annnd I totally put this in the wrong subforum because I was multitasking too hard across too many screens, mb
|
Re: [TF2-specific] How would I write a plugin that runs commands on point capture?
For running a command on point capture you can do:
PHP Code:
|
Re: [TF2-specific] How would I write a plugin that runs commands on point capture?
1 Attachment(s)
I use the attached plugin to reward individual TF2 players who capture the control point.
The plugin uses the teamplay_point_captured event mentioned above by Sreaper. It uses code previously posted by the very talented Bacardi to determine which players captured the point by name. I added a bit more code to give each human player who captured a small buff for a five seconds and cash reward. The plugin also posts a notice to the server console showing who captured the point. |
Re: [TF2-specific] How would I write a plugin that runs commands on point capture?
aaaaa I can't compile what I'm made now >.>
PHP Code:
So dang used to brackets that now that they're useless I feel like I wasted time in college on java courses ;_; Ah, I answered my own question double checking my work. Now the compiler won't actually spit out the spx though. Complains it has no ability to write to (...sourcemod-1.10.0\compiled\<filename>) |
Re: [TF2-specific] How would I write a plugin that runs commands on point capture?
Neeeeevermind, I answered my own question again. I forget that older scripts don't do you the favor of just up and making directories for you when you lack them. Also kind of figured that a shortcut to the compiler would let it run as normal, not from where the sc was made. Not entirely bad, lets me have a compiled folder on the surface.
|
Re: [TF2-specific] How would I write a plugin that runs commands on point capture?
Quote:
The first reason it failed was because ServerCommand("sm_addtime 600"); was expecting semicolon at the end since you required them to be there. The second one failed because you added a ; to the end of the hook callback definition which isn't allowed. public TeamplayPointCaptured(Handle event, char[] name, bool dontBroadcast); |
Re: [TF2-specific] How would I write a plugin that runs commands on point capture?
Quote:
I'm not that talent. :bee: |
All times are GMT -4. The time now is 01:16. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.