I have trouble creating a buyzone. Somehow it gets created (EntityIter shows it) and I can position it where I want. But it does not get triggered. I have seen some Sourcemod and AMX mod which utilize func_buyzone and they simply "spawn" and "activate" it along with the team number. No matter what I try, I cannot get it to work. I can successful spawn new terrorists or anti-terrorists spawn points with the following code. But that is only somewhat useful when nobody can buy things.
Func: https://developer.valvesoftware.com/wiki/Func_buyzone
BuyZone Simulator (CSGO): https://forums.alliedmods.net/showthread.php?p=1793176
BuyZone Range: https://forums.alliedmods.net/showthread.php?t=141245
Move N Create: https://www.amxmod.net/forum/showthread.php?tid=28
Syntax: Select all
tmpEntity = Entity.create('func_buyzone')
tmpEntity.spawn()
tmpEntity.origin = Vector(0, 0, 0)
tmpEntity.mins = Vector(2444, -2796, -1)
tmpEntity.maxs = Vector(3034, -2149, 257)
tmpEntity.team_index = 2
# does not seem to have any effect
tmpEntity.set_key_value_int('TeamNum', 2)
# does not seem to have any effect
tmpEntity.set_key_value_int('spawnflags', 4097)
# does not seem to have any effect
tmpEntity.set_key_value_bool('StartDisabled', False)
# does not seem to have any effect
tmpEntity.call_input('Enable')
Maybe the solution is easy but I am not able to figure it out. Even ChatGPT does not seem to give me a working solution, though it often has the correct indicators for me on how to solve stuff like that.
Kind Regards,
Kalle