So I was trying to create sentry tanks (Couldn't find a plugin for it but I've seen it used on servers before) and when I tried to create the sentry, it was in the placing state instead of being built already, and I need to know how to place the sentry above the tank.
Here's my code:
PHP Code:
public OnEntityCreated(iEntity, const String:EntName[])
{
if (StrEqual(EntName, "tank_boss", false))
{
decl String:Buffer[12];
Format(Buffer, sizeof(Buffer), "Client%d", iEntity);
int gun = CreateEntityByName("obj_sentrygun");
DispatchKeyValue(gun, "spawnflags", "2");
DispatchKeyValue(gun, "teamnum", "3");
DispatchKeyValue(gun, "defaultupgrade", "1");
DispatchSpawn(gun);
DispatchKeyValue(iEntity, "targetname", Buffer);
SetVariantString(Buffer);
AcceptEntityInput(gun, "SetParent");
}
}
Anyone know any fixes?
Thanks! -Theon