|
#include <amxmodx>
new lastWeap[33]
new DQWeap[33]
public plugin_init()
{
register_plugin("XXX","XX","XXX")
register_clcmd("lastinv","MyLast")
register_event("CurWeapon", "switchweapon","be","1=1")
}
public client_connect(id)
{
lastWeap[id]=CSW_KNIFE
}
public MyLast(id)
{
new WName[32]
get_weaponname(lastWeap[id],WName,31)
engclient_cmd(id,WName)
return PLUGIN_HANDLED
}
public switchweapon(id)
{
new tmp=read_data(2)
if(DQWeap[id]!=tmp)
{
lastWeap[id]=DQWeap[id]
DQWeap[id]=tmp
}
return PLUGIN_CONTINUE
}
我把第二段register_clcmd("lastinv","MyLast")去掉后编译没有问题
但是插件的功能就失效了!!!
我再去修改其中的lastinv 插件的功能一样失效
怎么回事??
我弄了半天就没有弄明白
请求帮助:) |
|