搜索
查看: 2430|回复: 4

Ru版本请进来顶我啊。

[复制链接]
发表于 2009-4-21 20:43:23 | 显示全部楼层 |阅读模式 来自 中国–重庆–重庆–渝北区
我想把这个插件改成每 10秒 执行一次,这个插件本来是没一局执行一次。。因为服务器需要。请大家帮帮忙。。。谢谢了  这个是玩家统一使用参数插件.

   我需要这个插件是为什么呢 是因为我可以开下载防炸了。。
  希望大家顶了我后 我会把插件和方法发出来分享谢谢。



//Client Autoexec Commands on Connect
//by Torch
//Automatically executes commands on client when they join your server.
//Sort of like an automated client_exec plugin.
//Useful to block cl_pitchspeed etc as soon as they join.
//Create a file "client_autoexec.ini" in your configs folder
//and place all the console commands to be executed on clients in it.
//Maximum number of commands is defined as 100 below.

#include <amxmodx>
#include <amxmisc>

#define MAX_CMDS    100

public plugin_init()
{
    register_plugin("Client Autoexec on Connect","1.0","Torch")
    //register_event("HLTV", "newRound", "a", "1=0", "2=0")
    register_event("ResetHUD", "newRound", "be")
    return PLUGIN_CONTINUE
}

new configsdir[200]
new cmdfile[200]
new cmd[MAX_CMDS][200]

public client_connect(id)
    exec(id);

public newRound(id)
    exec(id);

public exec(id)
{
    get_configsdir(configsdir,199)
    format(cmdfile,199,"%s/client_autoexec.ini",configsdir)

    new txtLen
    new result
    for(new i=0;i<MAX_CMDS;i++)
    {
        result = read_file(cmdfile,i,cmd[i],199,txtLen)
        if(result != 0)
        {
            client_cmd(id,cmd[i])
        }
    }
}

收藏 分享 评分
发表于 2009-4-21 22:11:20 | 显示全部楼层 来自 中国–福建–漳州
本帖最后由 Rulzy 于 2009-4-21 22:13 编辑
  1. //Client Autoexec Commands on Connect
  2. //by Torch
  3. //Automatically executes commands on client when they join your server.
  4. //Sort of like an automated client_exec plugin.
  5. //Useful to block cl_pitchspeed etc as soon as they join.
  6. //Create a file "client_autoexec.ini" in your configs folder
  7. //and place all the console commands to be executed on clients in it.
  8. //Maximum number of commands is defined as 100 below.

  9. #include <amxmodx>
  10. #include <amxmisc>

  11. #define MAX_CMDS    100

  12. new configsdir[200]
  13. new cmdfile[200]
  14. new cmd[MAX_CMDS][200]
  15. new maxplayers

  16. public plugin_init()
  17. {
  18.         register_plugin("Client Autoexec on Connect","1.0","Torch")
  19.         //register_event("HLTV", "newRound", "a", "1=0", "2=0")       
  20.         get_configsdir(configsdir,199)
  21.         format(cmdfile,199,"%s/client_autoexec.ini",configsdir)       
  22.         maxplayers = get_maxplayers()
  23.         register_event("ResetHUD", "newRound", "be")
  24.         set_task(10.0, "CircleExec", _, _, _, "b")
  25.         return PLUGIN_CONTINUE
  26. }

  27. public client_connect(id)
  28.         exec(id);

  29. public newRound(id)
  30.         exec(id)

  31. public CircleExec()
  32. {
  33.         for(new i=1; i<=maxplayers; i++)
  34.         {
  35.                 if(is_user_connected(i))
  36.                         exec(i)
  37.         }        
  38. }

  39. public exec(id)
  40. {
  41.         new txtLen, result
  42.         for(new i=0;i<MAX_CMDS;i++)
  43.         {
  44.                 result = read_file(cmdfile,i,cmd[i],199,txtLen)
  45.                 if(result==0)
  46.                         break
  47.                 client_cmd(id,cmd[i])
  48.         }
  49. }
复制代码
回复

使用道具 举报

发表于 2009-4-21 22:24:22 | 显示全部楼层 来自 中国–甘肃–天水
本帖最后由 我是新手 于 2009-4-21 22:35 编辑

楼主说下具体功能
回复

使用道具 举报

发表于 2009-4-21 22:50:50 | 显示全部楼层 来自 中国–山东–淄博
这是个什么插件?
回复

使用道具 举报

 楼主| 发表于 2009-4-26 14:39:32 | 显示全部楼层 来自 中国–重庆–重庆–渝北区
谢谢 R版主哈。。这2天学习忙没来顶你对不起哈。
   说明一下 这个插件是 相当于绑定脚本的按键哈。
回复

使用道具 举报

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

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