add "/setjumps" practice command and "setjumps" rcon command

This commit is contained in:
art0007i 2024-07-02 21:59:22 +02:00
parent 9db780ebbc
commit 03f934c81e
6 changed files with 26 additions and 0 deletions

View file

@ -2082,6 +2082,13 @@ void CGameContext::ConPracticeJetpack(IConsole::IResult *pResult, void *pUserDat
ConJetpack(pResult, pUserData);
}
void CGameContext::ConPracticeSetJumps(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;
if(pSelf->GetPracticeCharacter(pResult))
ConSetJumps(pResult, pUserData);
}
void CGameContext::ConPracticeWeapons(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;
@ -2130,6 +2137,7 @@ void CGameContext::ConPracticeNinja(IConsole::IResult *pResult, void *pUserData)
if(pSelf->GetPracticeCharacter(pResult))
ConNinja(pResult, pUserData);
}
void CGameContext::ConPracticeUnNinja(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;

View file

@ -269,6 +269,14 @@ void CGameContext::ConJetpack(IConsole::IResult *pResult, void *pUserData)
pChr->SetJetpack(true);
}
void CGameContext::ConSetJumps(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;
CCharacter *pChr = pSelf->GetPlayerChar(pResult->m_ClientId);
if(pChr)
pChr->SetJumps(pResult->GetInteger(0));
}
void CGameContext::ConWeapons(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;

View file

@ -132,6 +132,11 @@ void CCharacter::SetJetpack(bool Active)
m_Core.m_Jetpack = Active;
}
void CCharacter::SetJumps(int Jumps)
{
m_Core.m_Jumps = Jumps;
}
void CCharacter::SetSolo(bool Solo)
{
m_Core.m_Solo = Solo;

View file

@ -48,6 +48,7 @@ public:
void SetWeapon(int W);
void SetJetpack(bool Active);
void SetJumps(int Jumps);
void SetSolo(bool Solo);
void SetSuper(bool Super);
void SetLiveFrozen(bool Active);

View file

@ -3592,6 +3592,7 @@ void CGameContext::RegisterDDRaceCommands()
Console()->Register("laser", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConLaser, this, "Gives a laser to you");
Console()->Register("rifle", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConLaser, this, "Gives a laser to you");
Console()->Register("jetpack", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConJetpack, this, "Gives jetpack to you");
Console()->Register("setjumps", "i[jumps]", CFGFLAG_SERVER | CMDFLAG_TEST, ConSetJumps, this, "Gives you as many jumps as you specify");
Console()->Register("weapons", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConWeapons, this, "Gives all weapons to you");
Console()->Register("unshotgun", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConUnShotgun, this, "Removes the shotgun from you");
Console()->Register("ungrenade", "", CFGFLAG_SERVER | CMDFLAG_TEST, ConUnGrenade, this, "Removes the grenade launcher from you");
@ -3721,6 +3722,7 @@ void CGameContext::RegisterChatCommands()
Console()->Register("laser", "", CFGFLAG_CHAT | CMDFLAG_PRACTICE, ConPracticeLaser, this, "Gives a laser to you");
Console()->Register("rifle", "", CFGFLAG_CHAT | CMDFLAG_PRACTICE, ConPracticeLaser, this, "Gives a laser to you");
Console()->Register("jetpack", "", CFGFLAG_CHAT | CMDFLAG_PRACTICE, ConPracticeJetpack, this, "Gives jetpack to you");
Console()->Register("setjumps", "i[jumps]", CFGFLAG_CHAT | CMDFLAG_PRACTICE, ConPracticeSetJumps, this, "Gives you as many jumps as you specify");
Console()->Register("weapons", "", CFGFLAG_CHAT | CMDFLAG_PRACTICE, ConPracticeWeapons, this, "Gives all weapons to you");
Console()->Register("unshotgun", "", CFGFLAG_CHAT | CMDFLAG_PRACTICE, ConPracticeUnShotgun, this, "Removes the shotgun from you");
Console()->Register("ungrenade", "", CFGFLAG_CHAT | CMDFLAG_PRACTICE, ConPracticeUnGrenade, this, "Removes the grenade launcher from you");

View file

@ -388,6 +388,7 @@ private:
static void ConGrenade(IConsole::IResult *pResult, void *pUserData);
static void ConLaser(IConsole::IResult *pResult, void *pUserData);
static void ConJetpack(IConsole::IResult *pResult, void *pUserData);
static void ConSetJumps(IConsole::IResult *pResult, void *pUserData);
static void ConWeapons(IConsole::IResult *pResult, void *pUserData);
static void ConUnShotgun(IConsole::IResult *pResult, void *pUserData);
static void ConUnGrenade(IConsole::IResult *pResult, void *pUserData);
@ -474,6 +475,7 @@ private:
static void ConPracticeGrenade(IConsole::IResult *pResult, void *pUserData);
static void ConPracticeLaser(IConsole::IResult *pResult, void *pUserData);
static void ConPracticeJetpack(IConsole::IResult *pResult, void *pUserData);
static void ConPracticeSetJumps(IConsole::IResult *pResult, void *pUserData);
static void ConPracticeWeapons(IConsole::IResult *pResult, void *pUserData);
static void ConPracticeUnShotgun(IConsole::IResult *pResult, void *pUserData);
static void ConPracticeUnGrenade(IConsole::IResult *pResult, void *pUserData);