搜索
查看: 5015|回复: 14

[AMXX 带源码] 求牛人帮我改两款源码

[复制链接]
发表于 2010-12-30 20:07:35 | 显示全部楼层 |阅读模式 来自 中国–广东–河源
本帖最后由 q7818948 于 2010-12-31 06:54 编辑

/* AMX Mod X
*   Flashbug fix - version 1.0.0 (stable)
*
* by Darkdreams Studios
*
* This file is _NOT_ part of AMX Mod X (Third party).
*
*
*  This program is free software; you can redistribute it and/or modify it
*  under the terms of the GNU General Public License as published by the
*  Free Software Foundation; either version 2 of the License, or (at
*  your option) any later version.
*
*  This program is distributed in the hope that it will be useful, but
*  WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
*  General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software Foundation,
*  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*  In addition, as a special exception, the author gives permission to
*  link the code of this program with the Half-Life Game Engine ("HL
*  Engine") and Modified Game Libraries ("MODs") developed by Valve,
*  L.L.C ("Valve"). You must obey the GNU General Public License in all
*  respects for all of the code used other than the HL Engine and MODs
*  from Valve. If you modify this file, you may extend this exception
*  to your version of the file, but you are not obligated to do so. If
*  you do not wish to do so, delete this exception statement from your
*  version.
*
*
* For technical support with this plugin, please visit its project webspace on
* darkdreams studios wiki at:
*
*   http://www.darkdreams.se/
*
* Thank you,
*   The development team
*/

#include <amxmodx>
#include <amxmisc>
#include <engine>

//#define DEBUG
#define MAX_FLASHZONES 40

new configsDir[64]
new fz[MAX_FLASHZONES+1][4]
new cntVectors

new g_fb_model[] = "models/w_flashbang.mdl"

public plugin_init() {
        new mapname[32]
       
        register_plugin("Flashbug-fix", "1.0.5", "Darkdreams Studios")

        get_mapname(mapname,31)
        get_configsdir(configsDir, 63)

        format(configsDir, 63, "%s/flashconf/%s.ini", configsDir, mapname)
        if (!file_exists(configsDir))
        {
                server_print("[FLASHBUG] Config ^"%s^" doesn't exist.", configsDir)
                return PLUGIN_HANDLED_MAIN
        }
       
        load_config()

        register_think("grenade","think_grenade");
       
        return PLUGIN_CONTINUE
}
public think_grenade(ent)
{
        new Float:org1[3]
        new org2[3]
        new hackzone[3]
        new model[32];
       
        entity_get_string(ent,EV_SZ_model,model,31);
        if (equal(model, g_fb_model))
        {
                entity_get_vector(ent,EV_VEC_origin,org1)

                org2[0] = floatround( org1[0] )
                org2[1] = floatround( org1[1] )
                org2[2] = floatround( org1[2] )

#if defined DEBUG //use to determine flashbug zones
                client_print(0,print_chat, "%ix %iy %iz", org2[0],org2[1],org2[2])
#endif

                for (new i=0;i<cntVectors;i++)
                {
                        hackzone[0] = fz[0]
                        hackzone[1] = fz[1]
                        hackzone[2] = fz[2]

                        if (get_distance(org2, hackzone) < fz[3])
                        {
                                client_print(0, print_chat, "[FLASHFIX] Removed a flashbang (%ix %iy %iz)", org2[0],org2[1],org2[2])
                                remove_entity( ent )
                                //new id = entity_get_edict(ent, EV_ENT_owner) //to kick/ban client
                                break
                        }
                }
        }
}
public load_config()
{
        new line = 0, textline[256], len, i=0
        const SIZE = 63
        new line_x[SIZE + 1], line_y[SIZE + 1], line_z[SIZE + 1], line_proximity[SIZE + 1], parsedParams
       
        while ((line = read_file(configsDir, line, textline, 255, len)))
        {
                if (len == 0 || textline[0] == ';')
                        continue // comment line
               
                parsedParams = parse(textline, line_x, SIZE, line_y, SIZE, line_z, SIZE, line_proximity, SIZE)
               
                if (parsedParams != 4)
                {
                        server_print("[FLASHBUG] Error/warning in config (%s)", configsDir)
                        continue
                }
               
                fz[0] = str_to_num(line_x)
                fz[1] = str_to_num(line_y)
                fz[2] = str_to_num(line_z)
                fz[3] = str_to_num(line_proximity)
                i++
        }
       
        cntVectors = i
        server_print("[FLASHBUG] Loaded %i vector(s) for this map", cntVectors)
}


