注册 登录
MOD中国同盟社 返回首页

编程爱好者 http://www.modchina.com/?25792 [收藏] [复制] [分享] [RSS] 空间主要记录一些AMXX代码

日志

fw_UpdateClientData与fw_AddToFullPack的一些用法

热度 6已有 1474 次阅读2011-6-12 13:52 |个人分类:Amxx调试

http://forums.alliedmods.net/showthread.php?t=85775&highlight=CD_Velocity&page=3

/* *   ----------------------------- *   -*- Bandwidth Reducer 0.1 -*- *   ----------------------------- * * #1. Add these to your server.cfg. * *   sys_ticrate 33 *   sv_minupdaterate 10 *   sv_maxupdaterate 10 *   sv_minrate 0 *   sv_maxrate 0 *   sv_voiceenable 0 * * Note: this settings are meant for Zombie-Mods. For * normal CS you'll probably want faster response times. * * #2. Set one or more of the following to 1 (enabled) to reduce bandwidth. * Note: Each has its own side effect you should be aware of. * * Settting          // Side effect when enabled * --------          // -------------------------*/ #define CD_DONT_SEND_STEPSOUND    0 // Players won't hear their own footstep sounds. #define CD_DONT_SEND_PUNCHANGLE  0    // Players won't see the actual weapon's recoil if using cl_lw 1. #define CD_DONT_SEND_NEXTATTACK  0    // Players may see weapons fire when they shouldn't if using cl_lw 1. #define CD_DONT_SEND_VELOCITY      0  // Players may experience sloppy movements. #define ES_DONT_SEND_ORIGIN_SELF    1   // None that I can see. #define ES_DONT_SEND_ANGLES_SELF    0   // If using 3rd person view, players will see themselves looking at an odd direction. #define ES_DONT_SEND_FRAME_SELF  0    // If using 3rd person view, players will see their own weapon animations incorrectly. #define ES_DONT_SEND_ANIMTIME_SELF  0 // If using 3rd person view, players will see their own weapon animations incorrectly. #define ES_DONT_SEND_BLENDING_SELF  1 // None that I can see. #define ES_DONT_SEND_ANGLES_OTHERS  0 // Players will see others looking at an odd direction #define ES_DONT_SEND_FRAME_OTHERS   0  // Players will see others' weapon animations incorrectly. #define ES_DONT_SEND_ANIMTIME_OTHERS    0   // Players will see others skipping around. #define ES_DONT_SEND_BLENDING_OTHERS    1   // None that I can see. // #3. You're done. That's the best you'll get out of your connection. #include <amxmodx> #include <fakemeta> public plugin_init() {     register_plugin("Bandwidth Reducer", "0.1", "MeRcyLeZZ")     register_forward(FM_UpdateClientData, "fw_UpdateClientData", 1)     register_forward(FM_AddToFullPack, "fw_AddToFullPack", 1) } public client_putinserver(id) set_task(5.0, "set_cmdrate", id) public set_cmdrate(id) client_cmd(id, "cl_cmdrate 10") public fw_UpdateClientData(player, sendweapons, handle) { #if CD_DONT_SEND_STEPSOUND     set_cd(handle, CD_flTimeStepSound, 999 ) #endif #if CD_DONT_SEND_PUNCHANGLE     set_cd(handle, CD_PunchAngle, Float:{ 0.0, 0.0, 0.0 } ) #endif #if CD_DONT_SEND_NEXTATTACK     set_cd(handle, CD_flNextAttack, 0.0 ) #endif #if CD_DONT_SEND_VELOCITY     set_cd(handle, CD_Velocity, Float:{ 0.0, 0.0, 0.0 } ) #endif } public fw_AddToFullPack(handle, e, ent, host, hostflags, player, pset) {     if (!player) return;         if (host == ent)     { #if ES_DONT_SEND_ORIGIN_SELF         set_es(handle, ES_Origin, Float:{ 0.0, 0.0, 0.0 }) #endif #if ES_DONT_SEND_ANGLES_SELF         set_es(handle, ES_Angles, Float:{ 0.0, 0.0, 0.0 }) #endif #if ES_DONT_SEND_FRAME_SELF         set_es(handle, ES_Frame, 1.0 ) #endif #if ES_DONT_SEND_ANIMTIME_SELF         set_es(handle, ES_AnimTime, 1.0 ) #endif #if ES_DONT_SEND_BLENDING_SELF         set_es(handle, ES_Blending, { 0, 0, 0, 0} ) #endif     }     else     { #if ES_DONT_SEND_ANGLES_OTHERS         set_es(handle, ES_Angles, Float:{ 0.0, 0.0, 0.0 }) #endif #if ES_DONT_SEND_FRAME_OTHERS         set_es(handle, ES_Frame, 1.0 ) #endif #if ES_DONT_SEND_ANIMTIME_OTHERS         set_es(handle, ES_AnimTime, 1.0 ) #endif #if ES_DONT_SEND_BLENDING_OTHERS         set_es(handle, ES_Blending, { 0, 0, 0, 0} ) #endif     } }

路过

鸡蛋
1

鲜花

握手
4

雷人

刚表态过的朋友 (5 人)

收藏 分享 转发到开心网 举报

发表评论 评论 (3 个评论)

回复 Robert 2011-6-18 17:50
连换行都没有……  
回复 p5248891 2011-6-18 20:11
Robert: 连换行都没有……   
直接copy的,但有网址转连纳,日志难换行,就懒得去换
回复 风中探戈 2012-6-11 19:06
学习学习

facelist

您需要登录后才可以评论 登录 | 注册
验证问答 换一个 验证码 换一个

回顶部