Hello!
Trying to write a plugin that add's buyzones to the map if there are none.
Now I have 2 problems:
- I could not figure out a good way to get the team spawn coordinates to teleport the buyzone to. Right now I'm looping through all clients to get a t and ct client's position.
- It doesn't work. No errors, the buyzone just doesn't show up. With bots i got the following console message:
Code:
pos0: 632.000000, pos1: 267.000000, pos2: -295.000000(debug msg by plugin)
CT bot spawned outside of a buy zone (632, 267, -295)
As you can see, I already tried to move the 3. coordinate, because it seemed to be > than the bot spawn coordinate otherwise - no success.
My Code:
Spoiler
#include <sdktools>
public Plugin:myinfo =
{
name = "Add Buyzone",
author = "kumpu",
description = "Adds a buyzone if there is none",
version = "1.0",
url = ""
}
public OnPluginStart()
{
HookEvent("round_start", Event_RoundStart, EventHookMode_PostNoCopy);
}
public OnMapStart()
{
manageBuyZones();
}
public Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
manageBuyZones();
}
manageBuyZones()
{
decl String:szClass[65];
new bool:hasBuyZone = false;
for (new i = MaxClients; i <= GetMaxEntities(); i++)
{
if(IsValidEdict(i) && IsValidEntity(i))
{
GetEdictClassname(i, szClass, sizeof(szClass));
if(StrEqual("func_buyzone", szClass))
{
PrintToServer("has bz");
hasBuyZone = true;
break;
}
}
}
The only way is to use prop_dynamic's with wall models
But, may be there is another way: http://www.youtube.com/watch?v=mjGByP5hRNY 1.05
There is a transparent bridge which is made of brush and players can spray decals on it. Perhaps you can recreate this brush entity with the help of this tutorial and texture it with decals
When the bridge disables, decals sprayed on it disables too. So, even if it will work, you won't be able to make physics visible brush this way
I want to create a func_movelinear parent to func_rotating, like this video.
But the func_movelinear won't fire any outputs if it's parented to something.I wonder is there a way to fix this.