2011-08-27 15:11:39 +00:00
|
|
|
/* (c) Shereef Marzouk. See "licence DDRace.txt" and the readme.txt in the root of the distribution for more information. */
|
|
|
|
#include "gamecontext.h"
|
|
|
|
#include <engine/shared/config.h>
|
|
|
|
#include <engine/server/server.h>
|
|
|
|
#include <game/server/teams.h>
|
|
|
|
#include <game/server/gamemodes/DDRace.h>
|
|
|
|
#include <game/version.h>
|
|
|
|
#include <game/generated/nethash.cpp>
|
|
|
|
#if defined(CONF_SQL)
|
2011-12-25 13:51:04 +00:00
|
|
|
#include <game/server/score/sql_score.h>
|
2011-08-27 15:11:39 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
bool CheckClientID(int ClientID);
|
2012-02-14 20:38:06 +00:00
|
|
|
char* TimerType(int TimerType);
|
2011-08-27 15:11:39 +00:00
|
|
|
|
|
|
|
void CGameContext::ConCredits(IConsole::IResult *pResult, void *pUserData)
|
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
CGameContext *pSelf = (CGameContext *) pUserData;
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
|
|
|
|
"Teeworlds Team takes most of the credits also");
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
|
|
|
|
"This mod was originally created by \'3DA\'");
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
|
|
|
|
"Now it is maintained & re-coded by:");
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
|
|
|
|
"\'[Egypt]GreYFoX@GTi\' and \'[BlackTee]den\'");
|
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"credit",
|
|
|
|
"Others Helping on the code: \'heinrich5991\', \'ravomavain\', \'Trust o_0 Aeeeh ?!\', \'noother\', \'<3 fisted <3\' & \'LemonFace\'");
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
|
|
|
|
"Documentation: Zeta-Hoernchen & Learath2, Entities: Fisico");
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
|
|
|
|
"Code (in the past): \'3DA\' and \'Fluxid\'");
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
|
|
|
|
"Please check the changelog on DDRace.info.");
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "credit",
|
|
|
|
"Also the commit log on github.com/GreYFoX/teeworlds .");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CGameContext::ConInfo(IConsole::IResult *pResult, void *pUserData)
|
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
CGameContext *pSelf = (CGameContext *) pUserData;
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info",
|
|
|
|
"DDRace Mod. Version: " GAME_VERSION);
|
2011-08-27 15:11:39 +00:00
|
|
|
#if defined( GIT_SHORTREV_HASH )
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info",
|
|
|
|
"Git revision hash: " GIT_SHORTREV_HASH);
|
2011-08-27 15:11:39 +00:00
|
|
|
#endif
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info",
|
|
|
|
"Official site: DDRace.info");
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info",
|
|
|
|
"For more Info /cmdlist");
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info",
|
|
|
|
"Or visit DDRace.info");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CGameContext::ConHelp(IConsole::IResult *pResult, void *pUserData)
|
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
CGameContext *pSelf = (CGameContext *) pUserData;
|
2011-08-27 15:11:39 +00:00
|
|
|
|
2011-12-25 13:51:04 +00:00
|
|
|
if (pResult->NumArguments() == 0)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "help",
|
|
|
|
"/cmdlist will show a list of all chat commands");
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "help",
|
|
|
|
"/help + any command will show you the help for this command");
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "help",
|
|
|
|
"Example /help settings will display the help about ");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const char *pArg = pResult->GetString(0);
|
2011-12-25 13:51:04 +00:00
|
|
|
const IConsole::CCommandInfo *pCmdInfo =
|
|
|
|
pSelf->Console()->GetCommandInfo(pArg, CFGFLAG_SERVER, false);
|
|
|
|
if (pCmdInfo && pCmdInfo->m_pHelp)
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "help",
|
|
|
|
pCmdInfo->m_pHelp);
|
2011-08-27 15:11:39 +00:00
|
|
|
else
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"help",
|
|
|
|
"Command is either unknown or you have given a blank command without any parameters.");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CGameContext::ConSettings(IConsole::IResult *pResult, void *pUserData)
|
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
CGameContext *pSelf = (CGameContext *) pUserData;
|
2011-08-27 15:11:39 +00:00
|
|
|
|
2011-12-25 13:51:04 +00:00
|
|
|
if (pResult->NumArguments() == 0)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"setting",
|
|
|
|
"to check a server setting say /settings and setting's name, setting names are:");
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "setting",
|
|
|
|
"teams, cheats, collision, hooking, endlesshooking, me, ");
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "setting",
|
|
|
|
"hitting, oldlaser, timeout, votes, pause and scores");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const char *pArg = pResult->GetString(0);
|
|
|
|
char aBuf[256];
|
|
|
|
float ColTemp;
|
|
|
|
float HookTemp;
|
|
|
|
pSelf->m_Tuning.Get("player_collision", &ColTemp);
|
|
|
|
pSelf->m_Tuning.Get("player_hooking", &HookTemp);
|
2011-12-25 13:51:04 +00:00
|
|
|
if (str_comp(pArg, "teams") == 0)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
str_format(
|
|
|
|
aBuf,
|
|
|
|
sizeof(aBuf),
|
|
|
|
"%s %s",
|
|
|
|
g_Config.m_SvTeam == 1 ?
|
|
|
|
"Teams are available on this server" :
|
|
|
|
!g_Config.m_SvTeam ?
|
|
|
|
"Teams are not available on this server" :
|
|
|
|
"You have to be in a team to play on this server", /*g_Config.m_SvTeamStrict ? "and if you die in a team all of you die" : */
|
|
|
|
"and if you die in a team only you die");
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "settings",
|
|
|
|
aBuf);
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
else if (str_comp(pArg, "collision") == 0)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"settings",
|
|
|
|
ColTemp ?
|
|
|
|
"Players can collide on this server" :
|
|
|
|
"Players Can't collide on this server");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
else if (str_comp(pArg, "hooking") == 0)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"settings",
|
|
|
|
HookTemp ?
|
|
|
|
"Players can hook each other on this server" :
|
|
|
|
"Players Can't hook each other on this server");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
else if (str_comp(pArg, "endlesshooking") == 0)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"settings",
|
|
|
|
g_Config.m_SvEndlessDrag ?
|
|
|
|
"Players can hook time is unlimited" :
|
|
|
|
"Players can hook time is limited");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
else if (str_comp(pArg, "hitting") == 0)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"settings",
|
|
|
|
g_Config.m_SvHit ?
|
|
|
|
"Player's weapons affect each other" :
|
|
|
|
"Player's weapons has no affect on each other");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
else if (str_comp(pArg, "oldlaser") == 0)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"settings",
|
|
|
|
g_Config.m_SvOldLaser ?
|
|
|
|
"Lasers can hit you if you shot them and that they pull you towards the bounce origin (Like DDRace Beta)" :
|
|
|
|
"Lasers can't hit you if you shot them, and they pull others towards the shooter");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
else if (str_comp(pArg, "me") == 0)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"settings",
|
|
|
|
g_Config.m_SvSlashMe ?
|
|
|
|
"Players can use /me commands the famous IRC Command" :
|
|
|
|
"Players Can't use the /me command");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
else if (str_comp(pArg, "timeout") == 0)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
str_format(aBuf, sizeof(aBuf),
|
|
|
|
"The Server Timeout is currently set to %d",
|
|
|
|
g_Config.m_ConnTimeout);
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "settings",
|
|
|
|
aBuf);
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
else if (str_comp(pArg, "votes") == 0)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"settings",
|
|
|
|
g_Config.m_SvVoteKick ?
|
|
|
|
"Players can use Callvote menu tab to kick offenders" :
|
|
|
|
"Players Can't use the Callvote menu tab to kick offenders");
|
|
|
|
if (g_Config.m_SvVoteKick)
|
|
|
|
str_format(
|
|
|
|
aBuf,
|
|
|
|
sizeof(aBuf),
|
|
|
|
"Players are banned for %d second(s) if they get voted off",
|
|
|
|
g_Config.m_SvVoteKickBantime);
|
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"settings",
|
|
|
|
g_Config.m_SvVoteKickBantime ?
|
|
|
|
aBuf :
|
|
|
|
"Players are just kicked and not banned if they get voted off");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
else if (str_comp(pArg, "pause") == 0)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"settings",
|
|
|
|
g_Config.m_SvPauseable ?
|
|
|
|
g_Config.m_SvPauseTime ?
|
|
|
|
"/pause is available on this server and it pauses your time too" :
|
|
|
|
"/pause is available on this server but it doesn't pause your time"
|
|
|
|
:"/pause is NOT available on this server");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
else if (str_comp(pArg, "scores") == 0)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"settings",
|
|
|
|
g_Config.m_SvHideScore ?
|
|
|
|
"Scores are private on this server" :
|
|
|
|
"Scores are public on this server");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CGameContext::ConRules(IConsole::IResult *pResult, void *pUserData)
|
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
CGameContext *pSelf = (CGameContext *) pUserData;
|
2011-08-27 15:11:39 +00:00
|
|
|
bool Printed = false;
|
2011-12-25 13:51:04 +00:00
|
|
|
if (g_Config.m_SvDDRaceRules)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "rules",
|
|
|
|
"No blocking.");
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "rules",
|
|
|
|
"No insulting / spamming.");
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "rules",
|
|
|
|
"No fun voting / vote spamming.");
|
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"rules",
|
|
|
|
"Breaking any of these rules will result in a penalty, decided by server admins.");
|
2011-08-27 15:11:39 +00:00
|
|
|
Printed = true;
|
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
if (g_Config.m_SvRulesLine1[0])
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "rules",
|
|
|
|
g_Config.m_SvRulesLine1);
|
2011-08-27 15:11:39 +00:00
|
|
|
Printed = true;
|
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
if (g_Config.m_SvRulesLine2[0])
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "rules",
|
|
|
|
g_Config.m_SvRulesLine2);
|
2011-08-27 15:11:39 +00:00
|
|
|
Printed = true;
|
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
if (g_Config.m_SvRulesLine3[0])
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "rules",
|
|
|
|
g_Config.m_SvRulesLine3);
|
2011-08-27 15:11:39 +00:00
|
|
|
Printed = true;
|
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
if (g_Config.m_SvRulesLine4[0])
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "rules",
|
|
|
|
g_Config.m_SvRulesLine4);
|
2011-08-27 15:11:39 +00:00
|
|
|
Printed = true;
|
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
if (g_Config.m_SvRulesLine5[0])
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "rules",
|
|
|
|
g_Config.m_SvRulesLine5);
|
2011-08-27 15:11:39 +00:00
|
|
|
Printed = true;
|
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
if (g_Config.m_SvRulesLine6[0])
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "rules",
|
|
|
|
g_Config.m_SvRulesLine6);
|
2011-08-27 15:11:39 +00:00
|
|
|
Printed = true;
|
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
if (g_Config.m_SvRulesLine7[0])
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "rules",
|
|
|
|
g_Config.m_SvRulesLine7);
|
2011-08-27 15:11:39 +00:00
|
|
|
Printed = true;
|
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
if (g_Config.m_SvRulesLine8[0])
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "rules",
|
|
|
|
g_Config.m_SvRulesLine8);
|
|
|
|
Printed = true;
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
if (g_Config.m_SvRulesLine9[0])
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "rules",
|
|
|
|
g_Config.m_SvRulesLine9);
|
|
|
|
Printed = true;
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
if (g_Config.m_SvRulesLine10[0])
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "rules",
|
|
|
|
g_Config.m_SvRulesLine10);
|
2011-08-27 15:11:39 +00:00
|
|
|
Printed = true;
|
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
if (!Printed)
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "rules",
|
|
|
|
"No Rules Defined, Kill em all!!");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CGameContext::ConTogglePause(IConsole::IResult *pResult, void *pUserData)
|
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
CGameContext *pSelf = (CGameContext *) pUserData;
|
|
|
|
if (!CheckClientID(pResult->m_ClientID))
|
|
|
|
return;
|
2011-08-27 15:11:39 +00:00
|
|
|
char aBuf[128];
|
|
|
|
|
2011-12-29 13:58:39 +00:00
|
|
|
if(!g_Config.m_SvPauseable)
|
|
|
|
{
|
|
|
|
ConToggleSpec(pResult, pUserData);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-08-27 15:11:39 +00:00
|
|
|
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
|
2011-12-25 13:51:04 +00:00
|
|
|
if (!pPlayer)
|
2011-08-27 15:11:39 +00:00
|
|
|
return;
|
|
|
|
|
2012-03-08 16:24:23 +00:00
|
|
|
if (pPlayer->GetCharacter() == 0)
|
|
|
|
{
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "pause",
|
|
|
|
"You can't pause while you are dead/a spectator.");
|
2012-03-31 18:27:15 +00:00
|
|
|
return;
|
2012-03-08 16:24:23 +00:00
|
|
|
}
|
2012-03-07 17:51:30 +00:00
|
|
|
if (pPlayer->m_Paused == CPlayer::PAUSED_SPEC && g_Config.m_SvPauseable)
|
|
|
|
{
|
|
|
|
ConToggleSpec(pResult, pUserData);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-12-29 13:58:39 +00:00
|
|
|
if (pPlayer->m_Paused == CPlayer::PAUSED_FORCE)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-29 13:58:39 +00:00
|
|
|
str_format(aBuf, sizeof(aBuf), "You are force-paused. %ds left.", pPlayer->m_ForcePauseTime/pSelf->Server()->TickSpeed());
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "pause", aBuf);
|
|
|
|
return;
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
2011-12-29 13:58:39 +00:00
|
|
|
|
|
|
|
pPlayer->m_Paused = (pPlayer->m_Paused == CPlayer::PAUSED_PAUSED) ? CPlayer::PAUSED_NONE : CPlayer::PAUSED_PAUSED;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CGameContext::ConToggleSpec(IConsole::IResult *pResult, void *pUserData)
|
|
|
|
{
|
|
|
|
CGameContext *pSelf = (CGameContext *)pUserData;
|
|
|
|
if(!CheckClientID(pResult->m_ClientID)) return;
|
|
|
|
char aBuf[128];
|
|
|
|
|
|
|
|
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
|
|
|
|
if(!pPlayer)
|
|
|
|
return;
|
|
|
|
|
2012-03-08 16:24:23 +00:00
|
|
|
if (pPlayer->GetCharacter() == 0)
|
|
|
|
{
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "spec",
|
|
|
|
"You can't spec while you are dead/a spectator.");
|
2012-03-31 18:27:15 +00:00
|
|
|
return;
|
2012-03-08 16:24:23 +00:00
|
|
|
}
|
|
|
|
|
2011-12-29 13:58:39 +00:00
|
|
|
if(pPlayer->m_Paused == CPlayer::PAUSED_FORCE)
|
|
|
|
{
|
|
|
|
str_format(aBuf, sizeof(aBuf), "You are force-paused. %ds left.", pPlayer->m_ForcePauseTime/pSelf->Server()->TickSpeed());
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "spec", aBuf);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
pPlayer->m_Paused = (pPlayer->m_Paused == CPlayer::PAUSED_SPEC) ? CPlayer::PAUSED_NONE : CPlayer::PAUSED_SPEC;
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CGameContext::ConTop5(IConsole::IResult *pResult, void *pUserData)
|
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
CGameContext *pSelf = (CGameContext *) pUserData;
|
|
|
|
if (!CheckClientID(pResult->m_ClientID))
|
|
|
|
return;
|
2011-08-27 15:11:39 +00:00
|
|
|
|
2011-09-07 22:51:55 +00:00
|
|
|
#if defined(CONF_SQL)
|
2011-12-25 13:51:04 +00:00
|
|
|
if(pSelf->m_apPlayers[pResult->m_ClientID] && g_Config.m_SvUseSQL)
|
|
|
|
if(pSelf->m_apPlayers[pResult->m_ClientID]->m_LastSQLQuery + pSelf->Server()->TickSpeed() >= pSelf->Server()->Tick())
|
|
|
|
return;
|
2011-09-07 22:51:55 +00:00
|
|
|
#endif
|
|
|
|
|
2011-12-25 13:51:04 +00:00
|
|
|
if (g_Config.m_SvHideScore)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "top5",
|
|
|
|
"Showing the top 5 is not allowed on this server.");
|
2011-08-27 15:11:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-03-23 21:32:20 +00:00
|
|
|
if (pResult->NumArguments() > 0 && pResult->GetInteger(0) >= 0)
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Score()->ShowTop5(pResult, pResult->m_ClientID, pUserData,
|
|
|
|
pResult->GetInteger(0));
|
|
|
|
else
|
|
|
|
pSelf->Score()->ShowTop5(pResult, pResult->m_ClientID, pUserData);
|
2011-09-07 22:51:55 +00:00
|
|
|
|
|
|
|
#if defined(CONF_SQL)
|
2011-12-25 13:51:04 +00:00
|
|
|
if(pSelf->m_apPlayers[pResult->m_ClientID] && g_Config.m_SvUseSQL)
|
|
|
|
pSelf->m_apPlayers[pResult->m_ClientID]->m_LastSQLQuery = pSelf->Server()->Tick();
|
2011-09-07 22:51:55 +00:00
|
|
|
#endif
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
2011-08-31 10:30:18 +00:00
|
|
|
|
2011-08-27 15:11:39 +00:00
|
|
|
#if defined(CONF_SQL)
|
|
|
|
void CGameContext::ConTimes(IConsole::IResult *pResult, void *pUserData)
|
|
|
|
{
|
|
|
|
if(!CheckClientID(pResult->m_ClientID)) return;
|
2011-08-31 22:30:37 +00:00
|
|
|
CGameContext *pSelf = (CGameContext *)pUserData;
|
2011-08-27 15:11:39 +00:00
|
|
|
|
2011-09-07 22:51:55 +00:00
|
|
|
#if defined(CONF_SQL)
|
2011-12-25 13:51:04 +00:00
|
|
|
if(pSelf->m_apPlayers[pResult->m_ClientID] && g_Config.m_SvUseSQL)
|
|
|
|
if(pSelf->m_apPlayers[pResult->m_ClientID]->m_LastSQLQuery + pSelf->Server()->TickSpeed() >= pSelf->Server()->Tick())
|
|
|
|
return;
|
2011-09-07 22:51:55 +00:00
|
|
|
#endif
|
|
|
|
|
2011-08-27 15:11:39 +00:00
|
|
|
if(g_Config.m_SvUseSQL)
|
|
|
|
{
|
|
|
|
CSqlScore *pScore = (CSqlScore *)pSelf->Score();
|
|
|
|
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
|
|
|
|
if(!pPlayer)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if(pResult->NumArguments() == 0)
|
|
|
|
{
|
|
|
|
pScore->ShowTimes(pPlayer->GetCID(),1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
else if(pResult->NumArguments() < 3)
|
|
|
|
{
|
|
|
|
if (pResult->NumArguments() == 1)
|
|
|
|
{
|
|
|
|
if(pResult->GetInteger(0) != 0)
|
|
|
|
pScore->ShowTimes(pPlayer->GetCID(),pResult->GetInteger(0));
|
|
|
|
else
|
|
|
|
pScore->ShowTimes(pPlayer->GetCID(), (str_comp(pResult->GetString(0), "me") == 0) ? pSelf->Server()->ClientName(pResult->m_ClientID) : pResult->GetString(0),1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else if (pResult->GetInteger(1) != 0)
|
|
|
|
{
|
|
|
|
pScore->ShowTimes(pPlayer->GetCID(), (str_comp(pResult->GetString(0), "me") == 0) ? pSelf->Server()->ClientName(pResult->m_ClientID) : pResult->GetString(0),pResult->GetInteger(1));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
|
2011-09-02 08:45:26 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "times", "/times needs 0, 1 or 2 parameter. 1. = name, 2. = start number");
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "times", "Example: /times, /times me, /times Hans, /times \"Papa Smurf\" 5");
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "times", "Bad: /times Papa Smurf 5 # Good: /times \"Papa Smurf\" 5 ");
|
2011-09-07 22:51:55 +00:00
|
|
|
|
|
|
|
#if defined(CONF_SQL)
|
|
|
|
if(pSelf->m_apPlayers[pResult->m_ClientID] && g_Config.m_SvUseSQL)
|
|
|
|
pSelf->m_apPlayers[pResult->m_ClientID]->m_LastSQLQuery = pSelf->Server()->Tick();
|
|
|
|
#endif
|
2011-12-25 13:51:04 +00:00
|
|
|
}
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void CGameContext::ConRank(IConsole::IResult *pResult, void *pUserData)
|
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
CGameContext *pSelf = (CGameContext *) pUserData;
|
|
|
|
if (!CheckClientID(pResult->m_ClientID))
|
|
|
|
return;
|
2011-08-27 15:11:39 +00:00
|
|
|
|
2011-09-07 22:51:55 +00:00
|
|
|
#if defined(CONF_SQL)
|
2011-12-25 13:51:04 +00:00
|
|
|
if(pSelf->m_apPlayers[pResult->m_ClientID] && g_Config.m_SvUseSQL)
|
|
|
|
if(pSelf->m_apPlayers[pResult->m_ClientID]->m_LastSQLQuery + pSelf->Server()->TickSpeed() >= pSelf->Server()->Tick())
|
|
|
|
return;
|
2011-09-07 22:51:55 +00:00
|
|
|
#endif
|
|
|
|
|
2011-08-27 15:11:39 +00:00
|
|
|
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
|
2011-12-25 13:51:04 +00:00
|
|
|
if (!pPlayer)
|
2011-08-27 15:11:39 +00:00
|
|
|
return;
|
|
|
|
|
2011-12-25 13:51:04 +00:00
|
|
|
if (pResult->NumArguments() > 0)
|
|
|
|
if (!g_Config.m_SvHideScore)
|
|
|
|
pSelf->Score()->ShowRank(pResult->m_ClientID, pResult->GetString(0),
|
|
|
|
true);
|
2011-08-27 15:11:39 +00:00
|
|
|
else
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"rank",
|
|
|
|
"Showing the rank of other players is not allowed on this server.");
|
2011-08-27 15:11:39 +00:00
|
|
|
else
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Score()->ShowRank(pResult->m_ClientID,
|
|
|
|
pSelf->Server()->ClientName(pResult->m_ClientID));
|
2011-09-07 22:51:55 +00:00
|
|
|
|
|
|
|
#if defined(CONF_SQL)
|
2011-12-25 13:51:04 +00:00
|
|
|
if(pSelf->m_apPlayers[pResult->m_ClientID] && g_Config.m_SvUseSQL)
|
|
|
|
pSelf->m_apPlayers[pResult->m_ClientID]->m_LastSQLQuery = pSelf->Server()->Tick();
|
2011-09-07 22:51:55 +00:00
|
|
|
#endif
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CGameContext::ConJoinTeam(IConsole::IResult *pResult, void *pUserData)
|
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
CGameContext *pSelf = (CGameContext *) pUserData;
|
|
|
|
if (!CheckClientID(pResult->m_ClientID))
|
|
|
|
return;
|
2011-08-27 15:11:39 +00:00
|
|
|
|
2012-04-11 13:36:11 +00:00
|
|
|
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
|
|
|
|
|
2011-12-25 13:51:04 +00:00
|
|
|
if (pSelf->m_VoteCloseTime && pSelf->m_VoteCreator == pResult->m_ClientID)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"join",
|
|
|
|
"You are running a vote please try again after the vote is done!");
|
2011-08-27 15:11:39 +00:00
|
|
|
return;
|
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
else if (g_Config.m_SvTeam == 0)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "join",
|
|
|
|
"Admin has disabled teams");
|
2011-08-27 15:11:39 +00:00
|
|
|
return;
|
|
|
|
}
|
2012-04-11 13:36:11 +00:00
|
|
|
else if (g_Config.m_SvTeam == 2 && pResult->GetInteger(0) == 0 && pPlayer->GetCharacter()->m_LastStartWarning < pSelf->Server()->Tick() - 3 * pSelf->Server()->TickSpeed())
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"join",
|
2012-04-11 13:36:11 +00:00
|
|
|
"You must join a team and play with somebody or else you can\'t play");
|
|
|
|
pPlayer->GetCharacter()->m_LastStartWarning = pSelf->Server()->Tick();
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
|
2011-12-25 13:51:04 +00:00
|
|
|
if (pResult->NumArguments() > 0)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
if (pPlayer->GetCharacter() == 0)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "join",
|
|
|
|
"You can't change teams while you are dead/a spectator.");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
if (pPlayer->m_Last_Team
|
|
|
|
+ pSelf->Server()->TickSpeed()
|
|
|
|
* g_Config.m_SvTeamChangeDelay
|
|
|
|
> pSelf->Server()->Tick())
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "join",
|
2012-04-11 13:36:11 +00:00
|
|
|
"You can\'t change teams that fast!");
|
2011-12-25 11:20:10 +00:00
|
|
|
}
|
2011-12-25 13:51:04 +00:00
|
|
|
else if (((CGameControllerDDRace*) pSelf->m_pController)->m_Teams.SetCharacterTeam(
|
|
|
|
pPlayer->GetCID(), pResult->GetInteger(0)))
|
2011-12-25 11:20:10 +00:00
|
|
|
{
|
|
|
|
char aBuf[512];
|
2011-12-25 13:51:04 +00:00
|
|
|
str_format(aBuf, sizeof(aBuf), "%s joined team %d",
|
|
|
|
pSelf->Server()->ClientName(pPlayer->GetCID()),
|
|
|
|
pResult->GetInteger(0));
|
2011-12-25 11:20:10 +00:00
|
|
|
pSelf->SendChat(-1, CGameContext::CHAT_ALL, aBuf);
|
|
|
|
pPlayer->m_Last_Team = pSelf->Server()->Tick();
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "join",
|
|
|
|
"You cannot join this team at this time");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
char aBuf[512];
|
2011-12-25 13:51:04 +00:00
|
|
|
if (!pPlayer->IsPlaying())
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"join",
|
|
|
|
"You can't check your team while you are dead/a spectator.");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
str_format(
|
|
|
|
aBuf,
|
|
|
|
sizeof(aBuf),
|
|
|
|
"You are in team %d",
|
|
|
|
((CGameControllerDDRace*) pSelf->m_pController)->m_Teams.m_Core.Team(
|
|
|
|
pResult->m_ClientID));
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "join",
|
|
|
|
aBuf);
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CGameContext::ConMe(IConsole::IResult *pResult, void *pUserData)
|
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
CGameContext *pSelf = (CGameContext *) pUserData;
|
|
|
|
if (!CheckClientID(pResult->m_ClientID))
|
|
|
|
return;
|
2011-08-27 15:11:39 +00:00
|
|
|
|
|
|
|
char aBuf[256 + 24];
|
|
|
|
|
2011-12-25 13:51:04 +00:00
|
|
|
str_format(aBuf, 256 + 24, "'%s' %s",
|
|
|
|
pSelf->Server()->ClientName(pResult->m_ClientID),
|
|
|
|
pResult->GetString(0));
|
|
|
|
if (g_Config.m_SvSlashMe)
|
2011-08-27 15:11:39 +00:00
|
|
|
pSelf->SendChat(-2, CGameContext::CHAT_ALL, aBuf, pResult->m_ClientID);
|
|
|
|
else
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"me",
|
|
|
|
"/me is disabled on this server, admin can enable it by using sv_slash_me");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
void CGameContext::ConSetEyeEmote(IConsole::IResult *pResult,
|
2011-12-25 13:51:04 +00:00
|
|
|
void *pUserData)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
CGameContext *pSelf = (CGameContext *) pUserData;
|
|
|
|
if (!CheckClientID(pResult->m_ClientID))
|
|
|
|
return;
|
2011-08-27 15:11:39 +00:00
|
|
|
|
|
|
|
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
|
2011-12-25 13:51:04 +00:00
|
|
|
if (!pPlayer)
|
2011-08-27 15:11:39 +00:00
|
|
|
return;
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
if(pResult->NumArguments() == 0) {
|
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"emote",
|
|
|
|
(pPlayer->m_EyeEmote) ?
|
|
|
|
"You can now use the preset eye emotes." :
|
|
|
|
"You don't have any eye emotes, remember to bind some. (until you die)");
|
2011-08-27 15:11:39 +00:00
|
|
|
return;
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
}
|
2011-12-30 14:31:06 +00:00
|
|
|
else if(str_comp_nocase(pResult->GetString(0), "on") == 0)
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
pPlayer->m_EyeEmote = true;
|
2011-12-30 14:31:06 +00:00
|
|
|
else if(str_comp_nocase(pResult->GetString(0), "off") == 0)
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
pPlayer->m_EyeEmote = false;
|
2011-12-30 14:31:06 +00:00
|
|
|
else if(str_comp_nocase(pResult->GetString(0), "toggle") == 0)
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
pPlayer->m_EyeEmote = !pPlayer->m_EyeEmote;
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"emote",
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
(pPlayer->m_EyeEmote) ?
|
2011-12-25 13:51:04 +00:00
|
|
|
"You can now use the preset eye emotes." :
|
|
|
|
"You don't have any eye emotes, remember to bind some. (until you die)");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CGameContext::ConEyeEmote(IConsole::IResult *pResult, void *pUserData)
|
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
CGameContext *pSelf = (CGameContext *) pUserData;
|
|
|
|
if (g_Config.m_SvEmotionalTees == -1)
|
|
|
|
{
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "emote",
|
|
|
|
"Server admin disabled emotes.");
|
2011-11-08 12:04:57 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-12-25 13:51:04 +00:00
|
|
|
if (!CheckClientID(pResult->m_ClientID))
|
|
|
|
return;
|
2011-08-27 15:11:39 +00:00
|
|
|
|
|
|
|
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
|
2011-12-25 13:51:04 +00:00
|
|
|
if (!pPlayer)
|
2011-08-27 15:11:39 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (pResult->NumArguments() == 0)
|
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"emote",
|
|
|
|
"Emote commands are: /emote surprise /emote blink /emote close /emote angry /emote happy /emote pain");
|
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"emote",
|
|
|
|
"Example: /emote surprise 10 for 10 seconds or /emote surprise (default 1 second)");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-12-27 10:19:02 +00:00
|
|
|
if(pPlayer->m_LastEyeEmote + g_Config.m_SvEyeEmoteChangeDelay * pSelf->Server()->TickSpeed() >= pSelf->Server()->Tick())
|
|
|
|
return;
|
|
|
|
|
2011-08-27 15:11:39 +00:00
|
|
|
if (!str_comp(pResult->GetString(0), "angry"))
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
pPlayer->m_DefEmote = EMOTE_ANGRY;
|
2011-08-27 15:11:39 +00:00
|
|
|
else if (!str_comp(pResult->GetString(0), "blink"))
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
pPlayer->m_DefEmote = EMOTE_BLINK;
|
2011-08-27 15:11:39 +00:00
|
|
|
else if (!str_comp(pResult->GetString(0), "close"))
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
pPlayer->m_DefEmote = EMOTE_BLINK;
|
2011-08-27 15:11:39 +00:00
|
|
|
else if (!str_comp(pResult->GetString(0), "happy"))
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
pPlayer->m_DefEmote = EMOTE_HAPPY;
|
2011-08-27 15:11:39 +00:00
|
|
|
else if (!str_comp(pResult->GetString(0), "pain"))
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
pPlayer->m_DefEmote = EMOTE_PAIN;
|
2011-08-27 15:11:39 +00:00
|
|
|
else if (!str_comp(pResult->GetString(0), "surprise"))
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
pPlayer->m_DefEmote = EMOTE_SURPRISE;
|
2011-08-27 15:11:39 +00:00
|
|
|
else if (!str_comp(pResult->GetString(0), "normal"))
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
pPlayer->m_DefEmote = EMOTE_NORMAL;
|
2011-08-27 15:11:39 +00:00
|
|
|
else
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"emote", "Unknown emote... Say /emote");
|
2011-08-27 15:11:39 +00:00
|
|
|
|
|
|
|
int Duration = 1;
|
|
|
|
if (pResult->NumArguments() > 1)
|
|
|
|
Duration = pResult->GetInteger(1);
|
|
|
|
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
pPlayer->m_DefEmoteReset = pSelf->Server()->Tick()
|
2011-12-25 13:51:04 +00:00
|
|
|
+ Duration * pSelf->Server()->TickSpeed();
|
2011-12-27 10:19:02 +00:00
|
|
|
pPlayer->m_LastEyeEmote = pSelf->Server()->Tick();
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-09-02 22:28:56 +00:00
|
|
|
void CGameContext::ConShowOthers(IConsole::IResult *pResult, void *pUserData)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
CGameContext *pSelf = (CGameContext *) pUserData;
|
|
|
|
if (!CheckClientID(pResult->m_ClientID))
|
|
|
|
return;
|
2011-08-27 15:11:39 +00:00
|
|
|
|
|
|
|
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
|
2011-12-25 13:51:04 +00:00
|
|
|
if (!pPlayer)
|
2011-08-27 15:11:39 +00:00
|
|
|
return;
|
2011-12-25 13:51:04 +00:00
|
|
|
if (g_Config.m_SvShowOthers)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
if (pPlayer->m_IsUsingDDRaceClient)
|
2011-08-27 15:11:39 +00:00
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
if (pResult->NumArguments())
|
2011-08-27 15:11:39 +00:00
|
|
|
pPlayer->m_ShowOthers = pResult->GetInteger(0);
|
|
|
|
else
|
|
|
|
pPlayer->m_ShowOthers = !pPlayer->m_ShowOthers;
|
|
|
|
}
|
|
|
|
else
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"showotherschat",
|
|
|
|
"Showing players from other teams is only available with DDRace Client, http://DDRace.info");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
else
|
2011-12-25 13:51:04 +00:00
|
|
|
pSelf->Console()->Print(
|
|
|
|
IConsole::OUTPUT_LEVEL_STANDARD,
|
|
|
|
"showotherschat",
|
|
|
|
"Showing players from other teams is disabled by the server admin");
|
2011-08-27 15:11:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool CheckClientID(int ClientID)
|
|
|
|
{
|
2011-12-25 13:51:04 +00:00
|
|
|
dbg_assert(ClientID >= 0 || ClientID < MAX_CLIENTS,
|
|
|
|
"The Client ID is wrong");
|
|
|
|
if (ClientID < 0 || ClientID >= MAX_CLIENTS)
|
|
|
|
return false;
|
2011-08-27 15:11:39 +00:00
|
|
|
return true;
|
|
|
|
}
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
|
2012-02-14 20:38:06 +00:00
|
|
|
char* TimerType(int TimerType)
|
|
|
|
{
|
|
|
|
char msg[3][128] = {"game/round timer.", "broadcast.", "both game/round timer and broadcast."};
|
|
|
|
return msg[TimerType];
|
|
|
|
}
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
void CGameContext::ConSayTime(IConsole::IResult *pResult, void *pUserData)
|
|
|
|
{
|
|
|
|
CGameContext *pSelf = (CGameContext *) pUserData;
|
|
|
|
if (!CheckClientID(pResult->m_ClientID))
|
|
|
|
return;
|
|
|
|
|
|
|
|
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
|
|
|
|
if (!pPlayer)
|
|
|
|
return;
|
|
|
|
CCharacter* pChr = pPlayer->GetCharacter();
|
|
|
|
if (!pChr)
|
|
|
|
return;
|
2011-12-29 12:35:14 +00:00
|
|
|
if(pChr->m_DDRaceState != DDRACE_STARTED)
|
|
|
|
return;
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
|
|
|
|
char aBuftime[64];
|
|
|
|
int IntTime = (int) ((float) (pSelf->Server()->Tick() - pChr->m_StartTime)
|
|
|
|
/ ((float) pSelf->Server()->TickSpeed()));
|
|
|
|
str_format(aBuftime, sizeof(aBuftime), "Your Time is %s%d:%s%d",
|
|
|
|
((IntTime / 60) > 9) ? "" : "0", IntTime / 60,
|
|
|
|
((IntTime % 60) > 9) ? "" : "0", IntTime % 60);
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "time", aBuftime);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CGameContext::ConSayTimeAll(IConsole::IResult *pResult, void *pUserData)
|
|
|
|
{
|
|
|
|
CGameContext *pSelf = (CGameContext *) pUserData;
|
|
|
|
if (!CheckClientID(pResult->m_ClientID))
|
|
|
|
return;
|
|
|
|
|
|
|
|
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
|
|
|
|
if (!pPlayer)
|
|
|
|
return;
|
|
|
|
CCharacter* pChr = pPlayer->GetCharacter();
|
|
|
|
if (!pChr)
|
|
|
|
return;
|
2011-12-29 12:35:14 +00:00
|
|
|
if(pChr->m_DDRaceState != DDRACE_STARTED)
|
|
|
|
return;
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
|
|
|
|
char aBuftime[64];
|
|
|
|
int IntTime = (int) ((float) (pSelf->Server()->Tick() - pChr->m_StartTime)
|
|
|
|
/ ((float) pSelf->Server()->TickSpeed()));
|
|
|
|
str_format(aBuftime, sizeof(aBuftime),
|
|
|
|
"%s\'s current race time is %s%d:%s%d",
|
|
|
|
pSelf->Server()->ClientName(pResult->m_ClientID),
|
|
|
|
((IntTime / 60) > 9) ? "" : "0", IntTime / 60,
|
|
|
|
((IntTime % 60) > 9) ? "" : "0", IntTime % 60);
|
|
|
|
pSelf->SendChat(-1, CGameContext::CHAT_ALL, aBuftime, pResult->m_ClientID);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CGameContext::ConTime(IConsole::IResult *pResult, void *pUserData)
|
|
|
|
{
|
|
|
|
CGameContext *pSelf = (CGameContext *) pUserData;
|
|
|
|
if (!CheckClientID(pResult->m_ClientID))
|
|
|
|
return;
|
|
|
|
|
|
|
|
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
|
|
|
|
if (!pPlayer)
|
|
|
|
return;
|
|
|
|
CCharacter* pChr = pPlayer->GetCharacter();
|
|
|
|
if (!pChr)
|
|
|
|
return;
|
|
|
|
|
|
|
|
char aBuftime[64];
|
|
|
|
int IntTime = (int) ((float) (pSelf->Server()->Tick() - pChr->m_StartTime)
|
|
|
|
/ ((float) pSelf->Server()->TickSpeed()));
|
|
|
|
str_format(aBuftime, sizeof(aBuftime), "Your Time is %s%d:%s%d",
|
|
|
|
((IntTime / 60) > 9) ? "" : "0", IntTime / 60,
|
|
|
|
((IntTime % 60) > 9) ? "" : "0", IntTime % 60);
|
|
|
|
pSelf->SendBroadcast(aBuftime, pResult->m_ClientID);
|
|
|
|
}
|
|
|
|
|
2012-02-14 18:25:34 +00:00
|
|
|
void CGameContext::ConSetTimerType(IConsole::IResult *pResult, void *pUserData)
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
{
|
|
|
|
CGameContext *pSelf = (CGameContext *) pUserData;
|
2012-02-14 18:25:34 +00:00
|
|
|
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
if (!CheckClientID(pResult->m_ClientID))
|
|
|
|
return;
|
|
|
|
|
|
|
|
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
|
|
|
|
if (!pPlayer)
|
|
|
|
return;
|
2012-02-14 18:25:34 +00:00
|
|
|
|
2012-02-14 20:38:06 +00:00
|
|
|
char aBuf[128];
|
|
|
|
if(pPlayer->m_TimerType <= 2 && pPlayer->m_TimerType >= 0)
|
|
|
|
str_format(aBuf, sizeof(aBuf), "Timer is displayed in", TimerType(pPlayer->m_TimerType));
|
|
|
|
else if(pPlayer->m_TimerType == 3)
|
|
|
|
str_format(aBuf, sizeof(aBuf), "Timer isn't displayed.");
|
|
|
|
|
|
|
|
if(pResult->NumArguments() == 0) {
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD,"timer",aBuf);
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
return;
|
|
|
|
}
|
2012-02-14 18:25:34 +00:00
|
|
|
else if(str_comp_nocase(pResult->GetString(0), "gametimer") == 0) {
|
|
|
|
pSelf->SendBroadcast("", pResult->m_ClientID);
|
2012-02-14 20:38:06 +00:00
|
|
|
pPlayer->m_TimerType = 0;
|
2012-02-14 18:25:34 +00:00
|
|
|
}
|
|
|
|
else if(str_comp_nocase(pResult->GetString(0), "broadcast") == 0)
|
2012-02-14 20:38:06 +00:00
|
|
|
pPlayer->m_TimerType = 1;
|
|
|
|
else if(str_comp_nocase(pResult->GetString(0), "both") == 0)
|
|
|
|
pPlayer->m_TimerType = 2;
|
|
|
|
else if(str_comp_nocase(pResult->GetString(0), "none") == 0)
|
|
|
|
pPlayer->m_TimerType = 3;
|
|
|
|
else if(str_comp_nocase(pResult->GetString(0), "cycle") == 0) {
|
|
|
|
if(pPlayer->m_TimerType < 3)
|
|
|
|
pPlayer->m_TimerType++;
|
|
|
|
else if(pPlayer->m_TimerType == 3)
|
|
|
|
pPlayer->m_TimerType = 0;
|
|
|
|
}
|
|
|
|
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD,"timer",aBuf);
|
Added the following settings to Close #123.
sv_time_in_broadcast, 1, 0, 1, CFGFLAG_SERVER, "Whether to display time in broadcast every interval or not by default, later the choice can be changed by players via chat commands"
sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time"
sv_time_in_gametimer, 0, 0, 1, CFGFLAG_SERVER, "Whether to display time in the round/game timer or not by default, later the choice can be changed by players via chat commands"
Added the following Chat commands to give the player the choice over their settings:
"saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race"
"saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race"
"time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message"
"broadcasttime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetBroadcastTime, this, "Personal Setting of showing time in the broadcast, broadcasttime s, where s = on for on, off for off, toggle for toggle and nothing to show current status"
"servergametime", "?s", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSetServerGameTime, this, "Personal Setting of showing time in the round/game timer, servergametime s, where s = on for on off for off, toggle for toggle and nothing to show current status"
Fixed Chat Command "eyeemote" and made it a set + toggle instead of just toggle for better bin techneques
Moved some vars from CCharacter to CPlayer to keep their status evern after death but not after disconnect.
So now players have the choice to see which timer they wanna see if any.
Note: These changes are all untested Stay away from this update on your main server until they are tested, i don't even know if they will compile propperly
2011-12-29 12:17:34 +00:00
|
|
|
}
|
2012-02-14 20:38:06 +00:00
|
|
|
|