AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   detect team size change (https://forums.alliedmods.net/showthread.php?t=2573)

[FBX] 06-09-2004 06:48

detect team size change
 
I'm working on a plugin that adds spawn points to a map if you need them (so far I can add spawn points like I want them). However the team size limit on both sides still seems to remain the same even when more spawn points are added, and my assumption is that CS counts the number of spawn points at map load and saves it as a variable.

Since the whole idea of the plugin is to be able to add spawn points AFTER map load, I've only so far come up with one idea (that I haven't had time to try) which is to detect when someone wants to join a team, and keep track of the number of players on both teams, and then if he wont uneven the teams too much, to switch him.

This could really affect things like PTB though or probably wont be as easy to code as it sounds (adding the spawn points sure wasnt...) Likewise, I'm not even sure if I could test it using bots, since they dont really use menus....

Anyways, any input on easy ways to do this would be helpful, or any tricks people know to make CS recount the team sizes without reloading the map will also help.

BAILOPAN 06-09-2004 07:02

Why not just restrict the limits yourself and tell people not to use PTB? If you're doing your own restriction then PTB would be unnecessary.

How are you adding spawns to world? From my experience with CSDM, Steam no longer allows you to create the CT/T spawn points. This may have change since I last tested in February, but creating them resulted in the player spawning at 0,0,0 and an instant crash.

CS is caching the spawns internally, along with all other entities it uses (to bypass FIND_ENTITY_BY_STRING or whatever), so no matter what you do it won't affect that internal cache.

[FBX] 06-10-2004 23:57

does sv_restart recalculate the team sizes while still maintaining the entities I created?

[FBX] 06-11-2004 04:12

nope. So far I can get pod bot to join the teams beyond their original capacity, but it doesnt apply for humans. None of the restart rounds seem to do any recalculations, and when the bots do join past the original capacity, the game still uses the original spawn points that were created in the map (and I'm fairly certain my spawn points are getting created correctly because they aren't located at 0,0,0 when I count the number of spawns on the map)

sooo I'm just gonna scrap this project unless something comes up, such as a way to edit a non-cvar server variable thats built into cstrike.

Johnny got his gun 06-11-2004 05:05

Well, sad to say, by doing this cache thingy with steam cs back in February (or was that January?) they totally screwed up making cool plugins like these work.

And to think of, I wonder really why they did this. The so called "performance gain" is probably not there, by going around find_ent_by_string (or whatever they do), or at least it's not likely that it is so big that it has any serious affect on game play.

If you ask me, a total screw up by the CS team. :evil:

Don't know if there's any way around this, like finding a way to make steam cs "catch up" with the current entity set. That would be cool, I doubt we'll ever see it :idea: but keep your fingers crossed. :roll:

Objectives converter, RIP.


All times are GMT -4. The time now is 14:38.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.