|
BANNED
Join Date: Jan 2016
Location: https://t.me/pump_upp
|
02-09-2017
, 06:54
Re: [REQ] Small Help for PodBot
|
#31
|
Quote:
Originally Posted by EFFx
He want freeze the podbots when he change a cvar, not at spawn. Similar to when you use bot_stop 1 for freeze the bots on non steam CS. Also, looping players with for() is a poor way.
PHP Code:
set_task(0.1, "check_frozen", 0, _, _, "b")
Unecessary
And you can unfreeze the bot died with deathmsg. Just add a check for see if the bot is freezed and unfreeze him. I'll try to do It right now because i havent a PC. So i'll write at phone:
PHP Code:
register_event("DeathMsg", "deathMsg", "a")
PHP Code:
public deathMsg()
{
new iVictim = read_data(2)
if(is_user_bot(iVictim))
{
if(pev(iVictim, pev_flags) | FL_FROZEN)
{
set_pev(iVictim, pev_flags, pev(iVictim, pev_flags) & ~FL_FROZEN)
}
}
}
->
PHP Code:
#include <amxmodx>
#include <fakemeta>
#define PLUGIN "Freeze Botbots"
#define VERSION "1.0"
#define AUTHOR "author"
new pCvarFreeze
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg", "deathMsg", "a")
pCvarFreeze = register_cvar("pb_freeze","0")
}
public client_PreThink(id)
{
if(!is_user_bot(id))
return
if(get_pcvar_num(pCvarFreeze))
{
if(pev(id, pev_flags) & ~FL_FROZEN)
{
set_pev(id, pev_button, pev(id,pev_button) & ~IN_ATTACK)
set_pev(id, pev_flags, pev(id, pev_flags) | FL_FROZEN)
}
}
else
{
if(pev(id, pev_flags) | FL_FROZEN)
{
set_pev(id, pev_flags, pev(id, pev_flags) & ~FL_FROZEN)
}
}
}
public deathMsg()
{
new iVictim = read_data(2)
if(is_user_bot(iVictim))
{
if(pev(iVictim, pev_flags) | FL_FROZEN)
{
set_pev(iVictim, pev_flags, pev(iVictim, pev_flags) & ~FL_FROZEN)
}
}
}
|
Thanks @EFFx Bro
its Working
|
|
|
|