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:
public OnEntityCreated(iEntity, const String:EntName)
if (StrEqual(EntName, "tank_boss", false))
Format(Buffer, sizeof(Buffer), "Client%d", iEntity);
int gun = CreateEntityByName("obj_sentrygun");
DispatchKeyValue(gun, "spawnflags", "2");
DispatchKeyValue(gun, "teamnum", "3");
DispatchKeyValue(gun, "defaultupgrade", "1");
DispatchKeyValue(iEntity, "targetname", Buffer);
Anyone know any fixes?