View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-28-2011 , 17:29   Re: [TF2] Auto DeSpectate
Reply With Quote #2

er... why do you need players to join a team on an idle server? They gain items regardless of whether they're on a team or not.

Having said that, a few notes about the code:

1. Retrieving the values of convars in OnPluginStart won't work, as plugins load before server.cfg is executed. They should be retrieved when you need them... or in OnConfigsExecuted if you really only want to check them once.


2.
Code:
#define TEAM_BLU 3
#define TEAM_RED 2
#define TEAM_SPEC 1
#define TEAM_NONE 0
Congratulations on reinventing the TFTeam enum from the tf2 include.

And before you say "but I can't use this to compare against values returned from GetClientTeam," yes you can... you just have to prefix it with _:, such as this:

PHP Code:
if (GetClientTeam(i) == _:TFTeam_Unassigned || GetClientTeam(i) == _:TFTeam_Spectator) { 
3. CheckTimer will always be INVALID_HANDLE in OnPluginStart, no need to check if it is.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 07-28-2011 at 17:40.
Powerlord is offline