.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
Help! Command register!
Old
  (#1)
InternetNightmare
Guest
 
Status:
Posts: n/a
Default Help! Command register! - 12-02-2004

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
  
Reply With Quote
Re: Help! Command register!
Old
  (#2)
BAStumm
Member
 
BAStumm's Avatar
 
Status: Offline
Posts: 138
Join Date: Jan 2004
Location: Spokane, WA USA
Default Re: Help! Command register! - 13-02-2004

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







Last edited by BAStumm; 13-02-2004 at 10:02..
  
Reply With Quote
Re: Help! Command register!
Old
  (#3)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Help! Command register! - 13-02-2004

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.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Help! Command register!
Old
  (#4)
InternetNightmare
Guest
 
Status:
Posts: n/a
Default Re: Help! Command register! - 13-02-2004

Oh! Pierre-Marie Baty I didn't know that!
Thanks BAStumm!
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com