Raised This Month: $32 Target: $400
 8% 

Solved [REQ] Small Help for PodBot


Post New Thread Reply   
 
Thread Tools Display Modes
shehzad1234
BANNED
Join Date: Jan 2016
Location: https://t.me/pump_upp
Old 02-09-2017 , 06:54   Re: [REQ] Small Help for PodBot
Reply With Quote #31

Quote:
Originally Posted by EFFx View Post
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(iVictimpev_flags) | FL_FROZEN)
            {
                
set_pev(iVictimpev_flagspev(iVictimpev_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(PLUGINVERSIONAUTHOR)
    
    
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(idpev_flags) & ~FL_FROZEN)
        {
            
set_pev(idpev_buttonpev(id,pev_button) & ~IN_ATTACK)
            
set_pev(idpev_flagspev(idpev_flags) | FL_FROZEN)
        }
    }
    else
    {
        if(
pev(idpev_flags) | FL_FROZEN)
        {
            
set_pev(idpev_flagspev(idpev_flags) & ~FL_FROZEN)
        }
    }
}

public 
deathMsg()
{
      new 
iVictim read_data(2)
      if(
is_user_bot(iVictim))
      {
            if(
pev(iVictimpev_flags) | FL_FROZEN)
            {
                
set_pev(iVictimpev_flagspev(iVictimpev_flags) & ~FL_FROZEN)
            }
      }

Thanks @EFFx Bro
its Working
shehzad1234 is offline
Send a message via ICQ to shehzad1234 Send a message via AIM to shehzad1234 Send a message via Yahoo to shehzad1234
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode