View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 12-08-2011 , 20:49   Re: Data is persistent over map changes, when I don't want it to be
Reply With Quote #4

Well, these don't really address the problem you posted, but they're things that will likely get mentioned by a SourceMod approver if you submit it as a new plugin:

1.
PHP Code:
    ServerCommand("mp_autoteambalance 0");
    
ServerCommand("mp_teams_unbalance_limit 0"); 
I'm not sure its a good idea to set cvars using ServerCommand. Use a handle variable, FindConVar (in OnPluginStart), and SetConVarBool instead.

2.
Hook either OnClientDisconnect or OnClientDisconnect_Post, not both. I recommend OnClientDisconnect_Post based on what you're doing.

3.
PHP Code:
#define TEAM_UNASSIGNED 0
#define TEAM_SPEC 1
#define TEAM_RED 2
#define TEAM_BLUE 3 
Use these from #include <tf2> instead:
PHP Code:
TFTeam_Unassigned
TFTeam_Spectator
TFTeam_Red
TFTeam_Blue 
// (yes, Blue... not Blu) 
You can compare them directly without casting, but you may need to cast them to a cell before using them with GetTeamClientCount (i.e. _:TFTeam_Red)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 12-08-2011 at 21:01.
Powerlord is offline