Well I didn't really want to use Metamod: Source to do this.

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Stephen Swires
> Sent: 02 April 2006 12:08
> To: hlcoders@list.valvesoftware.com
> Subject: Re: [hlcoders] Remove event "player_say" (Source
> Server Plugin)
>
> This is a multi-part message in MIME format.
> --
> [ Picked text/plain from multipart/alternative ] Yeah,
> Metamod: Source was meant to simplify the process of making
> HL2 Server mods, the only disadvantage is that Metamod:
> Source has to be on your server at the same time, hopefully
> that won't be a problem. Also, there's a developer forum at
> http://www.sourcemod.net/forums/ the people can help you with
> your problem if one is encountered.
>
> LDuke wrote:
>
> >--
> >[ Picked text/plain from multipart/alternative ] Write your
> plugin as a
> >metamod:source plugin (www.sourcemm.net) and hook the say
> and team_say
> >commands. You'll need to hook any function that you're
> trying to block
> >if you handle it instead of the engine. SourceMM makes it
> easy, since
> >it handles the hook for you. It also manages hooks from
> other plugins
> >so they don't interfere with each other.
> >
> >For example, on load get the pointer to the say command and declare
> >your
> >hook:
> >
> >SH_ADD_HOOK_MEMFUNC(ConCommand, Dispatch, pSayCmd, &g_MyPlugin,
> >&MyPlugin::Say_handler, false);
> >
> >Then your function would look like this:
> >
> >void MyPlugin::Say_handler()
> >{
> >    if (FStrEq(m_Engine->Cmd_Argv(1), "mysaycommand"))
> >    {
> >        // run my code
> >        RETURN_META(MRES_SUPERCEDE);
> >    }
> >    RETURN_META(MRES_IGNORED);
> >}
> >
> >You have a lot more power/options if you make use
> metamod:source. Check
> >out the coding section of their forums for help.
> >
> >
> >
> >On 4/1/06, Paul Kirby <[EMAIL PROTECTED]> wrote:
> >
> >
> >>Well what I want it to do is, when the server gets a
> player_say event
> >>from any player, and (key "text")(i.e text they send using say or
> >>team_say) = a set string value, I then want that event to
> be removed
> >>before it gets to any player.
> >>
> >>Its basically a filter for say and team_say.
> >>
> >>If removing the event isn't possible then editing/updating an event
> >>before any player gets it, should do.
> >>
> >>Sorry if I am not explaining this right.
> >>
> >>Thanks in advance
> >>
> >>Paul
> >>
> >>
> >>
> >>>-----Original Message-----
> >>>From: [EMAIL PROTECTED]
> >>>[mailto:[EMAIL PROTECTED] On Behalf
> Of Rob Lach
> >>>Sent: 01 April 2006 23:14
> >>>To: hlcoders@list.valvesoftware.com
> >>>Subject: Re: [hlcoders] Remove event "player_say" (Source Server
> >>>Plugin)
> >>>
> >>>--
> >>>[ Picked text/plain from multipart/alternative ] who do
> you want the
> >>>event to reach?
> >>>
> >>>On 4/1/06, Paul Kirby <[EMAIL PROTECTED]> wrote:
> >>>
> >>>
> >>>>Hello All
> >>>>
> >>>>Just a quick question...
> >>>>
> >>>>I can retrieve the "player_say" event using the following:
> >>>>
> >>>>void CEmptyServerPlugin::FireGameEvent( KeyValues * event ) {
> >>>>  const char * name = event->GetName();
> >>>>  Msg( "CEmptyServerPlugin::FireGameEvent: Got event
> >>>>
> >>>>
> >>>\"%s\"\n", name );
> >>>
> >>>
> >>>>  if (FStrEq(name,"player_say"))
> >>>>  {
> >>>>    Msg("ALERT(GetString): UserID(%d) said: %s = %s\n"
> >>>>      ,event->GetInt("userid",0)
> >>>>      ,name
> >>>>      ,event->GetString("text","(*not defined*)")
> >>>>    );
> >>>>
> >>>>    if(FStrEq(event->GetString("text","(*not
> >>>>
> >>>>
> >>>defined*)"),"filtered_word"))
> >>>
> >>>
> >>>>    {
> >>>>      /* Code to remove event */
> >>>>    }
> >>>>  }
> >>>>}
> >>>>
> >>>>But how do I remove the "player_say" event from reaching
> the other
> >>>>players?
> >>>>
> >>>>Thanks in advance.
> >>>>
> >>>>Paul
> >>>>
> >>>>
> >>>>
> >>>>_______________________________________________
> >>>>To unsubscribe, edit your list preferences, or view the
> >>>>
> >>>>
> >>>list archives,
> >>>
> >>>
> >>>>please visit:
> >>>>http://list.valvesoftware.com/mailman/listinfo/hlcoders
> >>>>
> >>>>
> >>>>
> >>>>
> >>>--
> >>>
> >>>_______________________________________________
> >>>To unsubscribe, edit your list preferences, or view the list
> >>>archives, please visit:
> >>>http://list.valvesoftware.com/mailman/listinfo/hlcoders
> >>>
> >>>
> >>>
> >>
> >>_______________________________________________
> >>To unsubscribe, edit your list preferences, or view the
> list archives,
> >>please visit:
> >>http://list.valvesoftware.com/mailman/listinfo/hlcoders
> >>
> >>
> >>
> >>
> >--
> >
> >_______________________________________________
> >To unsubscribe, edit your list preferences, or view the list
> archives, please visit:
> >http://list.valvesoftware.com/mailman/listinfo/hlcoders
> >
> >
> >
> >
>
> --
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list
> archives, please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>



_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to