Raised This Month: $ Target: $400
 0% 

i want to create multiple CLASSNAME


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
gcz
Junior Member
Join Date: Feb 2016
Old 02-17-2017 , 08:40   i want to create multiple CLASSNAME
Reply With Quote #1

how to create ten chicken and ten classname

// create ten chicken
for( i=0; i<10; i++ )
{
Ent = create_entity("info_target")
...
.....
........
entity_set_string( Ent, EV_SZ_classname, CLASSNAME + i ); // CLASSNAME1 CLASSNAME2 ...... CLASSNAME10
........
......
....
}

// find ten chicken
while ( Ent = find_ent_by_class( Ent, CLASSNAME1 ) > 0 )
while ( Ent = find_ent_by_class( Ent, CLASSNAME2 ) > 0 )
....
......
.........
while Ent = find_ent_by_class( Ent, CLASSNAME10 ) > 0 )


thank you so mush

Code:
/* Plugin generated by AMXX-Studio */
  
#include <amxmodx>
#include <amxmisc>
#include <engine>
  
#define PLUGIN "[engine.inc] set_rendering"
#define VERSION "1.0"
#define AUTHOR "Admin"
  
new Ent
new g_Model[] = {"models/chick.mdl"}
  
public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("say /chick","add_chicken")
      
}
public plugin_precache(){
    precache_model(g_Model)
}

public add_chicken(id){
      
    Ent = create_entity("info_target")
      
    if(is_valid_ent(Ent)){
          
        entity_set_model(Ent, g_Model)
        entity_set_size(Ent,Float:{-6.0, -10.0, 0.0},Float:{6.0, 10.0, 18.0})
        new Float:f_Origin[3]
        entity_get_vector(id, EV_VEC_origin, f_Origin)    
        f_Origin[0] += 50.0
        entity_set_origin(Ent, f_Origin)        
        entity_set_int(Ent,EV_INT_solid,SOLID_BBOX)

    
       entity_set_string(Ent, EV_SZ_classname, CLASSNAME);
          
        entity_set_float(Ent, EV_FL_takedamage, DAMAGE_YES)
          
        new Float:angles[3]
        angles[0] = 0.0
        angles[1] = 0.0
        angles[2] = 0.0
        entity_set_vector(Ent,EV_VEC_angles,angles)
          
        drop_to_floor(Ent)
    }
}
gcz is offline
 



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 20:59.


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