Проблема с bot features 0.0.3

Сообщения
315
Реакции
104
Помог
2 раз(а)
Ошибка
Меняются ники игроков, из-за bot features 0.0.3
ОС
Linux
Amx Mod X
AMX Mod X 1.8.3-dev+5154 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Mar 9 2018 10:40:21
Built from: https://github.com/alliedmodders/amxmodx/commit/2559fcf
Build ID: 5154:2559fcf
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.4.0.654-dev
Build date: 12:09:21 May 22 2018 (1501)
Build from: https://github.com/dreamstalker/rehlds/commit/65c6ce5
ReGamedll
ReGameDLL version: 5.7.0.309-dev
Build date: 13:52:50 May 22 2018
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/96af8a7
Версия Metamod
Metamod-r v1.3.0.127, API (5:13)
Metamod-r build: 10:49:17 Jun 15 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0fff979
Список метамодулей
[ 1] Reunion          RUN   -    reunion.so                  v0.1.0.89        ini  Start Never
[ 2] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC3 ini ANY
[ 3] AMX Mod X RUN - amxmodx.so v1.8.3-dev+5154 ini Start ANY
[ 4] ReAuthCheck RUN - reauthcheck.so v0.1.6 ini Start Never
[ 5] Rechecker RUN - rechecker.so v2.5 ini ANY
[ 6] WHBlocker RUN - whblocker.so v1.5.695 ini ANY
[ 7] ReSemiclip RUN - resemiclip.so v2.3.9 ini ANY
[ 8] ReAPI RUN - reapi_amxx_i386.so v5.6.0.155-dev pl3 ANY Never
[ 9] FakeMeta RUN - fakemeta_amxx_i386.so v1.8.3-dev+5154 pl3 ANY
[10] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.8.3-dev+5154 pl3 ANY
[11] MySQL RUN - mysql_amxx_i386.so v1.8.3-dev+5154 pl3 ANY
[12] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl3 ANY Never
[13] Engine RUN - engine_amxx_i386.so v1.8.3-dev+5154 pl3 ANY
[14] CSX RUN - csx_amxx_i386.so v1.8.3-dev+5174 pl3 ANY
[15] CStrike RUN - cstrike_amxx_i386.so v1.8.3-dev+5174 pl3 ANY
[16] Fun RUN - fun_amxx_i386.so v1.8.3-dev+5154 pl3 ANY
Список плагинов
[  1] DopBan                  2.8.2b      kanagava          dop_ban2.amxx    running
[ 2] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 3] FreshBans 1.3.8b kanagava fresh_bans_138_ running
[ 4] Admin Loader 2.5.2 neygomon admin_loader_fo running
[ 5] [183] AC Spectator ESP 17.08.09 SKAJIbnEJIb & Ko ac_esp.amxx running
[ 6] Menus Front-End 18.03.24 AMXX Dev Team & amxmodmenu_rbs. running
[ 7] mp_hostages_rescuetime 0.0.2 wopox1337 mp_hostages_res running
[ 8] [183] Cvar on Map 18.05.29 SKAJIbnEJIb cvar_on_map.amx running
[ 9] [183] Block Reconnect 17.08.09 ShaTalKiN Block_Reconnect running
[ 10] [183] Ultimate Weapons 18.08.08BE SKAJIbnEJIb ultimate_weapon running
[ 11] Ping Checker 26.0.1 RC1 h1k3 ping_checker.am running
[ 12] Players Count in Team 3.0.5 kramesa+Seroff players_count_i running
[ 13] Bot Features 0.0.3 Vaqtincha BotFeatures.amx running
[ 14] [183] Stimulation RBS 18.08.08BE SKAJIbnEJIb stimulation_rbs running
[ 15] [183] CsStats MySQL 18.08.09 SKAJIbnEJIb csstats_mysql.a running
[ 16] [183] AdminChat RBS 18.09.15 SKAJIbnEJIb adminchat_rbs.a running
[ 17] [183] AdminCmd RBS 18.09.15 AMXX Dev Team & admincmd_rbs.am running
[ 18] Commands Menu 1.8.3-dev+ AMXX Dev Team cmdmenu.amxx running
[ 19] Info. Messages 1.8.3-dev+ AMXX Dev Team imessage.amxx running
[ 20] Maps Menu 1.8.3-dev+ AMXX Dev Team mapsmenu.amxx running
[ 21] [183] NextMap 18.09.25 SKAJIbnEJIb & AM nextmap.amxx running
[ 22] Autoresponder/Advertis 0.5 MaximusBrood reklama_in_chat running
[ 23] Scrolling Message 1.8.3-dev+ AMXX Dev Team scrollmsg.amxx running
[ 24] [183] Warmup RBS 18.08.06BE SKAJIbnEJIb warmup_rbs.amxx running
[ 25] [183] Ultimate Knife 18.05.15 SKAJIbnEJIb ultimate_knife. running
[ 26] [183] Ultimate Flags 18.03.24 SKAJIbnEJIb ultimate_flags. running
[ 27] [183] MapChooser RBS 18.10.05 SKAJIbnEJIb & UF mapchooser_rbs. running
[ 28] [183] TimeLeft 18.09.25 SKAJIbnEJIb & AM timeleft.amxx running
[ 29] Pause Plugins 1.8.3-dev+ AMXX Dev Team pausecfg.amxx running
[ 30] Restrict Weapons 1.8.3 AMXX Dev Team restmenu.amxx running
[ 31] [183] Stats Configurat 18.05.15 SKAJIbnEJIb & AM statscfg_rbs.am running
[ 32] [183] StatsX RBS 18.03.24 SKAJIbnEJIb & AM statsx_rbs.amxx running
[ 33] [183] Anti Kill Hostag 17.10.30 .Flashbang & SKA anti_kill_hosta stopped
[ 34] [183] Kill Assist RBS 17.10.30 Digi & SKAJIbnEJ killassist_rbs. running
[ 35] [183] CSDM Lite 18.08.05BE SKAJIbnEJIb csdm_lite.amxx running
[ 36] [183] Snipers RBS 18.05.15 SKAJIbnEJIb snipers_rbs.amx running
[ 37] [183] C4 Real Timer 17.10.30 Sanlerus c4_realtimer.am running
[ 38] [183] Ultimate Models 18.05.15 SKAJIbnEJIb ultimate_models running
[ 39] [183] Army Ranks Ultim 18.08.08BE SKAJIbnEJIb army_ranks_ulti running
[ 40] [183] AR Bets 17.10.30 SKAJIbnEJIb ar_bets.amxx running
[ 41] AR Double 14.12.02 SKAJIbnEJIb ar_double.amxx running
[ 42] End Round Music 2.0 Sho0ter end_round_music running
[ 43] MindGames 1.0 poins mindgame.amxx running
[ 44] [183] Jobs RBS 18.05.15 SKAJIbnEJIb jobs_rbs.amxx running
[ 45] [183] Screen Player 17.10.30 SKAJIbnEJIb screen_player.a running
[ 46] [183] Ultimate Gag 18.02.21BE SKAJIbnEJIb ultimate_gag.am running
[ 47] [ReAPI][183] Ultimate 17.08.28 SKAJIbnEJIb ultimate_gag_re running
[ 48] [183] VIP RBS 18.08.08BE SKAJIbnEJIb vip_rbs.amxx running
[ 49] Invite Privilegies 1.0 Leo_[BH] invite_priv.amx running
[ 50] Parachute for ALL [ReA 3.0 Leo_[BH] parachute_for_a running
[ 51] [183] BackWeapons RBS 17.08.11 SKAJIbnEJIb & ho backweapons_rbs running
[ 52] Walls Creator 1.1 d3m37r4 walls_creator.a running
[ 53] [ReAPI] No Team Flash 0.0.2 Vaqtincha no_team_flash.a running
[ 54] Ping Faker 1.3 MeRcyLeZZ pingfaker.amxx running
[ 55] Reset Score 1.0 loh resetscore.amxx running
[ 56] [183] Damager RBS 17.12.22 SKAJIbnEJIb damager_rbs.amx running
[ 57] [183] AR Vampire 17.08.22 SKAJIbnEJIb ar_vampire.amxx running
[ 58] [183] Demo Recorder RB 18.02.08 SKAJIbnEJIb demorecorder_rb running
[ 59] [183] AfkKicker RBS 17.10.30 SKAJIbnEJIb afkkicker_rbs.a running
[ 60] [183] Chat Controller 18.07.20 SKAJIbnEJIb chat_controller running
[ 61] [183] Chat RBS 18.03.24 SKAJIbnEJIb chat_rbs.amxx running
Автор плагина
Vaqtincha
Версия плагина
0.0.3
Исходный код
// Copyright © 2017 Vaqtincha

/**■■■■■■■■■■■■■■■■■■■■■■■■■■■■ CONFIG START ■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/

#define BACK_ITEMS_ON_RESTARTROUND // Вернуть боту оружия и предметов при новом раунде

#define INFO_HUD_POSITION -1.0, 0.60 // Позиция худ информера
#define INFO_HUD_COLOR 25, 200, 20 // Цвет худ информера

// #define KILL_REWARD 100 // Сколько давать деньги игроку за килл
// #define KILL_FRAGS 1 // Сколько давать фраги игроку за килл
// #define MAX_USE_PER_ROUND 2 // Сколько раз можно использовать бота за раунд

// #define PL_DEBUG // Включить отладочную информацию

/**■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ CONFIG END ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <reapi>


#define PL_VERSION "0.0.3"

#if AMXX_VERSION_NUM < 183
#define client_disconnected client_disconnect
#include <colorchat>
#endif


#define IsPlayer(%1) (1 <= %1 <= g_iMaxPlayers)
#define IsBot(%1) (g_aPlayerData[%1][szBotName][0])

#define SET_ORIGIN(%1,%2) engfunc(EngFunc_SetOrigin, %1, %2)
#define SET_SIZE(%1,%2,%3) engfunc(EngFunc_SetSize, %1, %2, %3)

#define VECTOR_ZERO Float:{0.0, 0.0, 0.0}

const MAX_NAME_LENGHT = 32
const INVALID_WEAPONS_BS = ((1 << any:WEAPON_NONE)|(1 << any:WEAPON_GLOCK)|(1 << any:WEAPON_KNIFE))
const USEFUL_WEAPON_SLOTS_BS = ((1 << any:PRIMARY_WEAPON_SLOT)|(1 << any:PISTOL_SLOT)/* |(1 << any:GRENADE_SLOT) */)
const ALLOWED_OBS_MODE_BS = ((1 << OBS_IN_EYE)|(1 << OBS_CHASE_FREE))

