Raised This Month: $ Target: $400
 0% 

Model Spawn - Crash


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 12-20-2005 , 22:15   Model Spawn - Crash
Reply With Quote #1

Ok, I try and spawn a model here for my car mod, and it crashes. The model doesn't show up or anything, and my server crashes. I did some troubleshooting to see the cause and it only crashes when I have
Code:
    new Float:maxs[3] = {64.0,64.0,36.0}     new Float:mins[3] = {-64.0,-64.0,-36.0}     entity_set_size(ent,mins,maxs)

Is there something wrong with that?
Thanks.

Here's the full code.

Code:
public makecarmdl(id) {         if(iscar[id] == 0) return PLUGIN_HANDLED         new Float:origin[3], authid[32]     entity_get_vector(id,EV_VEC_origin,origin)     new ent = create_entity("info_target")         entity_set_origin(ent,origin);     origin[1] += 50.0     entity_set_origin(id,origin)     entity_set_float(ent,EV_FL_takedamage,0.0)     //entity_set_float(ent,EV_FL_health,100.0)     new pcarid, query[256]     format(query,255,"SELECT CarID FROM users WHERE SteamID='%s'",authid)     result = dbi_query(dbc,query)     if( dbi_nextrow( result ) > 0 )         {         pcarid = dbi_field(result,1)         dbi_free_result(result)     }         new CarModel[32]     format(query,255,"SELECT CarModel FROM cars WHERE CarID='%i'",pcarid)     result = dbi_query(dbc,query)     if( dbi_nextrow( result ) > 0 )         {         dbi_field(result,1,CarModel,31)         dbi_free_result(result)     }         entity_set_string(ent,EV_SZ_classname,"car_parked");     entity_set_string(ent,EV_SZ_targetname,authid)     entity_set_model(ent,CarModel);     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);     new Float:maxs[3] = {64.0,64.0,36.0}     new Float:mins[3] = {-64.0,-64.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) }
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-20-2005 , 22:35  
Reply With Quote #2

Is the model precached before-hand?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 12-20-2005 , 22:35  
Reply With Quote #3

no
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-20-2005 , 22:36  
Reply With Quote #4

That's your problem.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 12-20-2005 , 22:49  
Reply With Quote #5

Quote:
Originally Posted by XxAvalanchexX
That's your problem.
Never mind, I figured out It wasn't getting an AUTHID because i forgot to add the get_user_authid. Now it crashes again. Any ideas?
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 12-21-2005 , 02:06  
Reply With Quote #6

Quote:
Originally Posted by XxAvalanchexX
Is the model precached before-hand?
You have to precache it even if all clients already have the model and the server HAS to have the model in his server dir
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-21-2005 , 02:23  
Reply With Quote #7

Yes.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 12-21-2005 , 11:45  
Reply With Quote #8

I prechached it, but it still crashes.....
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 12-21-2005 , 12:05  
Reply With Quote #9

Quote:
Originally Posted by mysticssjgoku4
I prechached it, but it still crashes.....
Show me how you precached it, this is the correct way ->

Code:
public plugin_precache() {     precache_model("models/yay.mdl")     precache_model("models/yay2.mdl")         return PLUGIN_CONTINUE }

Quote:
Originally Posted by XxAvalanchexX
Yes.
It wasn't a question, it was an answer
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 12-21-2005 , 14:04  
Reply With Quote #10

This is how I precached it.

Code:
precache_model("models/player/car_skyline/car_skyline.mdl")
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
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 15:51.


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