Raised This Month: $51 Target: $400
 12% 

Solved Bots to use a parachute


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ivani6651
Member
Join Date: Feb 2017
Old 12-20-2020 , 16:24   Bots to use a parachute
Reply With Quote #1

Can you make my bots be able to use a free parachute as and when they jump from a height!

PHP Code:
#include <amxmodx>
#include <engine>
#include <fun>
#include <hamsandwich>
 
#define PLUGIN "Parachute"
#define VERSION "1.0"
#define AUTHOR "Slavvkko"
 
new para_ent[33]
new 
pDetachpFallSpeedFloat:gravity[33]
 
public 
plugin_init()
{
   
register_plugin(PLUGINVERSIONAUTHOR);
   
pFallSpeed register_cvar("parachute_fallspeed""100")
   
pDetach register_cvar("parachute_detach""1")
   
register_event("DeathMsg""death_event""a")
   
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
}
 
public 
client_disconnect(id)
{
   
parachute_reset(id)
}
 
public 
death_event()
{
   new 
id read_data(2)
   
parachute_reset(id)
}
 
parachute_reset(id)
{
   if(
para_ent[id] > 0) {
      if (
is_valid_ent(para_ent[id])) {
         
remove_entity(para_ent[id])
      }
   }
 
   
para_ent[id] = 0
}
 
public 
fw_PlayerSpawn_Post(id)
{
   if (!
is_user_alive(id))
      return;
    
   
gravity[id] = get_user_gravity(id)
}
 
public 
zp_user_infected_post(idinfectornemesis)
{
   
gravity[id] = get_user_gravity(id)
}
 
public 
zp_user_humanized_post(idsurvivor)
{
   
gravity[id] = get_user_gravity(id)
}
 
