Raised This Month: $ Target: $400
 0% 

problem +USE in ent


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 01-29-2010 , 19:45   Re: problem +USE in ent
Reply With Quote #6

Try something like this


PHP Code:
new g_HamUse

public plugin_init()
{
      
register_plugin(......
}

public 
cosa(id)
{
 
     new 
Float:origin[3
 
     
entity_get_vector(id,EV_VEC_origin,origin)
 
     new 
ent create_entity("info_target")
     
entity_set_string(ent,EV_SZ_classname,"cosa"); 

     if(!
g_HamUse)
     {
          
g_HamUse RegisterHam(Ham_Use"cosa""ToqueLaCosa")
     }
     
 
     
entity_set_origin(ent,origin); 
     
origin[2] += 100.0
     entity_set_origin
(id,origin)
 
     
entity_set_float(ent,EV_FL_takedamage,1.0
     
entity_set_float(ent,EV_FL_health,100.0
 
     
entity_set_model(ent,"models/a.mdl"); 
     
entity_set_int(ent,EV_INT_solid2)
 
     
entity_set_byte(ent,EV_BYTE_controller1,125);
     
entity_set_byte(ent,EV_BYTE_controller2,125);
     
entity_set_byte(ent,EV_BYTE_controller3,125);
     
entity_set_byte(ent,EV_BYTE_controller4,125);
 
     new 
Float:maxs[3] = {16.0,16.0,36.0}
     new 
Float:mins[3] = {-16.0,-16.0,-36.0}
     
entity_set_size(ent,mins,maxs)
 
     
entity_set_float(ent,EV_FL_animtime,2.0
     
entity_set_float(ent,EV_FL_framerate,1.0
     
entity_set_int(ent,EV_INT_sequence,0);
 
     
entity_set_float(ent,EV_FL_nextthink,halflife_time() + 0.01)
 
     
drop_to_floor(ent)
     return 
1;
 } 
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.

Last edited by joropito; 01-29-2010 at 19:52.
joropito is offline
Send a message via MSN to joropito
 



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:21.


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