enum coord_e { Float:X, Float:Y, Float:Z }
enum { SpecHealth2_Health = 1, SpecHealth2_Target }

enum player_s
{
pBotIndex, // last bot index
szBotName[32],
iUsedCount
}

new g_aPlayerData[MAX_CLIENTS + 1][player_s]

new bool:g_bMapHasBombTarget, bool:g_bRoundEnded, g_iMaxPlayers, g_iHudSync
new HookChain:g_hGetPlayerSpawnSpot, HamHook:g_hUseWeaponStrip

new const g_szBotChatMsg[][] = {
"Смотри и не подведи меня!",
"Надеюсь ты не зря убил меня",
"Думаешь играешь лучше чем я ? Посмотрим..",
"Б*я человечки не дают играть",
"Решил играть за меня ? Только береги мое оружие.",
"Во блин. Так несправедливо",
"Зарабатывай деньги и фраги. Я БУДУ РАД."
}

new const g_szDefModelNames[MODEL_AUTO][] = {
"", "urban", "terror", "leet", "arctic", "gsg9",
"gign", "sas", "guerilla", "vip", "militia", "spetsnaz"
}


public plugin_init()
{
register_plugin("Bot Features", PL_VERSION, "Vaqtincha")
if(!cvar_exists("bot_zombie"))
{
pause("ad")
return
}

register_clcmd("nightvision", "ClCmd_ControlBot")
register_clcmd("rr", "ClCmd_ControlBot")
register_event("SpecHealth2", "Event_SpecHealth2", "bd", "1>0" /*, "2!0" */)

RegisterHookChain(RG_RoundEnd, "RoundEnd", .post = true)
RegisterHookChain(RG_CSGameRules_RestartRound, "CSGameRules_RestartRound", .post = false)
RegisterHookChain(RG_CSGameRules_PlayerKilled, "CSGameRules_PlayerKilled", .post = false)

DisableHookChain(g_hGetPlayerSpawnSpot = RegisterHookChain(RG_CSGameRules_GetPlayerSpawnSpot, "CSGameRules_GetPlayerSpawnSpot", .post = false))

if(rg_find_ent_by_class(NULLENT, "player_weaponstrip", true) > 0) {
DisableHamForward(g_hUseWeaponStrip = RegisterHam(Ham_Use, "player_weaponstrip", "CStripWeapons_Use", .Post = false))
}

g_bMapHasBombTarget = bool:get_member_game(m_bMapHasBombTarget)
g_iMaxPlayers = get_maxplayers()
g_iHudSync = CreateHudSyncObj()
}


