Initially, I had some trouble with this. It always ended up being a pain
in the ass to try and get the code to recognize gEngfuncs. I messed around
with a common header file and some code in there. Unfortunately, gEngfuncs
can't be accessed in the header file because to access it I need cl_util.h
which conflicts with other headers. Finally, I dropped that idea and put the
code into source files instead. I decided to make it inline, but THAT didn't
work at all. It was giving me unresolved external errors even though the
function existed. When I took out the inline keyword, it compiled. I tested,
and it worked great! Thanks to everyone who helped out! It's finally done.
=D

- Varlock

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 15, 2002 7:52 AM
Subject: Re: [hlcoders] Server CVAR's on Client


> >    Because the CVAR I am dealing with must be used by a weapon, it has
to
> >be accessible in a weapon file shared between the server and the client.
My
> >main problem here is the CVAR_GET_FLOAT function used on the server is
not
> >accesible by the client. The equivalent client-side function
> >(gEngfuncs.pfnGetCvarFloat) can't be used in a weapons file because the
> >weapons file is shared between the server and the client.
>
> Which suggests that you might want to create a function, int
GlobalCvarGetFloat(char *cvarname), which returns the value of the cvar
using either gEngfuncs.pfnGetCvarFloat or CVAR_GET_FLOAT anywhere those
functions are available in the client and server DLLs respectively - thus
existing identically in both DLLs - and then use extern int
GlobalCvarGetFloat(char *cvarname); to get it available in your shotgun code
file. Then, GlobalCvarGetFloat("mp_aquashotgun") should return the value you
want, whether serverside or nay.
>
> Toodle pip.
>
> -randomnine-
>
>
> ----------
> Personalise your email address at http://another.com
> THINK: your slogan or email address on a gorgeous mousemat
> CLICK HERE http://another-shop.com

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

Reply via email to