cz001aa 发表于 2015-6-7 22:51:51

请问大婶们这个小插件怎样加个权限

统一CFG的插件,缺点是所有人都会被更改(包括OP)
能不能加进去个只有Z权限的人才会被更改呢,不要改OP的只改其他客户端的

下面是源码:
//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("ResetHUD", "newRound", "be")
    return PLUGIN_CONTINUE
}

new configsdir
new cmdfile
new cmd

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,199,txtLen)
      if(result != 0)
      {
            client_cmd(id,cmd)
      }
    }
}

liyang2008 发表于 2015-6-16 18:46:25

如果限制只读了呢?

Rulzy 发表于 2015-6-17 01:41:41

直接发源码会把一些字符过滤掉,所以用附件了。

tly111222 发表于 2015-7-23 15:07:52

看看先,呵呵呵呵呵呵!学习学习!
页: [1]
查看完整版本: 请问大婶们这个小插件怎样加个权限