.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   Help! Command register! (http://forums.bots-united.com/showthread.php?t=728)

InternetNightmare 12-02-2004 22:02

Help! Command register!
 
Hi there again!

Well I'm new to MetaMOD coding, so I need help! :)
(g_engfuncs.pfnAddServerCommand)("addhealth", HCommand);
How do I get player who wrote the Command, and change his health?

Thanks for help!


InternetNightmare

BAStumm 13-02-2004 08:57

Re: Help! Command register!
 
you need to hook ClientCommand() in your code. then you might have something like:

Code:

                // JUST A TEST COMMAND
                if (FStrEq(pcmd, "admin_test"))
                {
                        printf("RECEIVED CLIENT COMMAND from %s\n",STRING(pEntity->v.netname));
                        SERVER_COMMAND("say Your WISH is my command...\n");
                        RETURN_META(MRES_HANDLED);
                } // END TEST COMMAND


Pierre-Marie Baty 13-02-2004 14:15

Re: Help! Command register!
 
yes,

pfnAddServerCommand() adds a SERVER command only ; that is, a server the admin can type on the SERVER CONSOLE, but not the clients.

If you want to hook on every command the client types, hook ClientCommand like Brian says.

InternetNightmare 13-02-2004 17:50

Re: Help! Command register!
 
Oh! Pierre-Marie Baty I didn't know that!
Thanks BAStumm!


All times are GMT +2. The time now is 05:03.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.