搜索
查看: 1965|回复: 1

求助:修改register_event的问题

[复制链接]
发表于 2008-10-2 21:45:59 | 显示全部楼层 |阅读模式 来自 中国–江苏–南京
一个插件源码,想做一些改动
就是把在newround时候加载改成玩家死时加载,怎么改动register_event?
//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")
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,199,txtLen)
if(result != 0)
{
client_cmd(id,cmd)
}
}
}
发表于 2008-10-3 19:06:07 | 显示全部楼层 来自 中国–福建–漳州

回复: 求助:修改register_event的问题

  1. #include <csx>
  2. ......
  3. public client_death ( killer, victim, wpnindex, hitplace, TK )
  4. {
  5.       ......
  6. }
复制代码
或是
  1. ......
  2. register_event("DeathMsg","eDeathMsg","a")
  3. ......
  4. public eDeathMsg()
  5. {
  6.     ......
  7. }
复制代码
回复

使用道具 举报

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

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