搜索
查看: 2002|回复: 0

标题不会写,进来看一眼吧

[复制链接]
发表于 2009-4-12 11:49:31 | 显示全部楼层 |阅读模式 来自 中国–辽宁–沈阳
我本来是想当有玩家进入游戏后显示一些东西给玩家,但是现在只要有玩家进入所有人都会再看一次.SMA我发上来希望有大侠帮我改一下


#include <amxmodx>

#define DISPLAY_MSG                // Comment to disable message on join
#define HELPAMOUNT 10        // Number of commands per page

new msg[512]

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()
}


public plugin_init()
{
        register_plugin("Admin Help", AMXX_VERSION_STR, "AMXX Dev Team")
        register_dictionary("adminhelp.txt")
        register_concmd("amx_help", "cmdHelp", 0, "<page> [nr of cmds (only for server)] - displays this help")
}

#if defined DISPLAY_MSG
public client_putinserver(id)
{
        if (is_user_bot(id))
                return
       
        set_task(15.0, "dispInfo", id)
}

public client_disconnect(id)
{
        remove_task(id)
}
#endif

public cmdHelp(id, level, cid)
{
        new arg1[8], flags = get_user_flags(id)
        new start = read_argv(1, arg1, 7) ? str_to_num(arg1) : 1
        new lHelpAmount = HELPAMOUNT
       
        if (id == 0 && read_argc() == 3)
                lHelpAmount = read_argv(2, arg1, 7) ? str_to_num(arg1) : HELPAMOUNT

        if (--start < 0)
                start = 0

        new clcmdsnum = get_concmdsnum(flags, id)

        if (start >= clcmdsnum)
                start = clcmdsnum - 1

        console_print(id, "^n----- %L -----", id, "HELP_COMS")
       
        new info[128], cmd[32], eflags
        new end = start + lHelpAmount // HELPAMOUNT

        if (end > clcmdsnum)
                end = clcmdsnum

        for (new i = start; i < end; i++)
        {
                get_concmd(i, cmd, 31, eflags, info, 127, flags, id)
                console_print(id, "%3d: %s %s", i + 1, cmd, info)
        }
       
        console_print(id, "----- %L -----", id, "HELP_ENTRIES", start + 1, end, clcmdsnum)

        if (end < clcmdsnum)
                console_print(id, "----- %L -----", id, "HELP_USE_MORE", end + 1)
        else
                console_print(id, "----- %L -----", id, "HELP_USE_BEGIN")

        return PLUGIN_HANDLED
}

#if defined DISPLAY_MSG
public dispInfo(id)
{
        format(msg, 511, "%L", id, "FWQ_GZ")
        client_color(0, id, msg)
        console_print(id, "%L", id, "FWQ_GZ")
        format(msg, 511, "%L", id, "HIGHT_KICK")
        client_color(0, id, msg)
        console_print(id, "%L", id, "HIGHT_KICK")
        format(msg, 511, "%L", id, "WU_LIAN")
        client_color(0, id, msg)
        console_print(id, "%L", id, "WU_LIAN")
        format(msg, 511, "%L", id, "TYPE_HELP")
        client_color(0, id, msg)
        console_print(id, "%L", id, "TYPE_HELP")
       
        new nextmap[32]
        get_cvar_string("amx_nextmap", nextmap, 31)
       
        if (get_cvar_float("mp_timelimit"))
        {
                new timeleft = get_timeleft()
               
                if (timeleft > 0)
                {
                        client_print(id, print_chat, "%L", id, "TIME_INFO_1", timeleft / 60, timeleft % 60, nextmap)
                } else {
                        client_print(id, print_chat, "%L", id, "TIME_INFO_2", nextmap)
                }
        }
}
#endif
游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

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