搜索
楼主: Cr@zyTreE

有关query_client_cvar

[复制链接]
发表于 2008-5-19 12:39:10 | 显示全部楼层 来自 中国–北京–北京–海淀区

回复: 有关query_client_cvar

QueryClientCvarValue

void (*pfnQueryClientCvarValue)( const edict_t *player, const char *cvarName );
from alfred@valvesoftware.com, via HLCoders
Calling this function requests the value of cvarName from player. The result is returned via a callback from NEW_DLL_FUNCTIONS.

comments:
Added 2005-08-11, no SDK update. (Available in patched SDK as of hlsdk-2.3-p2.)
Use of this function is DEPRECATED. It has been obsoleted by the pfnQueryClientCvarValue2() function. See below.
This API can lead to conflicts when you query more than one cvar from a player at a time. When using this function, use IS_QUERYING_CLIENT_CVAR to check if another plugin is querying before you do so. Use of this function is strongly advised against. Instead use the pfnQueryClientCvarValue2() function.
QueryClientCvarValue2

void (*pfnQueryClientCvarValue2)( const edict_t *player, const char *cvarName, int requestID );
from alfred@valvesoftware.com, via hlds_apps
Calling this function requests the value of cvarName from player and returns to you the supplied requestID on success (or failure). The response is sent to a pfnCvarValue2 callback in the NEW_DLL_FUNCTIONS structure.

comments:
Added 2005-11-23, no SDK update. (Available in patched SDK as of hlsdk-2.3-p3.)
回复

使用道具 举报

发表于 2008-5-19 12:40:45 | 显示全部楼层 来自 中国–北京–北京–海淀区

回复: 有关query_client_cvar

amxx1.6 和 amxx1.8分别用了上面两个函数,1.8用的是后面这个,比第一个安全。不过可以自己写一个模块用第一个函数的形式,这样就可以挂在amxx1.8下面用了,具体实现我这里就不赘述了。
回复

使用道具 举报

发表于 2008-5-19 12:41:53 | 显示全部楼层 来自 中国–北京–北京–海淀区

回复: 有关query_client_cvar

我的回复是基于zwfgdlc的回复,因为我也没研究过这个函数到底在哪个版本下面能用
回复

使用道具 举报

 楼主| 发表于 2008-5-19 13:20:54 | 显示全部楼层 来自 中国–广东–深圳

回复: 有关query_client_cvar

Post by jim_yang
amxx1.6 和 amxx1.8分别用了上面两个函数,1.8用的是后面这个,比第一个安全。不过可以自己写一个模块用第一个函数的形式,这样就可以挂在amxx1.8下面用了,具体实现我这里就不赘述了。

感谢你的回复,我是在整合 有关手雷的插件的时候看到这个插件的,既然1.8用不了,我也就不去理睬他了。大不了不用更改玩家客户端的cvar。只添加玩家被手雷炸,屏幕会震动,并且被炸飞起来就可以了。

那个耳鸣的声音也很不舒服。。。

把上面的问题提出来,是看看大家有没有成功使用过这个函数。(我在论坛上看过有人说加载后客户端进不了服的问题)。:cool:
回复

使用道具 举报

发表于 2008-5-19 16:54:49 | 显示全部楼层 来自 中国–福建–龙岩

回复: 有关query_client_cvar

Post by zwfgdlc
这个问题我在官方问过,说不支持no-steam,AMXX1.60可以,1.70以上不能用在no-steam服务器,008那个反作弊插件就是因为这个函数的问题一直不支持AMXX1.70以上的版本.
我1.76c可以使用,我觉得这个不是no-steam问题
回复

使用道具 举报

 楼主| 发表于 2008-7-8 21:04:54 | 显示全部楼层 来自 中国–广东–深圳

回复: 有关query_client_cvar

[php]
RE: [hlds_apps] Updated Half-Life 1 client cvar query interface
Manip
Wed, 23 Nov 2005 04:51:03 -0800
Very nice; shame the latest update causes all the Linux servers to crash
when the first person connects. :-/
You guys should talk to Microsoft about testing strategies; or perhaps fire
some managers and hire some people that have taken Software Engineering 101.
... No offence...
-----Original Message-----
From: [EMAIL PROTECTED]
[EMAIL PROTECTED] On Behalf Of Alfred Reynolds
Sent: 22 November 2005 19:46
To: hlcoders@list.valvesoftware.com; hlds_apps@list.valvesoftware.com
Subject: [hlds_apps] Updated Half-Life 1 client cvar query interface
We have updated the client CVAR query interface in Half-Life 1 with two
new functions that will help you better track queries and responses.
The enginefuncs_t structure has had this function added to the end:
        void (*pfnQueryClientCvarValue2)( const edict_t *player, const
char *cvarName, int requestID );
It will query a cvar value from a player and return to you the supplied
requestID on success (or failure).
The response is sent to a pfnCvarValue2 callback in the
NEW_DLL_FUNCTIONS structure, its full definition is:
typedef struct
{
        // Called right before the object's memory is freed.
        // Calls its destructor.
        void    (*pfnOnFreeEntPrivateData)(edict_t *pEnt);
        void                    (*pfnGameShutdown)(void);
        int  (*pfnShouldCollide)( edict_t *pentTouched, edict_t *pentOther );
        void   (*pfnCvarValue)( const edict_t *pEnt,const char *value );
        void  (*pfnCvarValue2)( const edict_t *pEnt,int requestID, const char *cvarName, const char *value );
} NEW_DLL_FUNCTIONS;
When the pfnQueryClientCvarValue2() completes it will call
pfnCvarValue2() with the request ID you supplied earlier, the name of
the cvar you requested and the value of that cvar. On failure (i.e that
user is not connected or the cvar does not exist) the value of the
returned cvar will be "Bad CVAR request". If you specify an invalid
player edict you will get "Bad Player" as the value response.
[/php]
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表