public client_putinserver(pClient)
{
g_aPlayerData[pClient][szBotName][0] = g_aPlayerData[pClient][iUsedCount] = g_aPlayerData[pClient][pBotIndex] = 0

if(is_user_bot(pClient)) {
get_user_name(pClient, g_aPlayerData[pClient][szBotName], MAX_NAME_LENGHT - 1)
}
}

public client_disconnected(pClient)
{
new pBot
if(IsBot(pClient))
{
new aPlayers[32], iCount, pPlayer
get_players(aPlayers, iCount, "ch") // skip bot's & hltv

for(--iCount; iCount >= 0; iCount--)
{
pPlayer = aPlayers[iCount]
if(g_aPlayerData[pPlayer][pBotIndex] == pClient) {
FullResetPlayer(pPlayer)
}
}
}
else if((pBot = g_aPlayerData[pClient][pBotIndex]) > 0) {
SetBotName(pBot, g_aPlayerData[pBot][szBotName])
}

g_aPlayerData[pClient][iUsedCount] = g_aPlayerData[pClient][pBotIndex] = 0
}

public ClCmd_ControlBot(const pPlayer)
{
if(is_user_alive(pPlayer))
return PLUGIN_CONTINUE

new pBot = get_entvar(pPlayer, var_iuser2)
if(pBot <= 0 || pBot == pPlayer || !IsBot(pBot) || !is_user_alive(pBot))
return PLUGIN_HANDLED

if(!(ALLOWED_OBS_MODE_BS & (1 << get_entvar(pPlayer, var_iuser1))))
return PLUGIN_HANDLED

new TeamName:iTeam = get_member(pPlayer, m_iTeam)
if(!(TEAM_TERRORIST <= iTeam <= TEAM_CT))
{
client_print(pPlayer, print_center, "Спектаторы идите в... :D")
return PLUGIN_HANDLED
}
#if !defined PL_DEBUG // ignore the team on debug mode (not recommended!)
if(iTeam != get_member(pBot, m_iTeam))
{
client_print(pPlayer, print_center, "Играть можно только за тиммейтов!")
return PLUGIN_HANDLED
}
#endif
#if defined MAX_USE_PER_ROUND
if(MAX_USE_PER_ROUND > 0 && g_aPlayerData[pPlayer][iUsedCount] >= MAX_USE_PER_ROUND)
{
client_print(pPlayer, print_center, "Можно использовать %i раз за раунд!", MAX_USE_PER_ROUND)
return PLUGIN_HANDLED
}
#endif
if(g_bRoundEnded) // (get_member_game(m_bRoundTerminating) || get_member_game(m_bCompleteReset))
{
client_print(pPlayer, print_center, "Раунд уже окончен!")
return PLUGIN_HANDLED
}

rg_set_user_model(pPlayer, g_szDefModelNames[get_member(pBot, m_iModelName)], true)
#if defined PL_DEBUG
set_member(pPlayer, m_iTeam, get_member(pBot, m_iTeam))
#endif

set_user_info(pPlayer, "*bot", "1") // lol

g_aPlayerData[pPlayer][pBotIndex] = pBot
g_aPlayerData[pPlayer][iUsedCount]++

set_member(pPlayer, m_bNotKilled, true) // HACK: ignore default items

if(g_hUseWeaponStrip > any:0) { // map has weapon stipper ?
EnableHamForward(g_hUseWeaponStrip)
}

EnableHookChain(g_hGetPlayerSpawnSpot)

rg_round_respawn(pPlayer)
ScenarioIcon(pPlayer)

new szName[MAX_NAME_LENGHT], szFakeName[MAX_NAME_LENGHT]
get_user_name(pPlayer, szName, charsmax(szName))
PrintChatAll(pPlayer, szName, g_aPlayerData[pBot][szBotName])

formatex(szFakeName, charsmax(szFakeName), "[%s] %s", szName, g_aPlayerData[pBot][szBotName])
SetBotName(pBot, szFakeName)

client_print_color(pPlayer, print_team_default, "^3%s ^1: %s", g_aPlayerData[pBot][szBotName], g_szBotChatMsg[random(sizeof(g_szBotChatMsg))])

return PLUGIN_HANDLED
}

