Re: [hlcoders] how to use cvars? (removing whitespaces)

2009-12-09 Thread Saul Rennison
I think it's platform independent. It's 10pm now JoeX, however if you don't understand the code I can comment it for you and I'll send you my clientplugin binaries tomorow. On Wednesday, December 9, 2009, Didrole wrote: > strtools.h > > char *V_strncat(char *, const char *, size_t destBufferSize

Re: [hlcoders] how to use cvars? (removing whitespaces)

2009-12-09 Thread JoeX
ok i managed to do it by myself! void RemoveWhitespaceCallback(IConVar *var, const char *pOldValue, float flOldValue) { ConVar *pVar = (ConVar*)var; if(!pVar) { Warning("Cannot cast IConVar %s to ConVar\n", var->GetName()); return; } char pszNewValue[512];

Re: [hlcoders] how to use cvars? (removing whitespaces)

2009-12-09 Thread Didrole
strtools.h char *V_strncat(char *, const char *, size_t destBufferSize, int max_chars_to_copy=COPY_ALL_CHARACTERS ); [...] #define Q_strncatV_strncat So Q_strncat = V_strncat and V_strncat is the Valve's version of strncat 2009/12/9 JoeX > aha! > > it just... strncat > > but..

Re: [hlcoders] how to use cvars? (removing whitespaces)

2009-12-09 Thread JoeX
aha! it just... strncat but a conceptual question. why? qhy defineit with a Q_?. 2009/12/9 Didrole > Q_strncat is nothing more than a classic strncat . > > Replacing whitespaces with underscores is a very easy operation, if you are > not able to do that yourself you should re-

Re: [hlcoders] how to use cvars? (removing whitespaces)

2009-12-09 Thread Didrole
Q_strncat is nothing more than a classic strncat . Replacing whitespaces with underscores is a very easy operation, if you are not able to do that yourself you should re-read some c/c++ lessons. 2009/12/9 JoeX > wow!, it woks! > > and. i never have seen that Q_strncat method. of fun

Re: [hlcoders] how to use cvars? (removing whitespaces)

2009-12-09 Thread JoeX
wow!, it woks! and. i never have seen that Q_strncat method. of function (: hot you edit that code to replace whitespaces with underscores? :D hey mister Saul, what is about your proyect?, can i see it working? :D 2009/12/9 Saul Rennison > http://cpp.pastebin.com/f2a5306a8 > > Tha

Re: [hlcoders] how to use cvars? (removing whitespaces)

2009-12-09 Thread Saul Rennison
http://cpp.pastebin.com/f2a5306a8 Thanks, - Saul. 2009/12/9 JoeX > thank you David Kraeutmann and keeper! > > from you keeper, i read a lot before, just googling. in this 3 days of > workshop, u'r anwers helped me a lot, thank you > > i'll try to implement the callback, and wait the implem

Re: [hlcoders] how to use cvars? (removing whitespaces)

2009-12-09 Thread JoeX
thank you David Kraeutmann and keeper! from you keeper, i read a lot before, just googling. in this 3 days of workshop, u'r anwers helped me a lot, thank you i'll try to implement the callback, and wait the implementation of Mr. Saul :D 2009/12/9 Keeper > Look at the definition of ConVar .

Re: [hlcoders] how to use cvars? (removing whitespaces)

2009-12-09 Thread Keeper
Look at the definition of ConVar ... one of them includes a function call back: void testentry ( IConVar *pVar, char const *pOldString, float pOldFloat) { // do your entry examination here } static ConVar empty_cvar("plugin_empty", "0", 0, "Example plugin cvar", (FnChangeCallback_t)te

Re: [hlcoders] how to use cvars? (removing whitespaces)

2009-12-09 Thread Saul Rennison
I'm making a TF client-side plugin. I've currently hooked many functions in IBaseClientDLL :D On Wednesday, December 9, 2009, JoeX wrote: > what is that mr. saul? > > 2009/12/9 Saul Rennison > >> You may also be interested to know I'm making a stub/base clientplugin :) >> >> On Wednesday, Decemb

Re: [hlcoders] how to use cvars? (removing whitespaces)

2009-12-09 Thread JoeX
what is that mr. saul? 2009/12/9 Saul Rennison > You may also be interested to know I'm making a stub/base clientplugin :) > > On Wednesday, December 9, 2009, JoeX wrote: > > ok!, thank you so much!. again! :D > > > > 2009/12/9 Saul Rennison > > > >> You could create a ConVar callback (las

Re: [hlcoders] how to use cvars? (removing whitespaces)

2009-12-09 Thread David Kraeutmann
Declare a function with return type and parameters matching the prototype below: void ChangeCallback( IConVar* var, const char* pOldValue, float pOldValue ); Then implement it (read the old value into a temporary string, say, a CUtlString, strip the spaces, then set the new value using var->SetVa

Re: [hlcoders] how to use cvars? (removing whitespaces)

2009-12-09 Thread Saul Rennison
You may also be interested to know I'm making a stub/base clientplugin :) On Wednesday, December 9, 2009, JoeX wrote: > ok!, thank you so much!. again! :D > > 2009/12/9 Saul Rennison > >> You could create a ConVar callback (last argument of the ConVar class >> constrictor) to remove all whit

Re: [hlcoders] how to use cvars? (removing whitespaces)

2009-12-09 Thread JoeX
ok!, thank you so much!. again! :D 2009/12/9 Saul Rennison > You could create a ConVar callback (last argument of the ConVar class > constrictor) to remove all whitespaces from the string. If you wait a > few hours I could do it for you. > > On Wednesday, December 9, 2009, JoeX wrote: > > f

Re: [hlcoders] how to use cvars? (removing whitespaces)

2009-12-09 Thread Saul Rennison
You could create a ConVar callback (last argument of the ConVar class constrictor) to remove all whitespaces from the string. If you wait a few hours I could do it for you. On Wednesday, December 9, 2009, JoeX wrote: > first i want to thank AzuiSleet, Saul Rennison and Jacob Heidt for their >

[hlcoders] how to use cvars? (removing whitespaces)

2009-12-09 Thread JoeX
first i want to thank AzuiSleet, Saul Rennison and Jacob Heidt for their support in the last topic about "tf2 client plugin question", your help is much appreciated. Thank you again in documentation, i can't find how to run code, when the user change the value of a cvar... i got this sta

Re: [hlcoders] Modifying Font tall on the fly

2009-12-09 Thread Janek
First of all, thank you Garry for helping me. Anyway, I still have problem to do what I want. My goal is to be able to specify a size for the crosshair. Currently I'm proceeding like this: CHudTexture *tex = new CHudTexture(); if ( !tex ) return; // Key Name is the sprite name Q_strncpy( tex->s

Re: [hlcoders] tf2 client plugin question

2009-12-09 Thread JoeX
i looked at sourcemod source code (wow, so many "souce"s) but it was too difficult to understand it, because, it was made in a framework, that i must to leran first.. sourcemod, may it be easier... but if a made a CLIENT plugin with it.. it will need a sourcemod.dll, to make my plugin

Re: [hlcoders] tf2 client plugin question

2009-12-09 Thread Jacob Heidt
I would recommend you take a look at MetaMod:Source, even if you don't use the framework for your server plugin, the underlying source code should help you significantly in understanding and creating a server plug in. -jheidt -Original Message- From: hlcoders-boun...@list.valvesoftware.co

Re: [hlcoders] tf2 client plugin question

2009-12-09 Thread Saul Rennison
You're using IVEngineServer to get the client entity-- this will never work. Thanks, - Saul. 2009/12/9 JoeX > thank you AzuiSleet! > > but it was needed to put: > > #include > > that's make it work, thanks A LOT > > now, i have other noob questions > > (1) is ok to use: engineclient->

Re: [hlcoders] tf2 client plugin question

2009-12-09 Thread JoeX
thank you AzuiSleet! but it was needed to put: #include that's make it work, thanks A LOT now, i have other noob questions (1) is ok to use: engineclient->ClientCmd_Unrestricted(msg); ??? i dont know how to get rid of the FCVAR_CLIENTCMD_CAN_EXECUTE error in game console

Re: [hlcoders] tf2 client plugin question

2009-12-09 Thread Saul Rennison
You need \n or ; at the end of your command string. On Wednesday, December 9, 2009, AzuiSleet wrote: > Well you should be getting IVEngineClient instead of IVEngineServer, > it has the method you are looking for. > > On Wed, Dec 9, 2009 at 2:10 AM, JoeX wrote: >> hello everyone! >> >> this is my

Re: [hlcoders] Modifying Font tall on the fly

2009-12-09 Thread Garry Newman
Here's what I do in GMod: HFont font = vgui::surface()->CreateFont(); Assert(font); if ( !vgui::surface()->SetFontGlyphSet( font, strName, iTall, iWeight, 0, 0, iFlags ) { // Error reporting etc } garry On Wed, Dec 9, 2009 at 11:21 AM, Janek wrote: > In fact I would like to understand how

Re: [hlcoders] Modifying Font tall on the fly

2009-12-09 Thread Janek
In fact I would like to understand how to recreate it. Is it possible to fill in a structure including all parameters (keyvalues) describing a font in clientscheme.res and passing it using SetFont ? J. 2009/12/9 Garry Newman > AFAIK you need to destroy and recreate it. It isn't just rendering t

Re: [hlcoders] tf2 client plugin question

2009-12-09 Thread AzuiSleet
Well you should be getting IVEngineClient instead of IVEngineServer, it has the method you are looking for. On Wed, Dec 9, 2009 at 2:10 AM, JoeX wrote: > hello everyone! > > this is my first post, so let me introduce myself. My name is Joe, and i'm > from Chile (latin america), as you can see, in

Re: [hlcoders] Modifying Font tall on the fly

2009-12-09 Thread Garry Newman
AFAIK you need to destroy and recreate it. It isn't just rendering text, it's drawing all the characters to a texture and then copying them over (educated guess). garry On Wed, Dec 9, 2009 at 9:01 AM, Janek wrote: > No idea ? This tall parameter should be somewhere. > > J. > > 2009/12/7 Janek

[hlcoders] tf2 client plugin question

2009-12-09 Thread JoeX
hello everyone! this is my first post, so let me introduce myself. My name is Joe, and i'm from Chile (latin america), as you can see, inglish is not my native language, but i'll do my best :D, thank you all in advance for your attention. ok, here's where i'm stuck i'm trying to make a clien-sid

Re: [hlcoders] Modifying Font tall on the fly

2009-12-09 Thread Janek
No idea ? This tall parameter should be somewhere. J. 2009/12/7 Janek > Hi all, > > In ClientScheme.res we can specify a font codename and specify its features > for a specific resolution by using keyvalues for "name", "tall", "weight"... > In our codeline we're refering to this font using SetF