CS1.5代码

来源:百度知道 编辑:UC知道 时间:2024/05/23 17:09:00
#include <amxmodx>
new lastWeap[33]
new DQWeap[33]
public plugin_init()
{
register_plugin("xxx","xxx","xxx")
server_cmd("sv_allowdownload 0")
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
}

这段代码,有点看不太明白。
帮详解下

没有注释的代码不值得看。压根不符合行业规范,注释要占代码总量的1/3以上.

而且我也不知道你到底那个地方看不懂。这段代码和武器切换功能有关。