I cant get collisions to work properly with my created entity.
Code:
public makeapc(id)
{
new Float:origin[3]
pev(id, pev_origin, origin)
new apc = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
if(!apc)
{
client_print(id,print_chat,"Error: APC WAS not created.")
return PLUGIN_HANDLED
}
client_print(id, print_chat, "APC: %i", apc)
set_pev(apc, pev_classname, "item_apc")
dllfunc(DLLFunc_Spawn, apc)
new Float:angles[3] = {0.0, 0.0, 0.0}
new Float:fmins[3] = {-80.0, -80.0, -90.0}
new Float:fmaxs[3] = {80.0, 80.0, 0.0}
engfunc(EngFunc_SetModel, apc, "models/banes/APC03.mdl")
origin[2] += 90
engfunc(EngFunc_SetOrigin, apc, origin)
engfunc(EngFunc_SetSize, apc, mins, maxs)
set_pev(apc, pev_angles, angles)
set_pev(apc, pev_takedamage, 1.0)
set_pev(apc, pev_health, 500.0)
set_pev(apc, pev_movetype, MOVETYPE_PUSHSTEP)
set_pev(apc, pev_solid, 2)
set_pev(apc, pev_nextthink, get_gametime() + 0.01)
dllfunc(DLLFunc_Think, apc)
return PLUGIN_HANDLED
}
The bounding box doesen't seem to want to collide with all walls. It will collide with players, but when driving into walls, the maxs half of the box just go right through the walls.
Ignore the z axis box. It extends below since the center bone of the model is in the center-top of the model so that when attaching a camera you can view above it.
I am trying to make a driveable vehicle that will be able to hold multiple people, where you simply walk up to it, press your key, instead of the crappy cars built into cs.
I am doing this for the possibility of:
vehicles that take damage, mobile mounted weapons, and hopefully better physics then the default 1.6 ones.
any help with the collisions would be aprecieated.
Thanks.
__________________