Raised This Month: $ Target: $400
 0% 

entity takedamage and solid


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Kazalu
Senior Member
Join Date: Dec 2013
Location: Romania
Old 12-27-2015 , 09:00   entity takedamage and solid
Reply With Quote #1

Hey, guys.I am trying to create an entity that takes damage and is solid, but I cannot get it to work.Here's the code.

HTML Code:
public CmdSpawn( id )
{
new Float:Origin[ 3 ];
pev( id, pev_origin, Origin );

Origin[ 1 ] += 50.0;

SpawnEntities( id, Origin );
}

public SpawnEntities( owner, Float:Origin[ 3 ] )
{
new ent = create_entity( "info_target" );

if( ent )
{
entity_set_origin( ent, Origin );
new Float:maxs[3] = {100.0,100.0,100.0};
new Float:mins[3] = {-100.0,-100.0,-100.0};
entity_set_size( ent, mins, maxs );
entity_set_int( ent, EV_INT_solid, 2 );
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 );
entity_set_float( ent, EV_FL_takedamage, 1.0 );
entity_set_float( ent, EV_FL_health, 100.0 );
entity_set_float( ent, EV_FL_max_health, 100.0 );
entity_set_string( ent, EV_SZ_classname, "npc_zombie" );
entity_set_model( ent, zmModel1 );
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 );
}
}

public npc_think( ent )
{
entity_set_float( ent, EV_FL_nextthink, halflife_time() + 0.01 );
}

Last edited by Arkshine; 12-27-2015 at 13:36.
Kazalu is offline
 


Thread Tools
Display Modes

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 17:55.


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