public cmd_infectuser(id, level, cid)
{
if(!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED_MAIN
static arg1[32]
read_argv(1, arg1, 31)
static target
target = cmd_target(id, arg1, (CMDTARGET_OBEY_IMMUNITY|CMDTARGET_ALLOW_SELF|CMDTARGET_ONLY_ALIVE))
if(!is_user_connected(target) || g_zombie[target])
return PLUGIN_HANDLED_MAIN
if(!allow_infection())
{
console_print(id, "%L", id, "CMD_MAXZOMBIES")
return PLUGIN_HANDLED_MAIN
}
if(!g_gamestarted)
{
console_print(id, "%L", id, "CMD_GAMENOTSTARTED")
return PLUGIN_HANDLED_MAIN
}
static name[32]
get_user_name(target, name, 31)
DropPlayerWeapons(target, 0)
console_print(id, "%L", id, "CMD_INFECTED", name)
infect_user(target, 0)
return PLUGIN_HANDLED_MAIN
}
public DropPlayerWeapons( id )
{
new iWeapons[32], iNum, iWeapon
get_user_weapons(id, iWeapons, iNum)
new szWeaponName[22]
for(--iNum; iNum>=0; iNum--)
{
iWeapon = iWeapons[iNum]
if( iWeapons & (1<<iWeapon) && ~NODROP_WPNS_BITSUM & (1<<iWeapon) )
{
get_weaponname(iWeapon, szWeaponName, charsmax(szWeaponName))
engclient_cmd(id, "drop", szWeaponName)
}
}
}