Weaponname is missing, thought you know it.
PHP Code:
#include <amxmodx>
#include <amxmisc>
public plugin_init(){
register_concmd("amx_dropweapon", "cmd_dropweapon", ADMIN_BAN, "<name or #userid>")
}
public cmd_dropweapon(id, level, cid){
if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED
new szArg[32]
read_argv(1, szArg, 31)
new iPlayer = cmd_target(id, szArg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF)
if (iPlayer) drop_user_weapon(iPlayer)
return PLUGIN_HANDLED
}
stock drop_user_weapon(id){
new szWeaponName[32], iWeapon = get_user_weapon(id)
get_weaponname(iWeapon, szWeaponName, 31)
engclient_cmd(id, "drop", szWeaponName)
}
__________________