AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   entity not solid:( (https://forums.alliedmods.net/showthread.php?t=251165)

avril-lavigne 11-07-2014 04:24

entity not solid:(
 
PHP Code:


        
new Float:MinBox[3], Float:MaxBox[3]
        new 
ent create_entity("info_target")
            
        
entity_set_string(ent,EV_SZ_classnamemegaclass)    
        
entity_set_int(entEV_INT_solidSOLID_BBOX)
    
entity_set_int(entEV_INT_movetypeMOVETYPE_FLY)
        
    
MinBox[0] = -3.0;    MinBox[1] = -3.0;    MinBox[2] = -3.0
    MaxBox
[0] =  3.0;    MaxBox[1] =  3.0;    MaxBox[2] =  3.0
    entity_set_vector
(entEV_VEC_minsMinBox)
    
entity_set_vector(entEV_VEC_maxsMaxBox)    
                    
                                      
        
entity_set_origin(entfOrigin)                                            
    
entity_set_model(ent,T_MDL)
    
entity_set_int(entEV_INT_team1)
    
entity_set_float(ent,EV_FL_nextthink,halflife_time() + 1.0

I still can walk thru it
func_breakable is not an option

HamletEagle 11-07-2014 05:19

Re: entity not solid:(
 
Extraced from one of my plugins, it may help you:
Code:
static iEnt; iEnt = create_entity( "info_target" ) static Float: fEntityMins[ 3 ]; fEntityMins = Float:{ -30.0, -20.0, -21.0 } static Float: fEntityMaxs[ 3 ]; fEntityMaxs = Float:{  30.0,  20.0,  29.0 } engfunc( EngFunc_SetOrigin, iEnt, vecOrigin ) set_pev( iEnt, pev_solid, SOLID_BBOX ) engfunc( EngFunc_SetModel, iEnt, szModel ) engfunc( EngFunc_SetSize, iEnt, fEntityMins, fEntityMaxs ) set_pev( iEnt, pev_classname, szClassName ) set_pev( iEnt, pev_mins, fEntityMins ) set_pev( iEnt, pev_maxs, fEntityMaxs ) set_pev( iEnt, pev_absmin, fEntityMins ) set_pev( iEnt, pev_absmax, fEntityMaxs ) //set_pev( iEnt, pev_movetype, MOVETYPE_FLY )//you may not need it.

Jhob94 11-07-2014 06:18

Re: entity not solid:(
 
Quote:

Originally Posted by HamletEagle (Post 2221210)
Extraced from one of my plugins, it may help you:
Code:
static iEnt; iEnt = create_entity( "info_target" ) static Float: fEntityMins[ 3 ]; fEntityMins = Float:{ -30.0, -20.0, -21.0 } static Float: fEntityMaxs[ 3 ]; fEntityMaxs = Float:{  30.0,  20.0,  29.0 } engfunc( EngFunc_SetOrigin, iEnt, vecOrigin ) set_pev( iEnt, pev_solid, SOLID_BBOX ) engfunc( EngFunc_SetModel, iEnt, szModel ) engfunc( EngFunc_SetSize, iEnt, fEntityMins, fEntityMaxs ) set_pev( iEnt, pev_classname, szClassName ) //set_pev( iEnt, pev_movetype, MOVETYPE_FLY )//you may not need it.

Just that is enough to create a solid entity.
Avril i guess what was missing in your code was this: engfunc( EngFunc_SetSize, iEnt, fEntityMins, fEntityMaxs )

ezio_auditore 11-09-2014 00:38

Re: entity not solid:(
 
Try This maybe
Code:
new Float:fOrigin[3], Float:fAngle[3], Float:fVelocity[3] pev(id, pev_origin, fOrigin) pev(id, pev_v_angle, fAngle) new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target")) entity_set_string(ent, EV_SZ_classname, "ent_name") entity_set_edict(ent, EV_ENT_owner, id) entity_set_model(ent, ENT_MODEL) entity_set_origin(ent, fOrigin) entity_set_vector(ent, EV_VEC_angles, fAngle) new Float:MinBox[3] = {-1.0, -1.0, -1.0} new Float:MaxBox[3] = {1.0, 1.0, 1.0} entity_set_vector(ent, EV_VEC_mins, MinBox) entity_set_vector(ent, EV_VEC_maxs, MaxBox) entity_set_int(ent, EV_INT_solid, SOLID_BBOX) entity_set_int(ent, EV_INT_movetype, MOVETYPE_FLY) entity_set_edict(ent, EV_ENT_owner, id) VelocityByAim(id, 2500, fVelocity) entity_set_vector(ent, EV_VEC_velocity, fVelocity)

This is from one of my plugins. Works nice.


All times are GMT -4. The time now is 17:30.

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