flashfix.sma  当检测到玩家卡闪光的时候say Wo SB,  Wo Ka Bug Shou Lei

求高手改改了。。。。
 楼主| 发表于 2010-12-31 06:55:32 | 显示全部楼层 来自 中国–广东–河源
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fun>
       
#define GIFT_MODEL "models/AcFun_Models/giftbox.mdl"
#define GIFT_SOUND "AcFun_Sound/touch.wav"
#define GIFT_NAME "lunatic_gift"
#define MAX_SPAWNS 60
#define CFG_RELOAD 1

new Float:g_SpawnVecs[MAX_SPAWNS][3];
new Float:g_SpawnAngles[MAX_SPAWNS][3];
new Float:g_SpawnVAngles[MAX_SPAWNS][3];
new g_TotalSpawns = 0;
new gift_flags;
new bool:SpawnIng=false;
new bool:GetIng=false;

public plugin_init()
{
        register_plugin("大礼包插件", "1.0", "小坏 && sakulekingz");
        register_event("RoundTime", "start_round", "bc")
        register_event("SendAudio", "end_round", "a", "2&%!MRAD_terwin", "2&%!MRAD_ctwin", "2&%!MRAD_rounddraw");
        register_touch(GIFT_NAME, "player", "touch_gift");
        gift_flags = register_cvar("amx_gift_flags","z");
}

public read_cfg(action, line[], section[])
{
        if (action == CFG_RELOAD)
        {
                readSpawns();
        }
}

public plugin_cfg()
                readSpawns();

public plugin_precache()
{
        precache_model(GIFT_MODEL);
        precache_sound(GIFT_SOUND);
       
}

public readSpawns()
{
        new Map[32], config[32],  MapFile[64]
        get_mapname(Map, 31)
        get_configsdir(config, 31)
        format(MapFile, 63, "%s\acfun\%s.cfg", config, Map)
        g_TotalSpawns = 0;
       
        if (file_exists(MapFile))
        {
                new Data[124], len
                new line = 0
                new pos[12][8]
                   
                while(g_TotalSpawns < MAX_SPAWNS && (line = read_file(MapFile , line , Data , 123 , len) ) != 0 )
                {
                        if (strlen(Data)<2 || Data[0] == '[')
                                continue;

                        parse(Data, pos[1], 7, pos[2], 7, pos[3], 7, pos[4], 7, pos[5], 7, pos[6], 7, pos[7], 7, pos[8], 7, pos[9], 7, pos[10], 7);
                       
                        // Origin
                        g_SpawnVecs[g_TotalSpawns][0] = str_to_float(pos[1])
                        g_SpawnVecs[g_TotalSpawns][1] = str_to_float(pos[2])
                        g_SpawnVecs[g_TotalSpawns][2] = str_to_float(pos[3])
                       
                        //Angles
                        g_SpawnAngles[g_TotalSpawns][0] = str_to_float(pos[4])
                        g_SpawnAngles[g_TotalSpawns][1] = str_to_float(pos[5])
                        g_SpawnAngles[g_TotalSpawns][2] = str_to_float(pos[6])
                       
                        //v-Angles
                        g_SpawnVAngles[g_TotalSpawns][0] = str_to_float(pos[8])
                        g_SpawnVAngles[g_TotalSpawns][1] = str_to_float(pos[9])
                        g_SpawnVAngles[g_TotalSpawns][2] = str_to_float(pos[10])
                       
                        //Team - ignore - 7
                       
                        g_TotalSpawns++;
                }
                SpawnIng=true;
                log_amx("为%s地图加载 %d 个礼物重置点.", g_TotalSpawns, Map)
        } else {
                log_amx("没有找到重置点文件 (%s)", MapFile)
                SpawnIng=false;
        }
       
        return 1;
}

