Для DM FFA (reHLDS) сервер решил сделать чтобы если игрок с пистолетом играет то боты (yapb) в него могли стрелять только с пистолета.
Наклепал такой быдлокод но он не работает. Помогите плиз решить данную проблему.
Наклепал такой быдлокод но он не работает. Помогите плиз решить данную проблему.
Код:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
public plugin_init()
{
register_plugin("Bots Switch To Pistol", "1.0", "xxx")
RegisterHam(Ham_Weapon_PrimaryAttack ,"weapon_ak47","PrimaryAttack")
RegisterHam(Ham_Weapon_PrimaryAttack ,"weapon_m4a1","PrimaryAttack")
RegisterHam(Ham_Weapon_PrimaryAttack ,"weapon_aug","PrimaryAttack")
RegisterHam(Ham_Weapon_PrimaryAttack ,"weapon_sg552","PrimaryAttack")
RegisterHam(Ham_Weapon_PrimaryAttack ,"weapon_galil","PrimaryAttack")
RegisterHam(Ham_Weapon_PrimaryAttack ,"weapon_famas","PrimaryAttack")
RegisterHam(Ham_Weapon_PrimaryAttack ,"weapon_m249","PrimaryAttack")
RegisterHam(Ham_Weapon_PrimaryAttack ,"weapon_mp5navy","PrimaryAttack")
RegisterHam(Ham_Weapon_PrimaryAttack ,"weapon_m3","PrimaryAttack")
RegisterHam(Ham_Weapon_PrimaryAttack ,"weapon_xm1014","PrimaryAttack")
RegisterHam(Ham_Weapon_PrimaryAttack ,"weapon_ump45","PrimaryAttack")
RegisterHam(Ham_Weapon_PrimaryAttack ,"weapon_tmp","PrimaryAttack")
RegisterHam(Ham_Weapon_PrimaryAttack ,"weapon_mac10","PrimaryAttack")
RegisterHam(Ham_Weapon_PrimaryAttack ,"weapon_p90","PrimaryAttack")
}
public PrimaryAttack(weapon)
{
new id = pev(weapon,pev_owner)
new target, body
get_user_aiming(id, target, body, 9999)
new WeaponID = get_user_weapon(target)
switch(WeaponID)
{
case 1,10,11,16,17,26:
{
client_cmd(id,"slot2")
return HAM_SUPERCEDE
}
}
return HAM_IGNORED
}