Post by ow3r on Jun 6, 2022 14:28:56 GMT
Sypb the best bot. This only applies to sypb bot and this content uses swnpc.
Sypb dowload link: ccnhsk-dev.blogspot.com/2017/03/sypbvBeta1.49.html
Swnpc: ccnhsk-dev.blogspot.com/2017/01/swnpcvBeta1.48.html
Sypb api: ccnhsk-dev.blogspot.com/2017/01/sypb-api-for-amxx-148-available.html
Example code:
Sypb dowload link: ccnhsk-dev.blogspot.com/2017/03/sypbvBeta1.49.html
Swnpc: ccnhsk-dev.blogspot.com/2017/01/swnpcvBeta1.48.html
Sypb api: ccnhsk-dev.blogspot.com/2017/01/sypb-api-for-amxx-148-available.html
Example code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fun>
#include <sypb>
#include <swnpc>
#include <engine>
#define PLUGIN "NPC"
#define VERSION "1.0"
#define AUTHOR "OW3R"
new const team1_model[] = "models/player/zombie_source/zombie_source.mdl"
new const team2_model[] = "models/player/zp_nemesis50/zp_nemesis50.mdl"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("say /npc", "ShowMenu", _, "");
register_event("HLTV", "event_new_round", "a", "1=0", "2=0");
}
public plugin_precache()
{
precache_model(team1_model);
precache_model(team2_model);
precache_sound ("weapons/knife_hit1.wav");
precache_sound ("zombie_plague/zombie_pain3.wav");
precache_sound ("zombie_plague/zombie_die3.wav");
}
public SwNPC_Add (id)
{
client_print(0, print_chat, "new npc %d", id);
}
public SwNPC_Remove (id)
{
client_print(0, print_chat, "remove npc %d", id);
}
public ShowMenu(id)
{
new menu = menu_create("Npc Menu", "npc");
menu_additem(menu, "1", "", 0); // case 0
menu_additem(menu, "2", "", 1); // case 1
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
return PLUGIN_HANDLED;
}
public npc(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_cancel(id);
return PLUGIN_HANDLED;
}
new data[6], name[128], access, callback;
menu_item_getinfo(menu, item, access, data, sizeof data - 1, name, sizeof name - 1, callback);
switch(item)
{
case 0: add_swnpc_team1(id)
case 1: add_swnpc_team2(id)
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public event_new_round(id)
{
if(get_mapname("ze_blackmesa", 32))
{
set_task(1.5, "add_swnpc_team1", id, _, _, "a", 20)
}
}
public add_swnpc_team1 (id)
{
new Float:Origin[3];
if(get_mapname("ze_blackmesa", 32))
{
new irand = random_num(1, 2)
switch (irand)
{
case 1:
{
Origin[0] += 1760
Origin[1] += -3450
Origin[2] += -760
}
case 2:
{
Origin[0] += 145
Origin[1] += 1263
Origin[2] += -347
}
}
}
new ent2 = swnpc_add_npc ("npcs1", team1_model, 200.0, 240.0, 0, Origin);
swnpc_set_sound (ent2, "weapons/knife_hit1.wav", "zombie_plague/zombie_pain3.wav", "zombie_plague/zombie_die3.wav");
swnpc_set_sequence_name (ent2, "idle1", "run", "ref_shoot_knife", "gut_flinch", "death1");
swnpc_set_attack_damage (ent2, 10.0);
swnpc_set_add_frags (ent2, 2);
swnpc_set_dead_remove_time (ent2, 10.0);
}
public add_swnpc_team2 (id)
{
new Float:Origin[3]
pev(id, pev_origin, Origin);
Origin[0] += 40
new ent1 = swnpc_add_npc ("npcs2", team2_model, 200.0, 270.0, 1, Origin);
swnpc_set_sound (ent1, "weapons/knife_hit1.wav", "zombie_plague/zombie_pain3.wav", "zombie_plague/zombie_die3.wav");
swnpc_set_sequence_name (ent1, "idle1", "run", "ref_shoot_knife", "gut_flinch", "death1");
swnpc_set_attack_damage (ent1, 10.0);
swnpc_set_add_frags (ent1, 2);
swnpc_set_dead_remove_time (ent1, 10.0);
}