--
[ Picked text/plain from multipart/alternative ]
Looks like you're sending chat from the console say. You can do that even
easier. Just run a server command:
engine->ServerCommand("say hello from the server!\n");
On 4/7/06, LDuke <[EMAIL PROTECTED]> wrote:
>
> Events report that something has happened. They don't cause it to happen.
> You can't kill someone by firing a "player_death" event, or caue chat to
> happen by firing a "player_chat" event.
>
> You're in luck. If you want to send player chat, you'll have to use
> engine->UserMessageBegin(), write your data to the bf_write* it returns, and
> then send it with engine->MessageEnd().
>
> You can look up the message ID with GetUserMessageInfo() from the
> ServerDLL interface. Be warned that there is a bug with that interface that
> will cause it to crash if you give it an index higher than is available in
> the mod running your plugin.
>
> Hope that helps.
>
> Grant
> (L. Duke)
>
>
>
> On 4/7/06, Paul Kirby <[EMAIL PROTECTED]> wrote:
> >
> > Hello All
> >
> > I am trying to fire an event within a Source Server Plug-in.
> >
> > In GameEvents.res there is the following:
> >
> > "player_chat" // a public player chat
> > {
> > "teamonly" "bool" // true if team only chat
> > "userid" "short" // chatting player
> > "text" "string" // chat text
> > }
> >
> > [code]
> > CON_COMMAND_F( say_new, "Test, Console say.", FCVAR_GAMEDLL)
> > {
> > KeyValues * force_event;
> > force_event = new KeyValues( "player_chat" );
> > force_event->SetInt("teamonly", true );
> > /* Using 0 for userid so that it says its from the console */
> > force_event->SetInt("userid", 0 );
> > force_event->SetString("text","Blah blah blah");
> > gameeventmanager->FireEvent( force_event );
> > }
> > [end of code]
> >
> > This don't seem to want to work.
> >
> > Please don't say try using Source: Metamod ,due to I don't want it to
> > use
> > that.
> >
> > I gather that I am correct in using FireEvents(), or am I suppose to use
> >
> > FireEventClientOnly() or FireEventServerOnly() ?
> >
> > I want all players to see this message, and it has to be a chat message.
> >
> > 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