public end_round()
{
        new gift = 0;
        while((gift = find_ent_by_class(gift, GIFT_NAME)))
                remove_entity(gift);
}

public start_round()
{
        new V_Origin=random_num(1,g_TotalSpawns);
        set_lunatic_gift(V_Origin);
}
       
public set_lunatic_gift(V_Origin)
{
        new gift = create_entity("info_target");
        if (!gift || !SpawnIng)
        {
                log_amx("错误: 无法创建礼物实体!");
                return;
        }
        entity_set_string(gift, EV_SZ_classname, GIFT_NAME);
        entity_set_int(gift, EV_INT_solid, SOLID_TRIGGER);
        entity_set_model(gift, GIFT_MODEL);
        entity_set_size(gift, Float:{-2.5, -2.5, -1.5}, Float:{2.5, 2.5, 1.5});
        entity_set_int(gift, EV_INT_movetype, 6);
        entity_set_vector(gift, EV_VEC_origin, g_SpawnVecs[V_Origin]);
        GetIng=false;
}

public touch_gift(gift, id)
{
        if(GetIng)
                return;
        new gift_access[32],gift_message[256];
        get_pcvar_string(gift_flags, gift_access, 31);
        if(get_user_flags(id) & read_flags(gift_access))
        {
                if(!is_user_connected(id))
                        return;
               
                new player_name[32];
                get_user_name(id, player_name, 31);
                new random_money = random_num(500, 3000);
                cs_set_user_money(id, cs_get_user_money(id)+random_money);
                format(gift_message, 255, "^x03%s ^x01捡起了^x04【金钱礼包】^x01获得^x04 %d ^x01金钱。", player_name, random_money);
                remove_entity(gift);
                client_color(0, id, gift_message);
                emit_sound(id,CHAN_VOICE, GIFT_SOUND, 1.0, ATTN_NORM, 0, PITCH_NORM);
                GetIng=true;
        }
        else
                client_print(id,print_chat,"你还不是注册会员,无法捡起大礼包!");
}

public client_color(playerid, colorid, msg[])   
{
        message_begin(playerid?MSG_ONE:MSG_ALL,get_user_msgid("SayText"),_,playerid);
        write_byte(colorid);
        write_string(msg);
        message_end();
        client_print(playerid, print_console,msg);
}


这个, 帮我弄成拼音的。。。。。。。。。


求高手改改了。。。。。。。。。
回复

使用道具 举报

 楼主| 发表于 2010-12-31 11:28:07 | 显示全部楼层 来自 中国–广东–河源
没人肯帮忙吗???
回复

使用道具 举报

发表于 2010-12-31 14:52:32 | 显示全部楼层 来自 中国–内蒙古–呼和浩特
会的不愿意帮你,愿意帮你的不会!!
回复

使用道具 举报

发表于 2010-12-31 16:46:56 | 显示全部楼层 来自 中国–广西–百色
本帖最后由 心静如水 于 2010-12-31 16:49 编辑

你没有手吗?自己把里面所有中文改成你想要的汉语拼音不就得了不得吗?
第一个不知道你要说什么?
回复

使用道具 举报

 楼主| 发表于 2010-12-31 23:02:52 | 显示全部楼层 来自 中国–广东–河源
本帖最后由 q7818948 于 2010-12-31 23:07 编辑

如果改了能编译,我早就改了。。。。 第一个是防止卡BUG手雷的, 我试过了,卡的时候没有任何提示, 我的意思是,当侦测到玩家卡雷的时候自动发言。Wo SB,  Wo Ka Bug Shou Lei
回复

使用道具 举报

发表于 2010-12-31 23:24:40 | 显示全部楼层 来自 中国–广西–百色–田东县
如果原码正确那么改后也能编译的.................
卡BUG手雷是什么意思?
回复

使用道具 举报

