diff options
| author | aura <nw@moneybot.cc> | 2026-04-25 22:46:52 +0200 |
|---|---|---|
| committer | aura <nw@moneybot.cc> | 2026-04-25 22:46:52 +0200 |
| commit | 216c729c8762f4d0388d8750905a91fe1de64ccf (patch) | |
| tree | 72f0f2f201f7156f220a46a1837c2768abdbb278 /source/sourcemod/scripting/include/gokz.inc | |
| parent | 6018b8161bdc2bc7eee15500fbd9658d8ad0fc3f (diff) | |
wip on removing gokz gamemode features
Diffstat (limited to 'source/sourcemod/scripting/include/gokz.inc')
| -rw-r--r-- | source/sourcemod/scripting/include/gokz.inc | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/source/sourcemod/scripting/include/gokz.inc b/source/sourcemod/scripting/include/gokz.inc index edbd896..6e41ed1 100644 --- a/source/sourcemod/scripting/include/gokz.inc +++ b/source/sourcemod/scripting/include/gokz.inc @@ -769,7 +769,49 @@ stock bool GetValidSpawn(float origin[3], float angles[3]) { // Return true if the spawn found is truly valid (not in the ground or out of bounds) bool foundValidSpawn; - bool searchCT; + bool searchCT = false; + float spawnOrigin[3]; + float spawnAngles[3]; + int spawnEntity = -1; + while (!foundValidSpawn) + { + if (searchCT) + { + spawnEntity = FindEntityByClassname(spawnEntity, "info_player_counterterrorist"); + } + else + { + spawnEntity = FindEntityByClassname(spawnEntity, "info_player_terrorist"); + } + + if (spawnEntity != -1) + { + GetEntPropVector(spawnEntity, Prop_Data, "m_vecOrigin", spawnOrigin); + GetEntPropVector(spawnEntity, Prop_Data, "m_angRotation", spawnAngles); + if (IsSpawnValid(spawnOrigin)) + { + origin = spawnOrigin; + angles = spawnAngles; + foundValidSpawn = true; + } + } + else if (!searchCT) + { + searchCT = true; + } + else + { + break; + } + } + return foundValidSpawn; +} + +stock bool GetValidSpawnCT(float origin[3], float angles[3]) +{ + // Return true if the spawn found is truly valid (not in the ground or out of bounds) + bool foundValidSpawn; + bool searchCT = true; float spawnOrigin[3]; float spawnAngles[3]; int spawnEntity = -1; |
