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

Setting CBaseEntity Error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr. McSi
Junior Member
Join Date: Jul 2013
Location: Planet Code
Old 03-18-2014 , 11:38   Setting CBaseEntity Error
Reply With Quote #1

PHP Code:
stock CreateCollisionHook (index) {
    if(
index >= && index 50) {
        
//decl
        
new Float:mins[3], Float:middle[3], Float:maxs[3], String:roomName[64], Handle:tempArray;
        
        
//pulling smaller array out of bigger
        
tempArray GetArrayCell(currentRoomsindex);
        
        
//pulling cells for local vectors
        
GetArrayString(tempArray0roomNamesizeof(roomName)); //name
        
GetArrayArray(tempArray1mins); //mins
        
GetArrayArray(tempArray2maxs); //maxs
        
        
new iEnt CreateEntityByName("trigger_multiple");
        
        
DispatchKeyValue(iEnt"spawn_flags""64");
        
Format(roomNamesizeof(roomName), "sm_room %s"roomName);
        
DispatchKeyValue(iEnt"targetname"roomName);
        
DispatchKeyValue(iEnt"wait""0");
        
        
DispatchSpawn(iEnt);
        
ActivateEntity(iEnt);
        
SetEntProp(iEntProp_Data"m_spawnflags"64);
        
        
GetMiddleOfABox(minsmaxsmiddle);
        
        
TeleportEntity(iEntmiddleNULL_VECTORNULL_VECTOR);
        
SetEntityModel(iEnt"models/items/car_battery01.mdl");
        
        
SetEntPropVector(iEntProp_Send"m_vecMins"mins);
        
SetEntPropVector(iEntProp_Send"m_vecMaxs"maxs);
        
SetEntProp(iEntProp_Send"m_nSolidType"2);
        
        
HookSingleEntityOutput(iEnt"OnStartTouch"hookMethod);
    }

With this code I am continually getting the error "Setting CBaseEntity to non-brush model models/items/car_battery01.mdl" This error is crashing the server.

Would love some advice, thanks.

-Dr. McSi
__________________
Dr. McSi is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 03-18-2014 , 12:42   Re: Setting CBaseEntity Error
Reply With Quote #2

You are trying to set model to trigger_multiple brush.
Don't.

If you want know when something touch that model, create prop_dynamic_override, prop_physics or else.
Bacardi is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 03-18-2014 , 13:08   Re: Setting CBaseEntity Error
Reply With Quote #3

Actually... it requires a model, even if its not brush model. Otherwise touch functions will not work.
McSi you want to set model to generic one, aka "models/error.mdl". Dont forget to precache it at map start!
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ is offline
Dr. McSi
Junior Member
Join Date: Jul 2013
Location: Planet Code
Old 03-18-2014 , 18:55   Re: Setting CBaseEntity Error
Reply With Quote #4

Quote:
Originally Posted by Root_ View Post
Actually... it requires a model, even if its not brush model. Otherwise touch functions will not work.
McSi you want to set model to generic one, aka "models/error.mdl". Dont forget to precache it at map start!
That didn't work, crashed again, same error.
__________________
Dr. McSi is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 03-19-2014 , 16:10   Re: Setting CBaseEntity Error
Reply With Quote #5

PHP Code:
new enteffects GetEntProp(entindexProp_Send"m_fEffects");
enteffects |= 32;
SetEntProp(entindexProp_Send"m_fEffects"enteffects); 
you missed that, try adding that after spawning the entity, if you still crash then try moving before spawning it.
blodia is offline
Dr. McSi
Junior Member
Join Date: Jul 2013
Location: Planet Code
Old 03-19-2014 , 17:52   Re: Setting CBaseEntity Error
Reply With Quote #6

Quote:
Originally Posted by blodia View Post
PHP Code:
new enteffects GetEntProp(entindexProp_Send"m_fEffects");
enteffects |= 32;
SetEntProp(entindexProp_Send"m_fEffects"enteffects); 
you missed that, try adding that after spawning the entity, if you still crash then try moving before spawning it.
What does that do?
__________________
Dr. McSi is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 03-19-2014 , 18:20   Re: Setting CBaseEntity Error
Reply With Quote #7

It adds effect 32 onto the entity, making it invisible.

I could've sworn brush entities started out with effect 32...but I haven't checked in a long time.
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)

Last edited by MasterOfTheXP; 03-19-2014 at 18:21.
MasterOfTheXP is offline
Reply



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 22:50.


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