发表于 2011-1-1 00:41:19 | 显示全部楼层 来自 中国–浙江–嘉兴–海宁市
本帖最后由 cs9527 于 2011-1-1 00:45 编辑

其实上面的那个反闪光BUG不用这个插件都可以的!
reallite_hlg2.8检测里面自带的都有!
如图



rhlg_flashbug "1"
//检测地图中的闪光bug

rhlg_flashbugaction "1"
//当检测到利用闪光bug时的行动
//1 - 在游戏里显示消息
//2 - 踢出服务器
//3 - 按rhlg_bantype的规则封禁
//4 - 在客户端上执行命令

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
回复

使用道具 举报

 楼主| 发表于 2011-1-1 13:49:48 | 显示全部楼层 来自 中国–广东–河源
本帖最后由 q7818948 于 2011-1-1 20:11 编辑

那个源码是正确的啊?没改之前能编译。改了之后就不行了。
就是闪光BUG,  我想配脏话过滤的惩罚下,ban他和KICK感觉太严厉了点, 在游戏里显示消息起不到威慑的作用,。难道就没人改好赚我10个点通币吗?
回复

使用道具 举报

发表于 2011-1-2 09:24:56 | 显示全部楼层 来自 中国–山东–淄博
//rhlg_contact
//描述:联系管理员。
//用于捕捉和显示玩家之前,他对作弊禁令玩家知道向何处发送截图。

//rhlg_advert(默认访问http://reallite.cs2.ru
//说明:联系插件作者消息,当他们加入服务器。

//rhlg_actions(默认1)
//说明:启用后检测行动。
//其他设置:reallite_actions.cfg,reallite_no_actions.cfg
//1 - 启用动作:踢,禁止,记录日志,告知消息
//0 - 关闭行动:记录日志,告知消息
rhlg_actions "1"

//rhlg_bantype
//说明:禁止类型 在其他功能选项的使用:
//1 - 禁止IP
//2 - steam禁令标识
//3 - 对禁止IP上使用AMXBans模块相通
//4 - steam标识禁止通过AMXBans
//5 - 禁止由Cerberus
rhlg_bantype "1"

//rhlg_users(默认1)
//说明:使用文件reallite_users.cfg使用过程中扫描有免疫力的玩家。
//1 - 启用免疫力
//0 - 关闭免疫系统
rhlg_users "1"

//rhlg_message(默认1)
//说明:显示关于RHLG游戏的消息。
//1 - 启用
//0 - 关闭
rhlg_message "1"

//rhlg_checkcheats(默认1)
//描述:检查玩家作弊。
//1 - 启用验证
//0 - 禁用检查
rhlg_checkcheats "1"

//rhlg_checkcheats2(默认1)
//描述:检查玩家作弊第二种(其他)的方式。
//1 - 启用验证
//0 - 禁用检查
rhlg_checkcheats2 "1"

//rhlg_checkcheats2action
//描述:当它检测到的动作,处置玩家:
//1 - 游戏中的消息
//2 - 从服务器中删除玩家
//3 - 使用禁止的规则rhlg_bantype
//4 - 在客户端上执行命令
rhlg_checkcheats2action "3"

//检测到第2种作弊或其它作弊 封禁时间 (默认 60) 分钟
rhlg_checkcheats2bantime "60"

//rhlg_checkcheats2exec(默认断开)
//描述:在客户端上执行命令时,
//它检测到作弊的玩家,
//如果您选择的行动 - 4。(建议对付作弊的就是封禁啊)
rhlg_checkcheats2exec "disconnect"

//rhlg_checkcheats2log(于умочанию1)
//说明:在输入记录时,它检测到作弊的玩家。
//1 - 启用
//0 - 关闭
rhlg_checkcheats2log "0"

//rhlg_cdhack(默认1)
//描述:cd(针对老的反作弊cheat——dead)技巧测试玩家。
//警告!包括检查只有当你在服务器上未安装作弊,死亡。
1 - 启用验证
0 - 禁用检查
rhlg_cdhack "1"
回复

使用道具 举报

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

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