To get the player from a console command <server side>, just use something
like this:

void con_command_x( void ) {

                CBasePlayer* pPlayer = UTIL_GetCommandClient();

}
ConCommand console_con_command_x("command_x", con_command_x, "testing
command", FCVAR_CHEAT);


From: "Drak" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: <[EMAIL PROTECTED]>
Subject: [hlcoders] New console commands
Date: Sat, 14 Apr 2007 17:16:24 -0400

This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
I'm have problems trying to make new console commands (Source). Are they
able to point to class members? Such as:

void randomClass::something( void )
{
     // do something
}

static ConCommand
new_command("new_command",randomClass::something,"?",FCVAR_CHEAT);

But obviosuly, this didn't compile... As for the second thing, why I need
it to be a class, is that I need to use "FindEntityForward", but how am i
suppose to grab the player using the command. Which is needed for the
second perimeter of "FindEntityForward". For the very last thing,
"FindEntityForward" is defined in player.cpp. Would I need to copy it into
my new file?
Sorry for such the nubbish questions, thanks.
--


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


_________________________________________________________________
Get a FREE Web site, company branded e-mail and more from Microsoft Office
Live! http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/


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

Reply via email to