What Do? The sentry busters will path to spawned sentry, and will detonate, but won't destroy it. Robots will shoot them and kill them though. Here's my spawning code:
PHP Code:
new sentry = CreateEntityByName("obj_sentrygun");
if (sentry != -1)
{
decl Float:normal[3], Float:normalAng[3];
TR_GetPlaneNormal(TraceRay, normal);
GetClientEyeAngles(target, Angles);
GetVectorAngles(normal, normalAng);
if(normalAng[0] > 0.0 && normalAng[0] <= 90.0)
{
CloseHandle(TraceRay);
return;
}
EndOrigin[0] += normal[0]*2.0;
EndOrigin[1] += normal[1]*2.0;
EndOrigin[2] += normal[2]*2.0;
Angles[0] = normalAng[0] -270;
if (normalAng[0] != 270)
{
Angles[1] = normalAng[1];
}
DispatchKeyValueVector(sentry, "origin", EndOrigin);
DispatchKeyValueVector(sentry, "angles", Angles);
DispatchSpawn(sentry);
SetEntityModel(sentry, MODEL_SENTRYGUN);
SetEntPropFloat(sentry, Prop_Send, "m_flModelScale", 0.5);
ActivateEntity(sentry);
SetEntProp(sentry, Prop_Send, "m_iAmmoShells", 200);
SetEntProp(sentry, Prop_Send, "m_iMaxHealth", 100);
SetEntProp(sentry, Prop_Send, "m_iHealth", 100);
SetEntProp(sentry, Prop_Send, "m_iObjectType", _:TFObject_Sentry);
SetEntProp(sentry, Prop_Send, "m_iState", 1);
SetEntProp(sentry, Prop_Send, "m_iTeamNum", 2);
SetEntProp(sentry, Prop_Send, "m_nSkin", 0);
SetEntProp(sentry, Prop_Send, "m_iUpgradeLevel", 1);
SetEntProp(sentry, Prop_Send, "m_iAmmoRockets", 0);
//SetEntProp(sentry, Prop_Send, "m_bMiniBuilding", 1);
SetEntPropFloat(sentry, Prop_Send, "m_flPercentageConstructed", 1.0);
SetEntProp(sentry, Prop_Send, "m_bDisabled", 1);
SetEntProp(sentry, Prop_Send, "m_CollisionGroup", 2);
}
Probly don't need the angle checks, since the sentries will always spawn downward, though every now and again one will be tilted enough that it may orient sideways enough to not fire (dunno). I spawn them disabled so that nobody will get stuck in them, then make them solid later with a tracehull.
There's probably some netprop that needs to be set somewhere to make the sentries die to them. Also, It would be nice to make it so they can't be wrangled (like the mini sentry). I mean, they can be wrangled, but they won't fire, they just disabled and show the laser sight.
__________________