public Event_SpecHealth2(const pPlayer)
{
new pTarget = read_data(SpecHealth2_Target)
if(pTarget > 0 && IsBot(pTarget) && (ALLOWED_OBS_MODE_BS & (1 << get_entvar(pPlayer, var_iuser1)))
&& get_member(pPlayer, m_iTeam) == get_member(pTarget, m_iTeam))
{
set_hudmessage(INFO_HUD_COLOR, INFO_HUD_POSITION, .holdtime = 1.5, .fadeintime = 0.5, .fadeouttime = 0.5)
// ShowSyncHudMsg(pPlayer, g_iHudSync, "Бот: %s | Здаровие: %i ^nНажмите ^"N^" чтобы управлять ботом", g_aPlayerData[pTarget][szBotName], read_data(SpecHealth2_Health))
ShowSyncHudMsg(pPlayer, g_iHudSync, "Нажмите ^"N^" чтобы управлять ботом: %s", g_aPlayerData[pTarget][szBotName])
}
else {
ClearSyncHud(pPlayer, g_iHudSync)
}
}

public CStripWeapons_Use(const pStripEntity, const pActivator, const pCaller, const useType, const Float:value)
{
DisableHamForward(g_hUseWeaponStrip)
return (IsPlayer(pActivator) && g_aPlayerData[pActivator][pBotIndex] > 0) ? HAM_SUPERCEDE : HAM_IGNORED
}

