Moved nextmap command into basetriggers.sp

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402417
This commit is contained in:
Matt Woodrow 2008-07-13 07:01:54 +00:00
parent 64b8049d70
commit 67e28d7475
4 changed files with 57 additions and 86 deletions

View File

@ -71,6 +71,7 @@ public OnPluginStart()
RegConsoleCmd("say_team", Command_Say);
RegConsoleCmd("timeleft", Command_Timeleft);
RegConsoleCmd("nextmap", Command_Nextmap);
HookConVarChange(g_Cvar_TimeleftInterval, ConVarChange_TimeleftInterval);
@ -115,6 +116,24 @@ public Action:Command_Timeleft(client, args)
return Plugin_Handled;
}
public Action:Command_Nextmap(client, args)
{
decl String:map[64];
GetNextMap(map, sizeof(map));
if(GetConVarInt(g_Cvar_TriggerShow))
{
PrintToChatAll("[SM] %t", "Next Map", map);
}
else
{
ReplyToCommand(client, "[SM] %t", "Next Map", map);
}
return Plugin_Handled;
}
public Action:Command_Say(client, args)
{
decl String:text[192], String:command[64];
@ -188,7 +207,21 @@ public Action:Command_Say(client, args)
{
PrintToChat(client,"[SM] %t", "Current Map", map);
}
}
}
else if (strcmp(text[startidx], "nextmap", false) == 0)
{
decl String:map[32];
GetNextMap(map, sizeof(map));
if(GetConVarInt(g_Cvar_TriggerShow))
{
PrintToChatAll("[SM] %t", "Next Map", map);
}
else
{
PrintToChat(client, "[SM] %t", "Next Map", map);
}
}
return Plugin_Continue;
}

View File

@ -36,8 +36,6 @@
#include <sourcemod>
#include "include/nextmap.inc"
new Handle:g_Cvar_TriggerShow = INVALID_HANDLE;
public Plugin:myinfo =
{
name = "Nextmap",
@ -60,11 +58,6 @@ public OnPluginStart()
LoadTranslations("nextmap.phrases");
g_MapList = CreateArray(32);
RegConsoleCmd("say", Command_Say);
RegConsoleCmd("say_team", Command_Say);
RegConsoleCmd("nextmap", Command_Nextmap);
RegAdminCmd("sm_setnextmap", Command_SetNextmap, ADMFLAG_CHANGEMAP, "sm_setnextmap <map>");
RegAdminCmd("sm_maphistory", Command_MapHistory, ADMFLAG_CHANGEMAP, "Shows the most recent maps played");
@ -94,44 +87,6 @@ public OnConfigsExecuted()
{
FindAndSetNextMap();
}
g_Cvar_TriggerShow = FindConVar("sm_trigger_show");
}
public Action:Command_Say(client, args)
{
decl String:text[192];
if (GetCmdArgString(text, sizeof(text)) < 1)
{
return Plugin_Continue;
}
new startidx;
if (text[strlen(text)-1] == '"')
{
text[strlen(text)-1] = '\0';
startidx = 1;
}
decl String:message[8];
BreakString(text[startidx], message, sizeof(message));
if (strcmp(message, "nextmap", false) == 0)
{
decl String:map[32];
GetNextMap(map, sizeof(map));
if(g_Cvar_TriggerShow != INVALID_HANDLE && GetConVarInt(g_Cvar_TriggerShow))
{
PrintToChatAll("[SM] %t", "Next Map", map);
}
else
{
PrintToChat(client, "[SM] %t", "Next Map", map);
}
}
return Plugin_Continue;
}
public Action:Command_SetNextmap(client, args)
@ -173,25 +128,7 @@ public Action:Command_List(client, args)
return Plugin_Handled;
}
public Action:Command_Nextmap(client, args)
{
decl String:map[64];
GetNextMap(map, sizeof(map));
if(g_Cvar_TriggerShow != INVALID_HANDLE && GetConVarInt(g_Cvar_TriggerShow))
{
PrintToChatAll("[SM] %t", "Next Map", map);
}
else
{
ReplyToCommand(client, "[SM] %t", "Next Map", map);
}
return Plugin_Handled;
}
FindAndSetNextMap()
{
if (ReadMapList(g_MapList,

View File

@ -7,7 +7,7 @@
"Thetime"
{
"#format" "{1:s}"
"#format" "{1:s}"
"en" "The current server time is {1}"
}
@ -23,42 +23,42 @@
"Current Map"
{
"#format" "{1:s}"
"#format" "{1:s}"
"en" "The current map is {1}."
}
"WinLimitAppend"
{
"#format" "{1:i},{2:s}"
"#format" "{1:i},{2:s}"
"en" ", or change map after a team wins {1} round{2}"
}
"WinLimit"
{
"#format" "{1:i},{2:s}"
"#format" "{1:i},{2:s}"
"en" "Map will change after a team wins {1} round{2}"
}
"MaxRoundsAppend"
{
"#format" "{1:i},{2:s}"
"#format" "{1:i},{2:s}"
"en" ", or change map after {1} round{2}"
}
"MaxRounds"
{
"#format" "{1:i},{2:s}"
"#format" "{1:i},{2:s}"
"en" "Map will change after {1} round{2}"
}
"FragLimitAppend"
{
"#format" "{1:i},{2:s}"
"#format" "{1:i},{2:s}"
"en" ", or change map after player reaches {1} frag{2}"
}
"FragLimit"
{
"#format" "{1:i},{2:s}"
"#format" "{1:i},{2:s}"
"en" "Map will change after a player reaches {1} frag{2}"
}
@ -71,4 +71,10 @@
{
"en" "No timelimit for map"
}
"Next Map"
{
"#format" "{1:s}"
"en" "Next Map: {1}"
}
}

View File

@ -1,13 +1,8 @@
"Phrases"
{
"Next Map"
{
"#format" "{1:s}"
"en" "Next Map: {1}"
}
"Changed Next Map"
{
"#format" "{1:s}"
"en" "Changed nextmap to \"{1}\"."
}
}
"Phrases"
{
"Changed Next Map"
{
"#format" "{1:s}"
"en" "Changed nextmap to \"{1}\"."
}
}