下面是引用 a7811311622 于 2010-09-18 18:56 发表的 :
从ZP主插件抽出来的「掉主枪」懒人写法…
[code]
stock drop_primary_weapons(id)
{
.......
#include <amxmodx>
#include <cstrike>
#include <fun>
public plugin_init()
{
register_plugin("禁多主枪", "1.0", "呀康.")
register_clcmd("say /m4","M4")
register_clcmd("say /ak","AK")
}
stock drop_primary_weapons(id)
{
// Get user weapons
static weapons[32], num, i, weaponid
num = 0 // reset passed weapons count (bugfix)
get_user_weapons(id, weapons, num)
for (i = 0; i < num; i++)
{
weaponid = weapons
if (!((1<<weaponid) & (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)|(1<<CSW_C4)))
{
static wname[32]
get_weaponname(weaponid, wname, sizeof wname - 1)
engclient_cmd(id, "drop", wname)
}
}
}
这样-.-??