public RoundEnd(const WinStatus:status, const ScenarioEventEndRound:event, const Float:tmDelay) {
g_bRoundEnded = true
}


public CSGameRules_RestartRound()
{
new aPlayers[32], iCount, pPlayer, pBot, bool:bRestart = bool:get_member_game(m_bCompleteReset)
get_players(aPlayers, iCount, "ch") // skip bot's & hltv

g_bRoundEnded = false

for(--iCount; iCount >= 0; iCount--)
{
pPlayer = aPlayers[iCount]
if(!bRestart && (pBot = g_aPlayerData[pPlayer][pBotIndex]) > 0)
{
if(!is_nullent(pBot))
{
#if defined BACK_ITEMS_ON_RESTARTROUND
// player has a useful weapon ?
if(TransferItems(pPlayer, pBot, true) & USEFUL_WEAPON_SLOTS_BS) {
set_member(pBot, m_bNotKilled, true) // HACK: ignore default items
}
#endif
SetBotName(pBot, g_aPlayerData[pBot][szBotName])
}
#if defined BACK_ITEMS_ON_RESTARTROUND
set_member(pPlayer, m_bNotKilled, false) // HACK: give default items
#endif
}

if(g_aPlayerData[pPlayer][iUsedCount] > 0) {
FullResetPlayer(pPlayer)
}
}
}

