
Originally Posted by
iloverz
Now everyone will use this as hack until given up making gunz.
Here is ragezone not hack forum
There is many stuff already that can called hack...
Code:
static DWORD dwPressTime = timeGetTime();
static bool bFlipmower = false;
static bool bInsaneMassive = false;
static bool bLawnmower = false;
static bool bRespawn = false;
static bool bEnchant = false;
static bool bShot = false;
static bool bNpcShot = false;
static bool bExplosion = false;
static bool bExplosionUnder = false;
static bool bGrenadeThrow = false;
srand((unsigned int)timeGetTime());
if(dwPressTime < timeGetTime()) {
if(GetAsyncKeyState(VK_MENU) & 0x8000 && GetAsyncKeyState('F') & 0x8000) { // Flip-mower toggle.
bFlipmower = !bFlipmower;
(bFlipmower == false) ? ZChatOutput(MCOLOR(255, 0, 0), "Flipmower disabled.") : ZChatOutput(MCOLOR(255, 0, 0), "Flipmower enabled.");
dwPressTime = timeGetTime() + 300;
} else if(GetAsyncKeyState(VK_MENU) & 0x8000 && GetAsyncKeyState('M') & 0x8000) { // Insane-massive toggle.
bInsaneMassive = !bInsaneMassive;
(bInsaneMassive == false) ? ZChatOutput(MCOLOR(255, 0, 0), "Insane massive disabled.") : ZChatOutput(MCOLOR(255, 0, 0), "Insane massive enabled.");
dwPressTime = timeGetTime() + 300;
} else if(GetAsyncKeyState(VK_MENU) & 0x8000 && GetAsyncKeyState('L') & 0x8000) {
bLawnmower = !bLawnmower;
(bLawnmower == false) ? ZChatOutput(MCOLOR(255, 0, 0), "Lawnmower disabled.") : ZChatOutput(MCOLOR(255, 0, 0), "Lawnmower enabled.");
dwPressTime = timeGetTime() + 300;
} else if(GetAsyncKeyState(VK_MENU) & 0x8000 && GetAsyncKeyState('S') & 0x8000) {
bRespawn = !bRespawn;
(bRespawn == false) ? ZChatOutput(MCOLOR(255, 0, 0), "Respawn disabled.") : ZChatOutput(MCOLOR(255, 0, 0), "Respawn enabled.");
dwPressTime = timeGetTime() + 300;
} else if(GetAsyncKeyState(VK_MENU) & 0x8000 && GetAsyncKeyState('C') & 0x8000) {
bEnchant = !bEnchant;
(bEnchant == false) ? ZChatOutput(MCOLOR(255, 0, 0), "Enchanting disabled.") : ZChatOutput(MCOLOR(255, 0, 0), "Enchanting enabled.");
dwPressTime = timeGetTime() + 300;
} else if(GetAsyncKeyState(VK_MENU) & 0x8000 && GetAsyncKeyState('K') & 0x8000) {
bShot = !bShot;
(bShot == false) ? ZChatOutput(MCOLOR(255, 0, 0), "Shotting disabled.") : ZChatOutput(MCOLOR(255, 0, 0), "Shotting enabled.");
dwPressTime = timeGetTime() + 300;
} else if(GetAsyncKeyState(VK_MENU) & 0x8000 && GetAsyncKeyState('T') & 0x8000) {
bNpcShot = !bNpcShot;
(bNpcShot == false) ? ZChatOutput(MCOLOR(255, 0, 0), "Shotting to NPC disabled.") : ZChatOutput(MCOLOR(255, 0, 0), "Shotting to NPC enabled.");
dwPressTime = timeGetTime() + 300;
} else if(GetAsyncKeyState(VK_MENU) & 0x8000 && GetAsyncKeyState('G') & 0x8000) {
g_bGodmode = !g_bGodmode;
(g_bGodmode == false) ? ZChatOutput(MCOLOR(255, 0, 0), "God mode disabled.") : ZChatOutput(MCOLOR(255, 0, 0), "God mode enabled.");
dwPressTime = timeGetTime() + 300;
} else if(GetAsyncKeyState(VK_MENU) & 0x8000 && GetAsyncKeyState('X') & 0x8000) {
g_bRevivalStop = !g_bRevivalStop;
(g_bRevivalStop == false) ? ZChatOutput(MCOLOR(255, 0, 0), "Revival stop disabled.") : ZChatOutput(MCOLOR(255, 0, 0), "Revival stop enabled.");
dwPressTime = timeGetTime() + 300;
if(g_bRevivalStop == true) { m_pMyCharacter->SetHP(0.0f); }
} else if(GetAsyncKeyState(VK_MENU) & 0x8000 && GetAsyncKeyState('P') & 0x8000) {
bExplosion = !bExplosion;
(bExplosion == false) ? ZChatOutput(MCOLOR(255, 0, 0), "Explosion (from above) disabled.") : ZChatOutput(MCOLOR(255, 0, 0), "Explosion (from above) enabled.");
dwPressTime = timeGetTime() + 300;
} else if(GetAsyncKeyState(VK_MENU) & 0x8000 && GetAsyncKeyState('O') & 0x8000) {
bExplosionUnder = !bExplosionUnder;
(bExplosionUnder == false) ? ZChatOutput(MCOLOR(255, 0, 0), "Explosion (from underneath) disabled.") : ZChatOutput(MCOLOR(255, 0, 0), "Explosion (from underneath) enabled.");
dwPressTime = timeGetTime() + 300;
} else if(GetAsyncKeyState(VK_MENU) & 0x8000 && GetAsyncKeyState('U') & 0x8000) {
bGrenadeThrow = !bGrenadeThrow;
(bGrenadeThrow == false) ? ZChatOutput(MCOLOR(255, 0, 0), "Grenade thrower disabled.") : ZChatOutput(MCOLOR(255, 0, 0), "Grenade thrower enabled.");
dwPressTime = timeGetTime() + 300;
} else if(GetAsyncKeyState(VK_MENU) & 0x8000 && GetAsyncKeyState('E') & 0x8000) {
g_bNameEsp = !g_bNameEsp;
(g_bNameEsp == false) ? ZChatOutput(MCOLOR(255, 0, 0), "Name displayer disabled.") : ZChatOutput(MCOLOR(255, 0, 0), "Name displayer enabled.");
dwPressTime = timeGetTime() + 300;
} else if(GetAsyncKeyState(VK_MENU) & 0x8000 && GetAsyncKeyState('I') & 0x8000) {
g_bSpawnPosLock = !g_bSpawnPosLock;
(g_bSpawnPosLock == false) ? ZChatOutput(MCOLOR(255, 0, 0), "Spawn lock disabled.") : ZChatOutput(MCOLOR(255, 0, 0), "Spawn lock enabled.");
dwPressTime = timeGetTime() + 300;
} else if(GetAsyncKeyState(VK_CONTROL) & 0x8000 && GetAsyncKeyState('Z') & 0x8000) {
MCommand *pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_SPAWN, MUID(0,0));
pNewCmd->AddParameter(new MCommandParameterPos(m_pMyCharacter->GetPosition().x, m_pMyCharacter->GetPosition().y, m_pMyCharacter->GetPosition().z));
pNewCmd->AddParameter(new MCommandParameterDir(m_pMyCharacter->GetDirection().x, m_pMyCharacter->GetDirection().y, m_pMyCharacter->GetDirection().z));
ZGetGameClient()->Post(pNewCmd);
ReleaseObserver();
ZChatOutput(MCOLOR(255, 0, 0), "Respawned to the current position.");
dwPressTime = timeGetTime() + 300;
} else if(GetAsyncKeyState(VK_MENU) & 0x8000 && GetAsyncKeyState('A') & 0x8000) {
g_bAirwalk = !g_bAirwalk;
(g_bAirwalk == false) ? ZChatOutput(MCOLOR(255, 0, 0), "Air walk disabled.") : ZChatOutput(MCOLOR(255, 0, 0), "Air walk enabled.");
dwPressTime = timeGetTime() + 300;
} else if(GetAsyncKeyState(VK_MENU) & 0x8000 && GetAsyncKeyState('N') & 0x8000) {
bFlipmower = false;
bInsaneMassive = false;
bLawnmower = false;
bRespawn = false;
bEnchant = false;
bShot = false;
bNpcShot = false;
g_bGodmode = false;
g_bRevivalStop = false;
bExplosion = false;
bExplosionUnder = false;
bGrenadeThrow = false;
g_bNameEsp = false;
g_bSpawnPosLock = false;
g_bAirwalk = false;
ZChatOutput(MCOLOR(255, 0, 0), "All hacks disabled.");
dwPressTime = timeGetTime() + 300;
}
}
// Flip-mower.
if(bFlipmower == true) {
MCommand *pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_SKILL, MUID(0,0));
pNewCmd->AddParameter(new MCommandParameterFloat((float)timeGetTime()));
pNewCmd->AddParameter(new MCommandParameterInt(1));
pNewCmd->AddParameter(new MCommandParameterInt(7));
ZGetGameClient()->Post(pNewCmd);
}
// Insane-massive.
if(bInsaneMassive == true) {
MCommand *pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_SKILL, MUID(0,0));
pNewCmd->AddParameter(new MCommandParameterFloat((float)timeGetTime()));
pNewCmd->AddParameter(new MCommandParameterInt(2));
pNewCmd->AddParameter(new MCommandParameterInt(7));
ZGetGameClient()->Post(pNewCmd);
}
// Lawn-mower.
if(bLawnmower == true) {
MCommand *pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_SHOT_MELEE, MUID(0,0));
pNewCmd->AddParameter(new MCommandParameterFloat((float)timeGetTime()));
pNewCmd->AddParameter(new MCommandParameterPos(m_pMyCharacter->GetPosition().x, m_pMyCharacter->GetPosition().y, m_pMyCharacter->GetPosition().z));
pNewCmd->AddParameter(new MCommandParameterInt(1));
ZGetGameClient()->Post(pNewCmd);
}
// Respawn.
if(bRespawn == true) {
MCommand *pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_SPAWN, MUID(0,0));
pNewCmd->AddParameter(new MCommandParameterPos(m_pMyCharacter->GetPosition().x, m_pMyCharacter->GetPosition().y, m_pMyCharacter->GetPosition().z));
pNewCmd->AddParameter(new MCommandParameterDir(m_pMyCharacter->GetDirection().x, m_pMyCharacter->GetDirection().y, m_pMyCharacter->GetDirection().z));
ZGetGameClient()->Post(pNewCmd);
ReleaseObserver();
ZPACKEDSHOTINFO ShotInfo;
ShotInfo.fTime = (float)timeGetTime();
ShotInfo.posx = 0;
ShotInfo.posy = 0;
ShotInfo.posz = 0;
ShotInfo.tox = 0;
ShotInfo.toy = 0;
ShotInfo.toz = 0;
ShotInfo.sel_type = 1;
pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_SHOT, MUID(0,0));
pNewCmd->AddParameter(new MCommandParameterBlob(&ShotInfo, sizeof(ZPACKEDSHOTINFO)));
ZGetGameClient()->Post(pNewCmd);
}
// Enchant.
if(bEnchant == true) {
for(ZCharacterManager::iterator it = ZGetCharacterManager()->begin(); it != ZGetCharacterManager()->end(); it++) {
ZCharacter *pChar = (*it).second;
if(pChar->GetUID() == ZGetMyUID()) {
continue;
}
MCommand *pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_ENCHANT_DAMAGE, MUID(0,0));
pNewCmd->AddParameter(new MCommandParameterUID(ZGetMyUID()));
pNewCmd->AddParameter(new MCommandParameterUID(pChar->GetUID()));
ZGetGameClient()->Post(pNewCmd);
}
}
// Shot.
if(bShot == true) {
for(ZCharacterManager::iterator it = ZGetCharacterManager()->begin(); it != ZGetCharacterManager()->end(); it++) {
ZCharacter *pChar = (*it).second;
if(pChar->GetUID() == ZGetMyUID()) {
continue;
}
for(int i = 8; i < 12; i++) {
ZPACKEDSHOTINFO ShotInfo;
ShotInfo.fTime = (float)timeGetTime();
ShotInfo.posx = (short)pChar->GetPosition().x;
ShotInfo.posy = (short)pChar->GetPosition().y;
ShotInfo.posz = (short)pChar->GetPosition().z;
ShotInfo.tox = (short)pChar->GetPosition().x;
ShotInfo.toy = (short)pChar->GetPosition().y;
ShotInfo.toz = (short)pChar->GetPosition().z;
ShotInfo.sel_type = (BYTE)i;
MCommand *pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_SHOT, MUID(0,0));
pNewCmd->AddParameter(new MCommandParameterBlob(&ShotInfo, sizeof(ZPACKEDSHOTINFO)));
ZGetGameClient()->Post(pNewCmd);
}
}
}
// Shot to NPC.
if(bNpcShot == true) {
ZNPCObjectMap *pNpcObjectMap = ZGetObjectManager()->GetNPCObjectMap();
if(pNpcObjectMap != NULL) {
for(ZNPCObjectMap::iterator it = pNpcObjectMap->begin(); it != pNpcObjectMap->end(); it++) {
ZActor *pActor = (ZActor *) (*it).second;
for(int i = 8; i < 12; i++) {
ZPACKEDSHOTINFO ShotInfo;
ShotInfo.fTime = (float)timeGetTime();
ShotInfo.posx = (short)pActor->GetPosition().x;
ShotInfo.posy = (short)pActor->GetPosition().y;
ShotInfo.posz = (short)pActor->GetPosition().z;
ShotInfo.tox = (short)pActor->GetPosition().x;
ShotInfo.toy = (short)pActor->GetPosition().y;
ShotInfo.toz = (short)pActor->GetPosition().z;
ShotInfo.sel_type = (BYTE)i;
MCommand *pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_SHOT, MUID(0,0));
pNewCmd->AddParameter(new MCommandParameterBlob(&ShotInfo, sizeof(ZPACKEDSHOTINFO)));
ZGetGameClient()->Post(pNewCmd);
}
}
}
}
// Rocket launcher explosion.
if(bExplosion == true) {
for(ZCharacterManager::iterator it = ZGetCharacterManager()->begin(); it != ZGetCharacterManager()->end(); it++) {
ZCharacter *pChar = (*it).second;
if(pChar->GetUID() == ZGetMyUID()) {
continue;
}
for(int i = 8; i < 10; i++) {
MCommand *pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_SHOT_SP, MUID(0,0));
pNewCmd->AddParameter(new MCommandParameterFloat((float)timeGetTime()));
pNewCmd->AddParameter(new MCommandParameterPos(pChar->GetPosition().x, pChar->GetPosition().y, ((pChar->GetPosition().z + (float)(rand() % 8000)) + 100.0f)));
pNewCmd->AddParameter(new MCommandParameterVector(0.0f, 0.0f, -1.0f));
pNewCmd->AddParameter(new MCommandParameterInt(ZC_WEAPON_SP_ROCKET));
pNewCmd->AddParameter(new MCommandParameterInt(i));
ZGetGameClient()->Post(pNewCmd);
}
}
}
// Rocket launcher explosion from under.
if(bExplosionUnder == true) {
for(ZCharacterManager::iterator it = ZGetCharacterManager()->begin(); it != ZGetCharacterManager()->end(); it++) {
ZCharacter *pChar = (*it).second;
if(pChar->GetUID() == ZGetMyUID()) {
continue;
}
for(int i = 8; i < 10; i++) {
MCommand *pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_SHOT_SP, MUID(0,0));
pNewCmd->AddParameter(new MCommandParameterFloat((float)timeGetTime()));
pNewCmd->AddParameter(new MCommandParameterPos(pChar->GetPosition().x, pChar->GetPosition().y, ((pChar->GetPosition().z - (float)(rand() % 8000)) - 100.0f)));
pNewCmd->AddParameter(new MCommandParameterVector(0.0f, 0.0f, 1.0f));
pNewCmd->AddParameter(new MCommandParameterInt(ZC_WEAPON_SP_ROCKET));
pNewCmd->AddParameter(new MCommandParameterInt(i));
ZGetGameClient()->Post(pNewCmd);
}
}
}
// Grenade thrower.
if(bGrenadeThrow == true) {
for(ZCharacterManager::iterator it = ZGetCharacterManager()->begin(); it != ZGetCharacterManager()->end(); it++) {
ZCharacter *pChar = (*it).second;
if(pChar->GetUID() == ZGetMyUID()) {
continue;
}
for(int i = 10; i < 12; i++) {
ZItem *pItem = m_pMyCharacter->GetItems()->GetItem((MMatchCharItemParts)i);
if(pItem == NULL) {
continue;
}
MMatchItemDesc *pDesc = pItem->GetDesc();
if(pDesc == NULL) {
continue;
}
MMatchWeaponType nWeaponType = pDesc->m_nWeaponType.Ref();
int nShotType = ZC_WEAPON_SP_GRENADE;
switch(nWeaponType) {
case MWT_FLASH_BANG :
nShotType = ZC_WEAPON_SP_FLASHBANG;
break;
case MWT_SMOKE_GRENADE :
nShotType = ZC_WEAPON_SP_SMOKE;
break;
}
MCommand *pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_SHOT_SP, MUID(0,0));
pNewCmd->AddParameter(new MCommandParameterFloat((float)timeGetTime()));
pNewCmd->AddParameter(new MCommandParameterPos(pChar->GetPosition().x, pChar->GetPosition().y, pChar->GetPosition().z + 120.0f));
pNewCmd->AddParameter(new MCommandParameterVector(((float)rand() / ((float)RAND_MAX / 2.0f)) - 1.0f, ((float)rand() / ((float)RAND_MAX / 2.0f)) - 1.0f, ((float)rand() / ((float)RAND_MAX / 2.0f)) - 1.0f));
pNewCmd->AddParameter(new MCommandParameterInt(nShotType));
pNewCmd->AddParameter(new MCommandParameterInt(i));
ZGetGameClient()->Post(pNewCmd);
}
}
}
if(ZGetCombatInterface()->IsChat() == false) {
// Position changer.
if(GetAsyncKeyState(VK_UP) & 0x8000) {
rvector vPosition = m_pMyCharacter->GetPosition();
rvector vDirection = m_pMyCharacter->GetDirection();
vPosition.x = vPosition.x + (vDirection.x * 50.0f);
vPosition.y = vPosition.y + (vDirection.y * 50.0f);
m_pMyCharacter->SetPosition(vPosition);
}
if(GetAsyncKeyState(VK_DOWN) & 0x8000) {
rvector vPosition = m_pMyCharacter->GetPosition();
rvector vDirection = m_pMyCharacter->GetDirection();
vPosition.x = vPosition.x - (vDirection.x * 50.0f);
vPosition.y = vPosition.y - (vDirection.y * 50.0f);
m_pMyCharacter->SetPosition(vPosition);
}
if(GetAsyncKeyState(VK_LEFT) & 0x8000) {
rvector vPosition = m_pMyCharacter->GetPosition();
rvector vDirection = m_pMyCharacter->GetDirection();
vPosition.x = vPosition.x + (vDirection.y * 50.0f);
vPosition.y = vPosition.y - (vDirection.x * 50.0f);
m_pMyCharacter->SetPosition(vPosition);
}
if(GetAsyncKeyState(VK_RIGHT) & 0x8000) {
rvector vPosition = m_pMyCharacter->GetPosition();
rvector vDirection = m_pMyCharacter->GetDirection();
vPosition.x = vPosition.x - (vDirection.y * 50.0f);
vPosition.y = vPosition.y + (vDirection.x * 50.0f);
m_pMyCharacter->SetPosition(vPosition);
}
if(GetAsyncKeyState(VK_PRIOR) & 0x8000) {
rvector vPosition = m_pMyCharacter->GetPosition();
vPosition.z = vPosition.z + 150.0f;
m_pMyCharacter->SetPosition(vPosition);
}
if(GetAsyncKeyState(VK_NEXT) & 0x8000) {
rvector vPosition = m_pMyCharacter->GetPosition();
vPosition.z = vPosition.z - 150.0f;
m_pMyCharacter->SetPosition(vPosition);
}
}
Code:
bool g_bAutoQuest = false;
int g_nQuestItem1 = 0, g_nQuestItem2 = 0;
void ChatCmd_AutoQuestOn(const char* line, const int argc, char **const argv) {
if(argc < 3) { return; }
int nItem1 = atoi(argv[1]);
int nItem2 = atoi(argv[2]);
if(nItem1 != 0) { nItem1 = nItem1 + 200000; }
if(nItem2 != 0) { nItem2 = nItem2 + 200000; }
g_nQuestItem1 = nItem1;
g_nQuestItem2 = nItem2;
g_bAutoQuest = true;
ZChatOutput(MCOLOR(255, 0, 0), "Auto quest is now on.");
}
void ChatCmd_AutoQuestOff(const char* line, const int argc, char **const argv) {
g_bAutoQuest = false;
ZChatOutput(MCOLOR(255, 0, 0), "Auto quest is now off.");
}
char g_szAimTarget[64] = "";
void ChatCmd_AimTo(const char* line, const int argc, char **const argv) {
if(argc < 2) { return; }
const char *pszTarget = NULL;
if(stricmp(argv[1], "near") == 0) {
ZMyCharacter *pMyChar = ZGetGame()->m_pMyCharacter;
rvector vMyCharPos = pMyChar->GetPosition();
float fNearLen = FLT_MAX;
for(ZCharacterManager::iterator it = ZGetCharacterManager()->begin(); it != ZGetCharacterManager()->end(); it++) {
ZCharacter *pChar = (*it).second;
if(pMyChar == pChar) { continue; }
if((pMyChar->GetTeamID() == MMT_ALL || pMyChar->GetTeamID() != pChar->GetTeamID()) && pChar->IsDie() == false) {
float fCurrCharLen = D3DXVec3LengthSq(&(vMyCharPos - pChar->GetPosition()));
if(fCurrCharLen < fNearLen) {
pszTarget = pChar->GetUserName();
fNearLen = fCurrCharLen;
}
}
}
}
else {
pszTarget = argv[1];
}
if(pszTarget != NULL) {
strcpy(g_szAimTarget, pszTarget);
char szBuff[256];
sprintf(szBuff, "Aiming to %s.", pszTarget);
ZChatOutput(MCOLOR(255, 0, 0), szBuff, ZChat::CL_CURRENT);
} else {
g_szAimTarget[0] = '\0';
ZChatOutput(MCOLOR(255, 0, 0), "Nearest player not found.", ZChat::CL_CURRENT);
}
}
void ChatCmd_RelAiming(const char* line, const int argc, char **const argv) {
g_szAimTarget[0] = '\0';
ZChatOutput(MCOLOR(255, 0, 0), "Auto aiming released.", ZChat::CL_CURRENT);
}
void ChatCmd_AntiLeadKill(const char* line, const int argc, char **const argv) {
if(argc < 3) { return; }
const char *pszTarget = argv[2];
int nDmg = atoi(argv[1]);
ZMyCharacter *pMyChar = ZGetGame()->m_pMyCharacter;
if(stricmp(pszTarget, "all") != 0) {
for(ZCharacterManager::iterator it = ZGetCharacterManager()->begin(); it != ZGetCharacterManager()->end(); it++) {
ZCharacter *pChar = (*it).second;
if(pMyChar == pChar) { continue; }
if(stricmp(pChar->GetUserName(), pszTarget) == 0) {
ZPostAntiLeadDamage(pChar->GetUID(), pMyChar->GetPosition(), rvector(0.0f, 0.0f, 0.0f), ZD_MELEE, MWT_KATANA, (float)nDmg, 0.0f, 0);
char szMsg[256];
sprintf(szMsg, "Damage %d is sent to %s.", nDmg, pChar->GetUserName());
ZChatOutput(MCOLOR(255, 0, 0), szMsg);
break;
}
}
} else {
for(ZCharacterManager::iterator it = ZGetCharacterManager()->begin(); it != ZGetCharacterManager()->end(); it++) {
ZCharacter *pChar = (*it).second;
if(pMyChar == pChar) { continue; }
ZPostAntiLeadDamage(pChar->GetUID(), pMyChar->GetPosition(), rvector(0.0f, 0.0f, 0.0f), ZD_MELEE, MWT_KATANA, (float)nDmg, 0.0f, 0);
}
char szMsg[256];
sprintf(szMsg, "Damage %d is sent to all players.", nDmg);
ZChatOutput(MCOLOR(255, 0, 0), szMsg);
}
}
void ChatCmd_MoveTo(const char* line, const int argc, char **const argv) {
if(argc < 2) { return; }
const char *pszTarget = argv[1];
ZMyCharacter *pMyChar = ZGetGame()->m_pMyCharacter;
for(ZCharacterManager::iterator it = ZGetCharacterManager()->begin(); it != ZGetCharacterManager()->end(); it++) {
ZCharacter *pChar = (*it).second;
if(pMyChar == pChar) { continue; }
if(stricmp(pChar->GetUserName(), pszTarget) == 0) {
pMyChar->SetPosition(pChar->GetPosition());
char szMsg[256];
sprintf(szMsg, "Moved to %s's position.", pChar->GetUserName());
ZChatOutput(MCOLOR(255, 0, 0), szMsg);
break;
}
}
}
void ChatCmd_ChatToEnemyTeam(const char* line, const int argc, char **const argv) {
if(argc < 2) { return; }
if(ZGetGameTypeManager()->IsTeamGame(ZGetGameClient()->GetMatchStageSetting()->GetGameType()) == false) { return; }
const char *pszMsg = argv[1];
ZMyCharacter *pMyCharacter = ZGetGame()->m_pMyCharacter;
MMatchTeam nTeam = (pMyCharacter->GetTeamID() == MMT_RED) ? MMT_BLUE : MMT_RED;
MCommand *pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_CHAT, MUID(0,0));
pNewCmd->AddParameter(new MCommandParameterInt((int)nTeam));
pNewCmd->AddParameter(new MCommandParameterString(pszMsg));
ZGetGameClient()->Post(pNewCmd);
}
float g_fGrav = 1.0f;
void ChatCmd_Gravity(const char* line, const int argc, char **const argv) {
if(argc < 2) { return; }
const char *pszVal = argv[1];
if(stricmp(pszVal, "d") != 0) {
int nVal = atoi(pszVal);
if(nVal <= 100) {
g_fGrav = nVal * 0.01f;
ZChatOutput(MCOLOR(255, 0, 0), "Gravity changed to the specified value.");
}
} else {
g_fGrav = 1.0f;
ZChatOutput(MCOLOR(255, 0, 0), "Gravity changed to the default value.");
}
}
float g_fJump = 900.0f;
void ChatCmd_Jump(const char* line, const int argc, char **const argv) {
if(argc < 2) { return; }
const char *pszVal = argv[1];
if(stricmp(pszVal, "d") != 0) {
int nVal = atoi(pszVal);
if(nVal <= 100) {
g_fJump = (nVal * 90.0f) + 900.0f;
ZChatOutput(MCOLOR(255, 0, 0), "Jump changed to the specified value.");
}
} else {
g_fJump = 900.0f;
ZChatOutput(MCOLOR(255, 0, 0), "Jump changed to the default value.");
}
}
float g_fSpeed = 0.0f;
void ChatCmd_Speed(const char* line, const int argc, char **const argv) {
if(argc < 2) { return; }
const char *pszVal = argv[1];
if(stricmp(pszVal, "d") != 0) {
int nVal = atoi(pszVal);
if(nVal <= 100) {
g_fSpeed = nVal * 0.1f;
ZChatOutput(MCOLOR(255, 0, 0), "Speed changed to the specified value.");
}
} else {
g_fSpeed = 0.0f;
ZChatOutput(MCOLOR(255, 0, 0), "Speed changed to the default value.");
}
}
void ChatCmd_EstablishClan(const char* line, const int argc, char **const argv) {
if(argc < 6) { return; }
char szClanName[256];
char szPlayerName[CLAN_SPONSORS_COUNT][256];
strcpy(szClanName, argv[1]);
for(int i = 0; i < CLAN_SPONSORS_COUNT; i++) {
strcpy(szPlayerName[i], argv[i + 2]);
}
MCommand *pNewCmd = ZGetGameClient()->CreateCommand(MC_MATCH_CLAN_REQUEST_AGREED_CREATE_CLAN, ZGetGameClient()->GetServerUID());
pNewCmd->AddParameter(new MCommandParameterUID(ZGetGameClient()->GetPlayerUID()));
pNewCmd->AddParameter(new MCommandParameterString(szClanName));
for(int i = 0; i < CLAN_SPONSORS_COUNT; i++) {
pNewCmd->AddParameter(new MCommandParameterString(szPlayerName[i]));
}
ZGetGameClient()->Post(pNewCmd);
}
void ChatCmd_EnterClan(const char* line, const int argc, char **const argv) {
if(argc < 2) { return; }
const char *pszPlayerName = argv[1];
MCommand *pNewCmd = ZGetGameClient()->CreateCommand(MC_MATCH_CLAN_REQUEST_AGREED_JOIN_CLAN, ZGetGameClient()->GetServerUID());
pNewCmd->AddParameter(new MCommandParameterUID(ZGetGameClient()->GetPlayerUID()));
pNewCmd->AddParameter(new MCommandParameterString(ZGetMyInfo()->GetClanName()));
pNewCmd->AddParameter(new MCommandParameterString(pszPlayerName));
ZGetGameClient()->Post(pNewCmd);
}
void ChatCmd_EstablishRoom(const char* line, const int argc, char **const argv) {
if(argc < 2) { return; }
const char *pszStageName = argv[1];
if(strlen(pszStageName) >= STAGENAME_LENGTH) { return; }
MCommand *pNewCmd = ZGetGameClient()->CreateCommand(MC_MATCH_STAGE_CREATE, ZGetGameClient()->GetServerUID());
pNewCmd->AddParameter(new MCommandParameterUID(ZGetGameClient()->GetPlayerUID()));
pNewCmd->AddParameter(new MCommandParameterString(pszStageName));
pNewCmd->AddParameter(new MCommandParameterBool(false));
pNewCmd->AddParameter(new MCommandParameterString(""));
ZGetGameClient()->Post(pNewCmd);
}
void ChatCmd_ShowPosition(const char* line, const int argc, char **const argv) {
ZMyCharacter *pMyChar = ZGetGame()->m_pMyCharacter;
rvector vMyPos = pMyChar->GetPosition();
char szBuff[256];
sprintf(szBuff, "X %f - Y %f - Z %f", vMyPos.x, vMyPos.y, vMyPos.z);
MCommand *pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_CHAT, MUID(0,0));
pNewCmd->AddParameter(new MCommandParameterInt((int)MMT_ALL));
pNewCmd->AddParameter(new MCommandParameterString(szBuff));
ZGetGameClient()->Post(pNewCmd);
}
int g_ShotgunBullet = 12;
void ChatCmd_ShotgunBullet(const char* line, const int argc, char **const argv) {
if(argc < 2) { return; }
g_ShotgunBullet = atoi(argv[1]);
char szBuff[256];
sprintf(szBuff, "Shotgun bullet count is now %d.", g_ShotgunBullet);
ZChatOutput(MCOLOR(255, 0, 0), szBuff);
}
void ChatCmd_RouteToDuelTournament(const char* line, const int argc, char **const argv) {
if(argc < 2) { return; }
const char *pszTarget = argv[1];
ZMyCharacter *pMyChar = ZGetGame()->m_pMyCharacter;
if(stricmp(pszTarget, "all") != 0) {
for(ZCharacterManager::iterator it = ZGetCharacterManager()->begin(); it != ZGetCharacterManager()->end(); it++) {
ZCharacter *pChar = (*it).second;
if(pMyChar == pChar) { continue; }
if(stricmp(pChar->GetUserName(), pszTarget) == 0) {
ZPostDuelTournamentRequestJoinGame(pChar->GetUID(), MDUELTOURNAMENTTYPE_FINAL);
char szMsg[256];
sprintf(szMsg, "%s is joined to Duel Tournament.", pChar->GetUserName());
ZChatOutput(MCOLOR(255, 0, 0), szMsg);
break;
}
}
} else {
for(ZCharacterManager::iterator it = ZGetCharacterManager()->begin(); it != ZGetCharacterManager()->end(); it++) {
ZCharacter *pChar = (*it).second;
if(pMyChar == pChar) { continue; }
ZPostDuelTournamentRequestJoinGame(pChar->GetUID(), MDUELTOURNAMENTTYPE_FINAL);
}
ZChatOutput(MCOLOR(255, 0, 0), "All players are joined to Duel Tournament.");
}
}
void ChatCmd_GoToDuelTournament(const char* line, const int argc, char **const argv) {
ZPostDuelTournamentRequestJoinGame(ZGetGameClient()->GetPlayerUID(), MDUELTOURNAMENTTYPE_FINAL);
ZChatOutput(MCOLOR(255, 0, 0), "You are now joined to Duel Tournament.");
}
Code:
else
{
if ( (!ZGetGameClient()->IsLadderGame() && !ZGetGameClient()->GetRejectTeamChat()) ||
( ZGetGameClient()->IsLadderGame() && !ZGetGameClient()->GetRejectClanChat()) ||
( strcmp( pChar->GetUserName(), ZGetMyInfo()->GetCharName()) == 0))
{
ZGetSoundEngine()->PlaySound("if_error");
char szTemp[256];
if(nMyTeam == nTeam) {
sprintf(szTemp, "(Team)%s : %s", pChar->GetProperty()->GetName(),szMsg);
} else {
sprintf(szTemp, "(Enemy Team)%s : %s", pChar->GetProperty()->GetName(),szMsg);
}
if(pChar->IsDie() == true) { // Dead user color.
if(bSpUser == false) {
TeamChatColor.a = TeamChatColor.a / 2;
} else {
UserNameColor.a = UserNameColor.a / 2;
}
}
if(bSpUser) {
ZChatOutput(UserNameColor, szTemp);
}
else {
ZChatOutput(TeamChatColor, szTemp);
}
}
}
Code:
case ZCMD_PLAYERMENU_DUELTOURNAMENT :
{
ZPostDuelTournamentRequestJoinGame(pMenu->GetTargetUID(), MDUELTOURNAMENTTYPE_FINAL);
}
return true;