public 
client_PreThink(id)
{
   
//parachute.mdl animation information
   //0 - deploy - 84 frames
   //1 - idle - 39 frames
   //2 - detach - 29 frames
 
   
if (!is_user_alive(id)) return
 
   new 
Float:fallspeed get_pcvar_float(pFallSpeed) * -1.0
   
new Float:frame
 
   
new button get_user_button(id)
   new 
oldbutton get_user_oldbutton(id)
   new 
flags get_entity_flags(id)
    
   if (
para_ent[id] > && (flags FL_ONGROUND)) {
 
      if (
get_pcvar_num(pDetach)) {
 
         if (
get_user_gravity(id) == 0.1set_user_gravity(idgravity[id])
 
         if (
entity_get_int(para_ent[id],EV_INT_sequence) != 2) {
            
entity_set_int(para_ent[id], EV_INT_sequence2)
            
entity_set_int(para_ent[id], EV_INT_gaitsequence1)
            
entity_set_float(para_ent[id], EV_FL_frame0.0)
            
entity_set_float(para_ent[id], EV_FL_fuser10.0)
            
entity_set_float(para_ent[id], EV_FL_animtime0.0)
            
entity_set_float(para_ent[id], EV_FL_framerate0.0)
            return
         }
 
         
frame entity_get_float(para_ent[id],EV_FL_fuser1) + 2.0
         entity_set_float
(para_ent[id],EV_FL_fuser1,frame)
         
entity_set_float(para_ent[id],EV_FL_frame,frame)
 
         if (
frame 254.0) {
            
remove_entity(para_ent[id])
            
para_ent[id] = 0
         
}
      }
      else {
         
remove_entity(para_ent[id])
         
set_user_gravity(idgravity[id])
         
para_ent[id] = 0
      
}
 
      return
   }
 
   if (
button IN_USE) {
       
      new 
Float:velocity[3]
      
entity_get_vector(idEV_VEC_velocityvelocity)
 
      if (
velocity[2] < 0.0) {
 
         if(
para_ent[id] <= 0) {
            
para_ent[id] = create_entity("info_target")
            if(
para_ent[id] > 0) {
               
entity_set_string(para_ent[id],EV_SZ_classname,"parachute")
               
entity_set_edict(para_ent[id], EV_ENT_aimentid)
               
entity_set_edict(para_ent[id], EV_ENT_ownerid)
               
entity_set_int(para_ent[id], EV_INT_movetypeMOVETYPE_FOLLOW)
               
entity_set_int(para_ent[id], EV_INT_sequence0)
               
entity_set_int(para_ent[id], EV_INT_gaitsequence1)
               
entity_set_float(para_ent[id], EV_FL_frame0.0)
               
entity_set_float(para_ent[id], EV_FL_fuser10.0)
            }
         }
 
         if (
para_ent[id] > 0) {
 
            
entity_set_int(idEV_INT_sequence3)
            
entity_set_int(idEV_INT_gaitsequence1)
            
entity_set_float(idEV_FL_frame1.0)
            
entity_set_float(idEV_FL_framerate1.0)
            
set_user_gravity(id0.1)
 
            
velocity[2] = (velocity[2] + 40.0 fallspeed) ? velocity[2] + 40.0 fallspeed
            entity_set_vector
(idEV_VEC_velocityvelocity)
 
            if (
entity_get_int(para_ent[id],EV_INT_sequence) == 0) {
 
               
frame entity_get_float(para_ent[id],EV_FL_fuser1) + 1.0
               entity_set_float
(para_ent[id],EV_FL_fuser1,frame)
               
entity_set_float(para_ent[id],EV_FL_frame,frame)
 
               if (
frame 100.0) {
                  
entity_set_float(para_ent[id], EV_FL_animtime0.0)
                  
entity_set_float(para_ent[id], EV_FL_framerate0.4)
                  
entity_set_int(para_ent[id], EV_INT_sequence1)
                  
entity_set_int(para_ent[id], EV_INT_gaitsequence1)
                  
entity_set_float(para_ent[id], EV_FL_frame0.0)
                  
entity_set_float(para_ent[id], EV_FL_fuser10.0)
               }
            }
         }
      }
      else if (
para_ent[id] > 0) {
         
remove_entity(para_ent[id])
         
set_user_gravity(idgravity[id])
         
para_ent[id] = 0
      
}
   }
   else if ((
oldbutton IN_USE) && para_ent[id] > ) {
      
remove_entity(para_ent[id])
      
set_user_gravity(idgravity[id])
      
para_ent[id] = 0
   
}


Last edited by ivani6651; 12-23-2020 at 11:28.
ivani6651 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-21-2020 , 08:22   Re: Bots to use a parachute
Reply With Quote #2

Most of the code you posted is useless now since the parachute model was removed. Check the Approved parachute. Bots that previously did not parachute can now since I added an auto rip-cord CVAR.
__________________
DJEarthQuake is offline
ivani6651
Member
Join Date: Feb 2017
Old 12-21-2020 , 15:41   Re: Bots to use a parachute
Reply With Quote #3

For whom specifically do you mean, on this one of mine, nothing that no model can be made?
ivani6651 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-22-2020 , 11:30   Re: Bots to use a parachute
Reply With Quote #4

Quote:
Originally Posted by ivani6651 View Post
For whom specifically do you mean, on this one of mine, nothing that no model can be made?
Do you want a model? Yes or no?
Somebody can add the zombie code into bot parachute plugin. What plugin does it go to?
Any more double talk; you are on your own.
__________________

Last edited by DJEarthQuake; 12-22-2020 at 11:32.
DJEarthQuake is offline
ivani6651
Member
Join Date: Feb 2017
Old 12-22-2020 , 12:52   Re: Bots to use a parachute
Reply With Quote #5

Quote:
Originally Posted by DJEarthQuake View Post
Do you want a model? Yes or no?
Somebody can add the zombie code into bot parachute plugin. What plugin does it go to?
Any more double talk; you are on your own.
Do you want a model?

No, but just bots use parachute for original mod on zombie plague 4.3.
ivani6651 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-22-2020 , 13:16   Re: Bots to use a parachute
Reply With Quote #6

That's a Counter-Strike/Condition Zero plugin?

Tell me more.
  • What bots and mod do you use?
  • Does map crash server trying to load parachute model?
__________________
DJEarthQuake is offline
ivani6651
Member
Join Date: Feb 2017
Old 12-22-2020 , 14:15   Re: Bots to use a parachute
Reply With Quote #7

Counter-Strike plugin.

YAPB Bots ----> https://yapb.ru/

I will use it for zombie plague 4.3 mod, but so far I have not had crashes, because the bots themselves do not have the option to use a parachute.

Last edited by ivani6651; 12-22-2020 at 14:15.
ivani6651 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-22-2020 , 19:08   Re: Bots to use a parachute
Reply With Quote #8

Quote:
Originally Posted by ivani6651 View Post
Counter-Strike plugin.

YAPB Bots ----> https://yapb.ru/

I will use it for zombie plague 4.3 mod, but so far I have not had crashes, because the bots themselves do not have the option to use a parachute.
Code:
/*𝓼𝓹𝓲𝓷𝔁*/ #include <amxmodx> #include <engine> #include <fakemeta> #include <fun> #define PLUGIN "Auto Null Parachute" #define VERSION "0.1" #define AUTHOR "SPiNX" #define MAX_AUTHID_LENGTH          64 #define MAX_IP_LENGTH              16 new pAutoDeploy, pFallSpeed, pParaModel, g_model; public plugin_init() {    register_plugin(PLUGIN, VERSION, AUTHOR);    pFallSpeed  = register_cvar("parachute_fallspeed", "100");    pAutoDeploy = register_cvar("parachute_autorip", "200");    pParaModel  = register_cvar("parachute_model", "1"); } public plugin_precache()    g_model = precache_model("sprites/steam1.spr"); public client_PreThink(id) {    if (is_user_connecting(id) || !is_user_connected(id) || !is_user_alive(id))       return;    else    {        new Rip_Cord = get_pcvar_num(pAutoDeploy);        new AUTO;        AUTO = (pev(id,pev_flFallVelocity) >= (get_pcvar_num(pFallSpeed) + Rip_Cord) );        new Float:fallspeed = get_pcvar_float(pFallSpeed) * -1.0        new button = get_user_button(id), oldbutton = get_user_oldbutton(id), flags = get_entity_flags(id);        if(flags & FL_ONGROUND)        {           if (get_user_gravity(id) == 0.1)              set_user_gravity(id, 1.0)           return        }        if(button & IN_USE|AUTO)        {           new Float:velocity[3]           entity_get_vector(id, EV_VEC_velocity, velocity)           set_user_gravity(id, 0.1)           velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed           if(get_pcvar_num(pParaModel))           {               entity_set_vector(id, EV_VEC_velocity, velocity)               emessage_begin( MSG_PVS, SVC_TEMPENTITY, { 0, 0, 0 }, 0 );               ewrite_byte(TE_PLAYERATTACHMENT)               ewrite_byte(id)               ewrite_coord(-MAX_AUTHID_LENGTH)               ewrite_short(g_model)               ewrite_short(MAX_IP_LENGTH) //life               emessage_end();           }        }        else if (oldbutton & IN_USE)           set_user_gravity(id, 1.0);     } }

Automatic null chute for both humans and bots. Custom waypoints were required for AI to jump down with Ping Of Death Bots.
__________________

Last edited by DJEarthQuake; 12-22-2020 at 21:06. Reason: Hover on a cloud model CVAR.
DJEarthQuake is offline
ivani6651
Member
Join Date: Feb 2017
Old 12-23-2020 , 00:41   Re: Bots to use a parachute
Reply With Quote #9

Why don't you see their parachute now that they're jumping?
ivani6651 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-23-2020 , 05:15   Re: Bots to use a parachute
Reply With Quote #10

Quote:
Originally Posted by DJEarthQuake View Post
Most of the code you posted is useless now since the parachute model was removed. Check the Approved parachute. Bots that previously did not parachute can now since I added an auto rip-cord CVAR.
Quote:
Originally Posted by ivani6651 View Post
do you want a model?

No, but just bots use parachute for original mod on zombie plague 4.3.
Quote:
Originally Posted by ivani6651 View Post
why don't you see their parachute now that they're jumping?
That's what you asked for. You were questioned over multiple days why the no model; and are you sure, that is what you want.

Change MSG_PVS to MSG_BROADCAST to go outside the PVS to see the graphic more often. It's a hover cloud not a parachute. You removed that code and did not want back. Remember?

Go to this post to get bot parachute with working models.
https://forums.alliedmods.net/showpo...&postcount=253
__________________
DJEarthQuake is offline
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 07:05.


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