Skip to content
Browse files

Minor improvements.

  • Loading branch information...
1 parent f67e393 commit b9caf1f5f39a1fb6124c92b73743b104b03625d2 @qpingu qpingu committed Apr 22, 2011
View
BIN addons/sourcemod/plugins/extend.tf2pug.smx
Binary file not shown.
View
11 addons/sourcemod/scripting/extend.tf2pug.sp
@@ -1,6 +1,9 @@
#include <sourcemod>
#include <sdktools>
+#define TF_TEAM_BLU 3
+#define TF_TEAM_RED 2
+
// Convars
new Handle:hExtendThreshold;
new Handle:hCancelThreshold;
@@ -34,15 +37,15 @@ public OnPluginStart() {
RegConsoleCmd("sm_extend", Command_Extend);
RegConsoleCmd("sm_cancel", Command_Cancel);
- CreateTimer(20.0, CheckTime, _, TIMER_REPEAT);
+ CreateTimer(20.0, Timer_CheckRemaining, _, TIMER_REPEAT);
}
public OnMapStart() {
extendCount = 0;
extendCancel = false;
}
-public Action:CheckTime(Handle:timer) {
+public Action:Timer_CheckRemaining(Handle:timer) {
new timeLeft; GetMapTimeLeft(timeLeft);
new timeLimit; GetMapTimeLimit(timeLimit);
new extendThreshold = GetConVarInt(hExtendThreshold);
@@ -64,7 +67,7 @@ public Action:Command_Extend(client, args) {
new client_team = GetClientTeam(client);
new String:client_name[32]; GetClientName(client, client_name, sizeof(client_name));
- if (client_team == 2 || client_team == 3) {
+ if (client_team == TF_TEAM_BLU || client_team == TF_TEAM_RED) {
new extendThreshold = GetConVarInt(hExtendThreshold);
new timeLeft; GetMapTimeLeft(timeLeft);
new timeLimit; GetMapTimeLimit(timeLimit);
@@ -85,7 +88,7 @@ public Action:Command_Cancel(client, args) {
new client_team = GetClientTeam(client);
new String:client_name[32]; GetClientName(client, client_name, sizeof(client_name));
- if (client_team == 2 || client_team == 3) {
+ if (client_team == TF_TEAM_BLU || client_team == TF_TEAM_RED) {
new cancelThreshold = GetConVarInt(hCancelThreshold);
if (extendCancel) {

0 comments on commit b9caf1f

Please sign in to comment.
Something went wrong with that request. Please try again.