Raised This Month: $32 Target: $400
 8% 

Solid props


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xSaG
Junior Member
Join Date: Sep 2018
Location: Romānia
Old 01-10-2020 , 10:41   Solid props
Reply With Quote #1

I have a problem with creating entities and make them solid for everything ( Guns, C4, etc...)

Me code:

PHP Code:
if(PlayerCount MoreThan && (LessThan == || PlayerCount LessThan))
{
if(
PrecacheModel(model,true) == 0)
SetFailState("[MapRestrictions] - Error precaching model '%s'"model);

int Ent CreateEntityByName("prop_dynamic");

DispatchKeyValue(Ent"solid""6");
DispatchKeyValue(Ent"model"model);
DispatchSpawn(Ent);
SetEntityMoveType(EntMOVETYPE_PUSH)
TeleportEntity(EntoriginanglesNULL_VECTOR);
props.Push(Ent);

Thanks!

Last edited by xSaG; 01-10-2020 at 10:41.
xSaG is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 01-11-2020 , 15:18   Re: Solid props
Reply With Quote #2

Some models dont have proper physics data to collide
Make sure they have first with just your player model
Indarello is offline
xSaG
Junior Member
Join Date: Sep 2018
Location: Romānia
Old 01-13-2020 , 07:16   Re: Solid props
Reply With Quote #3

Quote:
Originally Posted by Indarello View Post
Some models dont have proper physics data to collide
Make sure they have first with just your player model
Use models\props_c17\fence01a.mdl
xSaG is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 01-13-2020 , 07:20   Re: Solid props
Reply With Quote #4

You could try: DispatchKeyValue(Ent, "solid", "2")

But as Indarello said, it probably has no collision data in the model. "2" might work but the model might have to be angled to 90/180 degrees on the map otherwise there will be invisible barrier in those directions not aligned with the model. iirc. You could also try using another model which has collision data and making that invisible, putting both in the same position/angle. If you need it to move you could try parenting the visible model to the invisible model. Might work.
__________________

Last edited by Silvers; 01-13-2020 at 07:20.
Silvers is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 01-13-2020 , 07:42   Re: Solid props
Reply With Quote #5

maybe you should use a "prop_physics_override".....
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<
andi67 is offline
tonline_kms65
Member
Join Date: Aug 2016
Location: Ru. Komsomol-on-Amur
Old 01-18-2020 , 06:12   Re: Solid props
Reply With Quote #6

You get the dimensions and coordinates of the model that needs collision physics
PHP Code:
       GetEntPropVector(modelProp_Send"m_vecOrigin"fPos);
       
GetEntPropVector(modelProp_Send"m_vecMins"fMins);
       
GetEntPropVector(modelProp_Send"m_vecMaxs"fMaxs); 
You create a collision box with the resulting dimensions and coordinates
PHP Code:
Create_FuncDetail( const float fPos[3], const float fMaxs[3], const float fMins[3]){
    
int ent CreateEntityByName("func_detail");
    if(
ent != -1) {
    
    
SetEntityModel(entMYMODEL);
    
DispatchSpawn(ent );
    
ActivateEntity(ent );
    
SetEntProp(ent Prop_Send"m_nSolidType"2);
    
SetEntProp(ent Prop_Send"m_fEffects"GetEntProp(entProp_Send"m_fEffects") | 32);
    
    
SetEntPropVector(ent Prop_Send"m_vecMins"fMins);
    
SetEntPropVector(ent Prop_Send"m_vecMaxs"fMaxs);
    
    
TeleportEntity(ent fPosNULL_VECTORNULL_VECTOR);
    }   

This will create a simple box like a brush in a Hummer

Last edited by tonline_kms65; 01-18-2020 at 06:26.
tonline_kms65 is offline
xSaG
Junior Member
Join Date: Sep 2018
Location: Romānia
Old 01-19-2020 , 11:22   Re: Solid props
Reply With Quote #7

Quote:
Originally Posted by tonline_kms65 View Post
You get the dimensions and coordinates of the model that needs collision physics
PHP Code:
       GetEntPropVector(modelProp_Send"m_vecOrigin"fPos);
       
GetEntPropVector(modelProp_Send"m_vecMins"fMins);
       
GetEntPropVector(modelProp_Send"m_vecMaxs"fMaxs); 
You create a collision box with the resulting dimensions and coordinates
PHP Code:
Create_FuncDetail( const float fPos[3], const float fMaxs[3], const float fMins[3]){
    
int ent CreateEntityByName("func_detail");
    if(
ent != -1) {
    
    
SetEntityModel(entMYMODEL);
    
DispatchSpawn(ent );
    
ActivateEntity(ent );
    
SetEntProp(ent Prop_Send"m_nSolidType"2);
    
SetEntProp(ent Prop_Send"m_fEffects"GetEntProp(entProp_Send"m_fEffects") | 32);
    
    
SetEntPropVector(ent Prop_Send"m_vecMins"fMins);
    
SetEntPropVector(ent Prop_Send"m_vecMaxs"fMaxs);
    
    
TeleportEntity(ent fPosNULL_VECTORNULL_VECTOR);
    }   

This will create a simple box like a brush in a Hummer
thanks
xSaG is offline
Reply


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 01:40.


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