public CSGameRules_PlayerKilled(const pVictim, const pevKiller, const pevInflictor)
{
new pKillerBot, pVictimBot
if((pVictimBot = g_aPlayerData[pVictim][pBotIndex]) > 0)
{
set_user_info(pVictim, "*bot", "0")
SetBotName(pVictimBot, g_aPlayerData[pVictimBot][szBotName])
g_aPlayerData[pVictim][pBotIndex] = 0
}

if(pVictim == pevKiller)
return HC_CONTINUE

if(pVictimBot > 0) {
SetHookChainArg(1, ATYPE_INTEGER, pVictimBot)
}

if(IsPlayer(pevKiller) && (pKillerBot = g_aPlayerData[pevKiller][pBotIndex]) > 0)
{
SetHookChainArg(2, ATYPE_INTEGER, pKillerBot)

if(pevKiller == pevInflictor) {
SetHookChainArg(3, ATYPE_INTEGER, get_member(pevKiller, m_pActiveItem))
}
#if defined KILL_REWARD
rg_add_account(pevKiller, KILL_REWARD)
#endif
#if defined KILL_FRAGS
ExecuteHam(Ham_AddPoints, pevKiller, KILL_FRAGS, false)
#endif
}

return HC_CONTINUE
}

public CSGameRules_GetPlayerSpawnSpot(const pPlayer)
{
DisableHookChain(g_hGetPlayerSpawnSpot)

new pBot = g_aPlayerData[pPlayer][pBotIndex]
if(pBot > 0 && !is_nullent(pBot))
{
new Float:vecOrigin[coord_e], Float:vecVAngles[coord_e], Float:vecMins[coord_e], Float:vecMaxs[coord_e]

get_entvar(pBot, var_origin, vecOrigin)
get_entvar(pBot, var_v_angle, vecVAngles) // note: v_angle
get_entvar(pBot, var_mins, vecMins)
get_entvar(pBot, var_maxs, vecMaxs)

TransferItems(pBot, pPlayer)
KillBot(pBot, vecOrigin)

if(SetPlayerPosition(pPlayer, vecOrigin, vecVAngles, vecMins, vecMaxs, (get_entvar(pBot, var_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN))
{
SetHookChainReturn(ATYPE_INTEGER, pPlayer)
return HC_SUPERCEDE
}
}

return HC_CONTINUE
}

TransferItems(const pPlayer, const pReceiver, bool:bBackToBot = false)
{
if(!bBackToBot) {
set_entvar(pReceiver, var_health, Float:get_entvar(pPlayer, var_health))
}

new bitWeaponSlots, ArmorType:iArmortype, iArmorVal
if((iArmorVal = rg_get_user_armor(pPlayer, iArmortype)) > 0 && iArmortype != ARMOR_NONE) {
rg_set_user_armor(pReceiver, iArmorVal, iArmortype)
}

if(get_member(pPlayer, m_bHasNightVision)) {
set_member(pReceiver, m_bHasNightVision, true)
}
// if(get_member(pPlayer, m_fLongJump)) {
// set_member(pReceiver, m_fLongJump, true)
// }

if(g_bMapHasBombTarget)
{
if(!bBackToBot && get_member(pPlayer, m_bHasC4)) {
rg_transfer_c4(pPlayer, pReceiver)
}
if(get_member(pPlayer, m_bHasDefuser))
{
rg_give_defusekit(pReceiver)
rg_remove_item(pPlayer, "item_thighpack")
}
}

new pActiveItem = get_member(pPlayer, m_pActiveItem)
for(new WeaponIdType:iId, iBpAmmo, pItem, pNextItem, Float:flReleaseThrow,
InventorySlotType:iSlot = PRIMARY_WEAPON_SLOT; iSlot <= GRENADE_SLOT; iSlot++
)
{
pItem = get_member(pPlayer, m_rgpPlayerItems, iSlot)
while(pItem > 0 && !is_nullent(pItem))
{
pNextItem = get_member(pItem, m_pNext)
if(iSlot == GRENADE_SLOT && pActiveItem == pItem)
{
flReleaseThrow = Float:get_member(pActiveItem, m_flReleaseThrow)
if(flReleaseThrow == 0.0) // ready to launch nade (get_entvar(pPlayer, var_button) & IN_ATTACK)
{
ExecuteHam(Ham_Item_Holster, pActiveItem, 1) // reset: m_flStartThrow & m_flReleaseThrow
set_entvar(pPlayer, var_button, get_entvar(pPlayer, var_button) &~ IN_ATTACK) // old ReGameDLL support
}
else if(flReleaseThrow > 0.0) // grenade throwed
{
ExecuteHam(Ham_Weapon_RetireWeapon, pActiveItem) // force switch to best weapon
pActiveItem = get_member(pPlayer, m_pActiveItem) // update active weapon
pItem = pNextItem
continue // skip it
}
}

if(iSlot != KNIFE_SLOT && !(INVALID_WEAPONS_BS & (1 << any:(iId = get_member(pItem, m_iId))))) {
iBpAmmo = rg_get_user_bpammo(pPlayer, iId)
}

if(!ExecuteHam(Ham_RemovePlayerItem, pPlayer, pItem)) // Removes an item to the player inventory (is failed ?).
{
pItem = pNextItem
continue
}

if(!ExecuteHam(Ham_AddPlayerItem, pReceiver, pItem)) // Add a weapon to the player inventory (is failed ?).
{
pItem = pNextItem
continue
}

ExecuteHam(Ham_Item_AttachToPlayer, pItem, pReceiver)

if(iBpAmmo > 0) {
rg_set_user_bpammo(pReceiver, iId, iBpAmmo)
}

bitWeaponSlots |= (1 << any:iSlot)
pItem = pNextItem
}
}

if(pActiveItem > 0 && !is_nullent(pActiveItem))
{
rg_switch_weapon(pReceiver, pActiveItem)

if(get_member(pPlayer, m_bOwnsShield))
{
rg_give_shield(pReceiver)
if(!IsBot(pReceiver) && get_member(pPlayer, m_bShieldDrawn)) { // get_member(pActiveItem, m_Weapon_iWeaponState) & WPNSTATE_SHIELD_DRAWN
ExecuteHam(Ham_Weapon_SecondaryAttack, pActiveItem)
}
rg_remove_item(pPlayer, "weapon_shield")
}
}

return bitWeaponSlots
}

bool:SetPlayerPosition(const pPlayer, Float:vecOrigin[coord_e], Float:vecAngles[coord_e], Float:vecMins[coord_e], Float:vecMaxs[coord_e], const iHullNumber)
{
static const Float:vecMove[][coord_e] = { { 1.0, 1.0, 0.0 }, { 1.0, -1.0, 0.0 }, { -1.0, -1.0, 0.0 }, { -1.0, 1.0, 0.0 } }
new i

do
{
if(IsFreeSpace(vecOrigin, iHullNumber))
{
if(iHullNumber == HULL_HEAD)
{
set_entvar(pPlayer, var_flags, get_entvar(pPlayer, var_flags) | FL_DUCKING)
set_entvar(pPlayer, var_button, get_entvar(pPlayer, var_button) | IN_DUCK)
}

SET_SIZE(pPlayer, vecMins, vecMaxs)
SET_ORIGIN(pPlayer, vecOrigin)
set_entvar(pPlayer, var_velocity, VECTOR_ZERO)
// set_entvar(pPlayer, var_basevelocity, VECTOR_ZERO)
set_entvar(pPlayer, var_v_angle, VECTOR_ZERO)
set_entvar(pPlayer, var_angles, vecAngles)
set_entvar(pPlayer, var_punchangle, VECTOR_ZERO)
set_entvar(pPlayer, var_fixangle, 1) // const FORCE_VIEW_ANGLES = 1

return true
}
else
{
vecOrigin[X] = (vecOrigin[X] - vecMins[X] * vecMove[i][X])
vecOrigin[Y] = (vecOrigin[Y] - vecMins[Y] * vecMove[i][Y])
i++
}

// server_print("Attemps: %i", i)
} while (i < sizeof(vecMove))

return false
}

KillBot(const pBot, Float:vecOrigin[coord_e])
{
set_member(pBot, m_vBlastVector, vecOrigin) // FIX: "PM Got a NaN velocity"
set_member(pBot, m_bKilledByBomb, true) // HACK: block sending "DeathMsg" & frag loses
set_entvar(pBot, var_effects, EF_NODRAW) // hide corpse
// SET_ORIGIN(pBot, VECTOR_ZERO) // FIX: panic bot's
dllfunc(DLLFunc_ClientKill, pBot)
}

FullResetPlayer(const pPlayer)
{
set_user_info(pPlayer, "*bot", "0")
rg_reset_user_model(pPlayer, true)
g_aPlayerData[pPlayer][pBotIndex] = g_aPlayerData[pPlayer][iUsedCount] = 0
}

PrintChatAll(const pPlayer, const szName[], const szNameBot[])
{
new aPlayers[32], iCount, pReceiver
get_players(aPlayers, iCount, "ch") // skip bot's & hltv

for(--iCount; iCount >= 0; iCount--)
{
pReceiver = aPlayers[iCount]
if(pPlayer != pReceiver) {
client_print_color(pReceiver, pPlayer, "^4* ^1Игрок ^3%s ^1занял место бота ^3%s", szName, szNameBot)
}
}
}

SetBotName(const pBot, const szName[])
{
if(szName[0])
{
set_user_info(pBot, "name", szName)
set_entvar(pBot, var_netname, szName)
}
}

// checks if a space is vacant, by VEN
stock bool:IsFreeSpace(Float:vecOrigin[coord_e], const iHullNumber, const pSkipEnt = 0)
{
const pTR = 0 // Global traceresult handle
engfunc(EngFunc_TraceHull, vecOrigin, vecOrigin, DONT_IGNORE_MONSTERS, iHullNumber, pSkipEnt, pTR)

return bool:(!get_tr2(pTR, TR_StartSolid) && !get_tr2(pTR, TR_AllSolid) && get_tr2(pTR, TR_InOpen))
}

stock ScenarioIcon(const pPlayer, const iStatus = 1)
{
static iMsgIdScenario
if(iMsgIdScenario > 0 || (iMsgIdScenario = get_user_msgid("Scenario")))
{
message_begin(MSG_ONE_UNRELIABLE, iMsgIdScenario, .player = pPlayer)
write_byte(iStatus)
write_string("hostage1")
write_byte(150)
message_end()
}
}
Всем доброго вечера.
Вообщем, при заходе у ребят меняются ники на ники ботов или на ники тех, кто использовал бота.
Пример: мой ник SNauPeR, я зашёл на сервер...
Вижу ник в TABе - [Djon] Carn ; где [Живой игрок] Бот
Причем НИК в моих настройках - не меняется...
14 Окт 2018
Забыл добавить, использую z bot 1.5
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу