Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

RSSBots to use a parachute


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
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
   
}


Przeczytaj cały wpis

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...