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)
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)
}