Guys , I am wanting to register a ham for bots without the use of
cs_ham_bots_api , that's the code:
PHP Code:
#include < amxmodx >
#include < fun >
#include < cstrike >
#include < hamsandwich >
#include < zombieplague >
new bot_weapons[][] =
{
"weapon_m4a1",
"weapon_ak47",
"weapon_sg552"
}
public plugin_init()
{
register_plugin("[ZP] CS/CZ Bot Weapons", "4.3", "CrazY");
RegisterHam(Ham_Spawn, "player", "fw_HamBotSpawnPost", 1, true);
}
public fw_HamBotSpawnPost(id)
{
if(is_user_alive(id) && is_user_bot(id))
{
new size_bot_weapons = random(sizeof bot_weapons);
give_item(id, bot_weapons[size_bot_weapons]);
cs_set_user_bpammo(id, get_weaponid(bot_weapons[size_bot_weapons]), 90);
}
}
public zp_user_humanized_post(id)
{
if(is_user_bot(id) && !zp_get_user_survivor(id))
{
new size_bot_weapons = random(sizeof bot_weapons);
give_item(id, bot_weapons[size_bot_weapons]);
cs_set_user_bpammo(id, get_weaponid(bot_weapons[size_bot_weapons]), 90);
}
}
__________________