My First Metamod Plugin
FireStorm
Join Date: 2002-11-06 Member: 7390Members
<span style='font-size:14pt;line-height:100%'><span style='color:red'>Attachment changed</span></span>
<span style='color:red'>Redownload the file please - see a few posts below</span>
I wanted to do something simple for my first plugin. Here's what I've done:
Two parts. Here's the first one:
Many people asked this question: when they are dead, do the alive players still see what they say or say_team?
I think they do until you enter to spectate mode, so I've done this:
Let's say I type hello during the game.
If I'm alive you'll see:
FireStorm: hello
If I'm dead but not yet in spectator mode you'll see the same thing (alive players can still see what you type):
FireStorm: hello
But if I'm dead and I'm already in spectator mode you'll see:
FireStorm: [DEAD] hello
which means that only dead players can see what you're saying.
-----------------------------------
Now the other part:
Let's say I say "hello" to my team
If I'm a normal soldier/alien you'll see:
(TEAM) FireStorm: hello
But If I'm a commander you'll see:
(TEAM) FireStorm: [COMM] hello
If I'm a gorge you'll see:
(TEAM) FireStorm: [GORGE] hello
---------------------------
I hope someone will take a look at it. If you know something about metamod coding, please download the file and look at the source code to see if I did this well enough. This is my first try. It would help me, thanks <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->
Win32 dll included, there's no linux version because... I don't have linux <!--emo&???--><img src='http://www.unknownworlds.com/forums/html/emoticons/confused.gif' border='0' style='vertical-align:middle' alt='confused.gif'><!--endemo-->
<span style='color:red'>Redownload the file please - see a few posts below</span>
I wanted to do something simple for my first plugin. Here's what I've done:
Two parts. Here's the first one:
Many people asked this question: when they are dead, do the alive players still see what they say or say_team?
I think they do until you enter to spectate mode, so I've done this:
Let's say I type hello during the game.
If I'm alive you'll see:
FireStorm: hello
If I'm dead but not yet in spectator mode you'll see the same thing (alive players can still see what you type):
FireStorm: hello
But if I'm dead and I'm already in spectator mode you'll see:
FireStorm: [DEAD] hello
which means that only dead players can see what you're saying.
-----------------------------------
Now the other part:
Let's say I say "hello" to my team
If I'm a normal soldier/alien you'll see:
(TEAM) FireStorm: hello
But If I'm a commander you'll see:
(TEAM) FireStorm: [COMM] hello
If I'm a gorge you'll see:
(TEAM) FireStorm: [GORGE] hello
---------------------------
I hope someone will take a look at it. If you know something about metamod coding, please download the file and look at the source code to see if I did this well enough. This is my first try. It would help me, thanks <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->
Win32 dll included, there's no linux version because... I don't have linux <!--emo&???--><img src='http://www.unknownworlds.com/forums/html/emoticons/confused.gif' border='0' style='vertical-align:middle' alt='confused.gif'><!--endemo-->
Comments
Roo
I haven't tested the behaviour of this plugin when ChatVaraibles is loaded... I'll do it right now.
Sounds good, Ill take a look at your code and see if I can compile it on linux for you too.
Oh post it up over at www.modns.org in the metamod forum!
My plugin fights with voogru's ChatVariables :/
If you have ChatVariables enabled, don't use teamsay until I fix the bugs.
Thanks Skitzo, but wait before compiling it, I want to add ChatVaraibles compatibility.
/me gets to work
Unsure whether it would have a problem or not.
Update:
ChatVaraibles does variable processing in multiple passes - that's the problem.
I have to find a workaround.
I couldn't test TextSift because it crashes when I try to type the "F-word" even if it's the only plugin loaded :/
But it's compatible with ChatVariables now <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->
[EDIT]Attachment removed - new version below[/edit]
Next time I'll come up with something better and more useful <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->
/me needs a good idea now
Might have to get one of the more experienced coders to take a look.
<!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->make: *** No rule to make target `*.h', needed by `msgs/debug'. Stop.<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->
Not sure what this error code is about.
|-+ teamsay (source inside)
|
|-+ hlsdk (with the HL sdk inside, I got .h files from the multiplayer source)
|
|-+ metamod (the metamod zip)
| + metamod (metamod sources)
Roo
I had to turn off amx antiflood cos it kept saying I was flooding the server. I assume because of 2 say messages too quick after each other.
If you could change the plugin so that it allows dead people to talk to their team at any time that would be great. As it seems pointless to block team_say chat while spectating if voice comm still works.
<a href='http://forums.modns.org/viewtopic.php?t=194' target='_blank'>ServerTimetable</a>
It might very well save me a headache, and be useful for clearing a server for clan matches without upsetting your regular pub players <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->
Yeah bring this feature in and it'll be a permanent feature on meh server Fire <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink.gif' border='0' style='vertical-align:middle' alt='wink.gif'><!--endemo-->
Roo
Yeah bring this feature in and it'll be a permanent feature on meh server Fire <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink.gif' border='0' style='vertical-align:middle' alt='wink.gif'><!--endemo-->
Roo <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
I'm just a beginner but I'll see if I can do anything....
There's just a problem: I would need 2 computers in LAN to test it, but my laptop (that is probably lying somewhere, completely forgotten) runs in 640x480x256 colors and on Win95 and of course refuses to run HL...
So even if I'd know how to do it I couldn't test it...
I have to do something that I can test alone... that's the biggest problem.
I had to turn off amx antiflood cos it kept saying I was flooding the server. I assume because of 2 say messages too quick after each other. <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
Thx for the linux version <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif'><!--endemo-->
Put teamsay BEFORE amx in plugins.ini and it shouldn't say you're flooding anymore.
[edit]damn filter... anyway try 24.190.169.109:27017 if you cant figure out what that word is <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink.gif' border='0' style='vertical-align:middle' alt='wink.gif'><!--endemo--> [/edit]
[edit]damn filter... anyway try 24.190.169.109:27017 if you cant figure out what that word is <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink.gif' border='0' style='vertical-align:middle' alt='wink.gif'><!--endemo--> [/edit] <!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
The version above is 0.2 which already works with ChatVariables. Enjoy! <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->
Thx for the proposition, but this one has already been tested. I'll keep this in mind if I'll do another plugin.
/me needs a second computer <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif'><!--endemo-->
[edit] I've just pinged your server.... 169 ms :/ [/edit]
Teamsay v0.3
2 lines of code changed... This version fixes a minor bug and allow things like /stuck and nextmap to work with say_team.
as for the post at the end, hullu's unstuck works for me if u say it as a team_say <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif'><!--endemo-->
(TEAM) FireStorm: [GORGE] /stuck
This is not the expected behaviour. <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo--> Version 0.3 removes this little bug.