mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Add totelecp
This commit is contained in:
parent
9ae59a1923
commit
51012d479b
|
@ -8,6 +8,7 @@
|
|||
|
||||
CONSOLE_COMMAND("kill_pl", "v", CFGFLAG_SERVER, ConKillPlayer, this, "Kills player v and announces the kill")
|
||||
CONSOLE_COMMAND("totele", "i", CFGFLAG_SERVER|CMDFLAG_TEST, ConToTeleporter, this, "Teleports you to teleporter v")
|
||||
CONSOLE_COMMAND("totelecp", "i", CFGFLAG_SERVER|CMDFLAG_TEST, ConToCheckTeleporter, this, "Teleports you to checkpoint teleporter v")
|
||||
CONSOLE_COMMAND("tele", "v?i", CFGFLAG_SERVER|CMDFLAG_TEST, ConTeleport, this, "Teleports you (or player v) to player i")
|
||||
CONSOLE_COMMAND("addweapon", "i", CFGFLAG_SERVER|CMDFLAG_TEST, ConAddWeapon, this, "Gives weapon with id i to you (all = -1, hammer = 0, gun = 1, shotgun = 2, grenade = 3, rifle = 4, ninja = 5)")
|
||||
CONSOLE_COMMAND("removeweapon", "i", CFGFLAG_SERVER|CMDFLAG_TEST, ConRemoveWeapon, this, "removes weapon with id i from you (all = -1, hammer = 0, gun = 1, shotgun = 2, grenade = 3, rifle = 4)")
|
||||
|
|
|
@ -266,6 +266,24 @@ void CGameContext::ConToTeleporter(IConsole::IResult *pResult, void *pUserData)
|
|||
}
|
||||
}
|
||||
|
||||
void CGameContext::ConToCheckTeleporter(IConsole::IResult *pResult, void *pUserData)
|
||||
{
|
||||
CGameContext *pSelf = (CGameContext *) pUserData;
|
||||
unsigned int TeleTo = pResult->GetInteger(0);
|
||||
|
||||
if (((CGameControllerDDRace*)pSelf->m_pController)->m_TeleCheckOuts[TeleTo-1].size())
|
||||
{
|
||||
int Num = ((CGameControllerDDRace*)pSelf->m_pController)->m_TeleCheckOuts[TeleTo-1].size();
|
||||
vec2 TelePos = ((CGameControllerDDRace*)pSelf->m_pController)->m_TeleCheckOuts[TeleTo-1][(!Num)?Num:rand() % Num];
|
||||
CCharacter* pChr = pSelf->GetPlayerChar(pResult->m_ClientID);
|
||||
if (pChr)
|
||||
{
|
||||
pChr->Core()->m_Pos = TelePos;
|
||||
pChr->m_DDRaceState = DDRACE_CHEAT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CGameContext::ConTeleport(IConsole::IResult *pResult, void *pUserData)
|
||||
{
|
||||
CGameContext *pSelf = (CGameContext *) pUserData;
|
||||
|
|
|
@ -228,6 +228,7 @@ private:
|
|||
static void ConMoveRaw(IConsole::IResult *pResult, void *pUserData);
|
||||
|
||||
static void ConToTeleporter(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConToCheckTeleporter(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConTeleport(IConsole::IResult *pResult, void *pUserData);
|
||||
|
||||
static void ConCredits(IConsole::IResult *pResult, void *pUserData);
|
||||
|
|
Loading…
Reference in a new issue