Raised This Month: $ Target: $400
 0% 

serverplugin quest client command send command to client


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
morxxx
Junior Member
Join Date: Jan 2005
Old 01-20-2005 , 05:09   serverplugin quest client command send command to client
Reply With Quote #1

Ok i want to know how i can send a command to the client when he uses a specific command. like
he typed "name sensored"
the server will send to him
"name kid"

and when he has saved "name sensored" in his config.cfg that the server will check this and send the command "name kid" to him

does someone have an idea ?

greets
morxxx is offline
XAD
Senior Member
Join Date: Mar 2004
Location: Sweden
Old 02-03-2005 , 07:26   Re: serverplugin quest client command send command to client
Reply With Quote #2

Quote:
Originally Posted by morxxx
Ok i want to know how i can send a command to the client when he uses a specific command. like
he typed "name sensored"
the server will send to him
"name kid"
Yes... but name is not a command it's a cvar... BUT are you really coding HL2 mod or server plugin (otherwise this is the wrong section)???

Quote:
Originally Posted by morxxx
and when he has saved "name sensored" in his config.cfg that the server will check this and send the command "name kid" to him
Why?? Commands in config.cfg is executed when the mod is started, ie covered by previous problem, so why do you care what is actually saved in the file??

/X
XAD is offline
anxiro
Member
Join Date: Jan 2005
Old 02-08-2005 , 13:24  
Reply With Quote #3

Hi.

To check his value of a CVAR (name is this case) you can try to use:
Code:
const char * name =  engine->GetClientConVarValue(engine->IndexOfEdict(pEntity), "name" );
Now when you use for example:
Code:
Q_snprintf(gBuffer,128,"His name is: %s  \n",name);
It will return his name, because we used "name" for the CVAR "name".
It's difficult, another one:
Code:
const char * name =  engine->GetClientConVarValue(engine->IndexOfEdict(pEntity), "sensitivity" );
Now when you use for example:
Code:
Q_snprintf(gBuffer,128,"His sensitivity is: %d  \n",name);
Again, the thingy we set (name) is 'asking' for the sensitivity.
(%d = numeric)

Maybe this can help?
anxiro is offline
Send a message via ICQ to anxiro
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 02-08-2005 , 13:50  
Reply With Quote #4

Umm.. If I'm not completly mistaken... You should use %s in your second mistake as well (because you pass a string as parameter).
__________________
hello, i am pm
PM is offline
anxiro
Member
Join Date: Jan 2005
Old 02-20-2005 , 05:28  
Reply With Quote #5

Sorry;) It was just out of the blue in my head;)
anxiro is offline
Send a message via ICQ to anxiro
Reply



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


All times are GMT -4. The time now is 08:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode