My First Metamod Plugin

FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
edited June 2003 in General Server Discussion
<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-->

Comments

  • CoolCookieCooksCoolCookieCooks Pretty Girl Join Date: 2003-05-18 Member: 16446Members, NS1 Playtester, Contributor, Constellation
    cool <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif'><!--endemo-->
  • RoobubbaRoobubba Who you gonna call? Join Date: 2003-01-06 Member: 11930Members, Reinforced - Shadow, WC 2013 - Shadow
    I will test this out tomorrow on my server Fire, be there 7:30-8:00pm GMT!!

    Roo
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    thanks <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    one more thing: better add it after the ChatVariables plugin

    I haven't tested the behaviour of this plugin when ChatVaraibles is loaded... I'll do it right now.
  • Asylum-SkitzoAsylum-Skitzo Join Date: 2003-02-08 Member: 13254Members
    edited June 2003
    Ill have a play with it this evening.
    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!
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    OUUCCHHH

    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
  • Asylum-SkitzoAsylum-Skitzo Join Date: 2003-02-08 Member: 13254Members
    edited June 2003
    You may also want to test it with <a href='http://forums.modns.org/viewtopic.php?t=153' target='_blank'>TextSift</a>.
    Unsure whether it would have a problem or not.
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    edited June 2003
    OK, I'll test it too... But if I manage to get it to work with ChatVaraibles it should work with everything else. But I'll try.


    Update:
    ChatVaraibles does variable processing in multiple passes - that's the problem.
    I have to find a workaround.
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    edited June 2003
    Version 0.2

    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]
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    3 downloads... great lol

    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
  • Asylum-SkitzoAsylum-Skitzo Join Date: 2003-02-08 Member: 13254Members
    Unfortunately I had trouble compiling this on linux.
    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.
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    I think it's because when I compiled it the direstory structure was like that:

    |-+ teamsay (source inside)
    |
    |-+ hlsdk (with the HL sdk inside, I got .h files from the multiplayer source)
    |
    |-+ metamod (the metamod zip)
    | + metamod (metamod sources)
  • RoobubbaRoobubba Who you gonna call? Join Date: 2003-01-06 Member: 11930Members, Reinforced - Shadow, WC 2013 - Shadow
    this is just about to be run on my server so if you're still around Fire get on and you can see what it's like (it it works <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink.gif' border='0' style='vertical-align:middle' alt='wink.gif'><!--endemo-->) I'll let you in on all the error messages if there are any of course <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->

    Roo
  • CheesyPetezaCheesyPeteza Join Date: 2002-11-24 Member: 9784Members, NS1 Playtester, Constellation
    Here's a <a href='http://www.holcroft.net/~cheesy/teamsay_mm_i386.so' target='_blank'>linux version</a>.

    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.
  • eagleceaglec Join Date: 2002-11-25 Member: 9948Members, Constellation
    Good work Firestorm - now you wanted another idea? How's about this one :-
    <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-->
  • RoobubbaRoobubba Who you gonna call? Join Date: 2003-01-06 Member: 11930Members, Reinforced - Shadow, WC 2013 - Shadow
    <!--QuoteBegin--CheesyPeteza+Jun 16 2003, 09:22 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (CheesyPeteza @ Jun 16 2003, 09:22 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> 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. <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
    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
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    <!--QuoteBegin--Roobubba+Jun 17 2003, 10:00 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Roobubba @ Jun 17 2003, 10:00 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> <!--QuoteBegin--CheesyPeteza+Jun 16 2003, 09:22 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (CheesyPeteza @ Jun 16 2003, 09:22 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> 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. <!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    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.
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    <!--QuoteBegin--CheesyPeteza+Jun 17 2003, 03:22 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (CheesyPeteza @ Jun 17 2003, 03:22 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Here's a <a href='http://www.holcroft.net/~cheesy/teamsay_mm_i386.so' target='_blank'>linux version</a>.

    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.
  • Simple_CompoundSimple_Compound Join Date: 2003-05-09 Member: 16180Members
    edited June 2003
    if you need any help testing just mail me or drop by my server at <b>deadlydozen.kicks-****.net</b> and ask for m0nk. i like the idea of this plugin and cant wait till its working with ChatVariables. good luck and nice work.


    [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]
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    edited June 2003
    <!--QuoteBegin--Simple Compound+Jun 17 2003, 06:05 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Simple Compound @ Jun 17 2003, 06:05 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> if you need any help testing just mail me or drop by my server at <b>deadlydozen.kicks-****.net</b> and ask for m0nk.  i like the idea of this plugin and cant wait till its working with ChatVariables. good luck and nice work.


    [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]
  • Simple_CompoundSimple_Compound Join Date: 2003-05-09 Member: 16180Members
    normally it isnt that bad.... the highest ping for a 56ker on my server is 150. mostly everyone else with broadband range from 20-80 even outside the country.
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    I have ADSL.... But I live in France <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif'><!--endemo-->
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    *bump*

    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.
  • Grimm_SpectorGrimm_Spector Join Date: 2002-11-01 Member: 3309Members, Constellation
    voice and text work for dead players as of 1.04, so I don't know what you're talking about, however I'd love to have a plugin that makes specs able to see public text chat, which they cannot at the moment! <!--emo&:angry:--><img src='http://www.unknownworlds.com/forums/html/emoticons/mad.gif' border='0' style='vertical-align:middle' alt='mad.gif'><!--endemo-->

    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-->
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    Yes, but try to say /stuck with say_team when you're a gorge with teamsay v0.2...

    (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.
Sign In or Register to comment.