下面是引用 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)
}
}
}
這樣-.-??