114772348 发表于 2010-5-29 14:01:28

大哥,能介绍下怎么编译成SMA文件吗?我搞了半天 compile 不给我编译成AMXX。不知道杂回事

114772348 发表于 2010-5-29 14:39:15

我编译成了SMA怎么转换不成AMXX呀,不会是代码有错吧?

114772348 发表于 2010-5-29 14:53:57

:'( 有人帮我下吗?做成AMXX,急死人了

LittleKu 发表于 2010-5-29 18:11:40

本帖最后由 kk阿朗 于 2010-5-29 18:33 编辑

我的编译器是只支持英文的!所以中文的没办法!#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define NAME "show teammate's money"
#define VERSION "1.3.1"
#define AUTHOR "K.K.Lv"

new g_max_players, g_sync_creat_statustext, g_sync_creat_list

new bool:g_teammate

new cvar_plugin_on
new cvar_status_on

public plugin_init()
{
        register_plugin(NAME, VERSION, AUTHOR)
       
        register_dictionary("stm.txt")
        RegisterHam(Ham_Spawn, "player", "player_spawn", 1)
       
        register_clcmd("say /money", "clcmd_money")
       
        register_event("StatusValue", "show_teammate_money", "be", "1=2", "2!0")
        register_event("StatusValue", "set_team", "be", "1=1")
       
        cvar_plugin_on = register_cvar("stm_on", "1")
        cvar_status_on = register_cvar("stm_st_on", "1")
       
        g_max_players = get_maxplayers()
        g_sync_creat_statustext = CreateHudSyncObj()
        g_sync_creat_list = CreateHudSyncObj()
}

public clcmd_money(client)
{
        if (!get_pcvar_num(cvar_plugin_on))
        {
                client_print(client, print_chat, "%L", client, "PLUGIN_UNABLE")
                return PLUGIN_HANDLED
        }
        show_money(client)
        return PLUGIN_CONTINUE
}

public player_spawn(client)
{
        remove_task(client)
        if (is_user_alive(client) && get_pcvar_num(cvar_plugin_on))
        {
                set_task(1.0, "show_money", client)
        }
}

public show_money(client)
{
        static message;
        static name;
       
        new money, id, len;
       
        len = format(message, charsmax(message), "%L", client, "TITLE");
        for (id = 1; id <= g_max_players; id++)
        {
                if (id != client && is_user_connected(id) && cs_get_user_team(id) == cs_get_user_team(client))
                {
                        money = cs_get_user_money(id);
                        get_user_name(id, name, 31);
                        len += format(message, charsmax(message) - len, "%L", client, "BODY", name, money);
                }
        }
        set_hudmessage(100, 200, 0, 0.05, 0.35, 0, 0.02, 5.0, 0.1, 0.2, 2);
        ShowSyncHudMsg(client, g_sync_creat_list, message);
}

public set_team(id)
        g_teammate = bool:(read_data(2) == 1);

public show_teammate_money(id)
{
        if (!get_pcvar_num(cvar_plugin_on))
                return PLUGIN_HANDLED;
        if(!is_user_bot(id) && is_user_connected(id) && get_pcvar_num(cvar_status_on))
        {
                static name;
               
                new pid = read_data(2);
                new red = 0, blue = 0;
               
                if (cs_get_user_team(pid) == CS_TEAM_T)
                        red = 255;
                else if(cs_get_user_team(pid) == CS_TEAM_CT)
                        blue = 255;
               
                get_user_name(pid, name, charsmax(name));
                new money = cs_get_user_money(pid);
                if (g_teammate)
                {
                        set_hudmessage(red, 50, blue, -1.0, 0.60, 1, 0.01, 0.6, 0.01, 0.01, 8);
                        ShowSyncHudMsg(id, g_sync_creat_statustext, "%L", id, "TEAMMATE", name, money);
                }
                else {
                        set_hudmessage(red, 50, blue, -1.0, 0.60, 1, 0.01, 0.6, 0.01, 0.01, 8);
                        ShowSyncHudMsg(id, g_sync_creat_statustext, "%L", id, "ENEMY", name);
                }
        }
        return PLUGIN_CONTINUE;
}

public client_disconnect(client)
{
        remove_task(client);
}把stm.txt文件放在"$MOD\addons\amxmodx\data\lang"文件下

edit:没测试过!!

114772348 发表于 2010-5-29 18:43:58

本帖最后由 114772348 于 2010-5-29 18:53 编辑

朋友插件你有试过吗?怎么没反应呢?

qiangmin0425 发表于 2010-8-11 15:46:57

2 楼 还是好人多啊!
页: 1 [2]
查看完整版本: 求大虾帮改个报钱插件!