• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Release] God Mode Aura and Fix Vehicle Hits

Joined
Apr 2, 2013
Messages
1,098
Reaction score
4,625



Simple fix to vehicle hits while with god mode enabled and aura for god mode command







WarZ_Server.sln

Search for:

PHP:
if(strncmp(cmd, "/god", 4) == 0 && plr->profile_.ProfileData.isDevAccount & wiUserProfile::DAA_GOD)
{
    plr->m_isAdmin_GodMode = true; // once turned on, you cannot disable it (to prevent abuse)
    return 0;
}

Change to:

PHP:
if(strncmp(cmd, "/god", 4) == 0 && plr->profile_.ProfileData.isDevAccount & wiUserProfile::DAA_GOD) // By Yuri-BR
{
    plr->m_isAdmin_GodMode = !plr->m_isAdmin_GodMode; // once turned on, you cannot disable it (to prevent abuse)
   
    PKT_C2C_ChatMessage_s n2;
    n2.msgChannel = 1;
    n2.userFlag   = 2;
    r3dscpy(n2.gamertag, "<SYSTEM>");
    r3dscpy(n2.msg, plr->m_isAdmin_GodMode ? "GodMode ON" : "God Mode OFF");
    p2pSendToPeer(plr->peerId_, plr, &n2, sizeof(n2));
   
    PKT_S2C_GodMode_s n;
    n.isGodModeOn = plr->m_isAdmin_GodMode;
    p2pBroadcastToActive(plr, &n, sizeof(n));
   
    return 0;
}

WarZ.sln

Search for:

PHP:
PKT_S2C_MoveTeleport,

Add:

PHP:
PKT_S2C_GodMode,// By Yuri-BR

Search for:

PHP:
struct PKT_S2C_MoveTeleport_s : public DefaultPacketMixin<PKT_S2C_MoveTeleport>
{
    ...
};

Add:

PHP:
struct PKT_S2C_GodMode_s : public DefaultPacketMixin<PKT_S2C_GodMode>// By Yuri-BR
{
    bool    isGodModeOn;
};


Search for:

PHP:
, isFlashlightOn(true)

Add:

PHP:
, m_isAdmin_GodMode(false)// By Yuri-BR


Search for:

PHP:
if(r3dGetTime() < m_SpawnProtectedUntil && m_AuraType != AT_SPAWNPROTECTION)
    m_AuraType = AT_SPAWNPROTECTION;
else if(r3dGetTime() > m_SpawnProtectedUntil && m_AuraType == AT_SPAWNPROTECTION)
    m_AuraType = AT_NONE;

Change to:

PHP:
bool isSpawnProtect = r3dGetTime() < m_SpawnProtectedUntil; // By Yuri-BR
if(isSpawnProtect)// By Yuri-BR
{
    if(m_isAdmin_GodMode)
        m_AuraType = AT_GODMODE;
    else
        m_AuraType = AT_SPAWNPROTECTION;
}
else
{
    if(m_isAdmin_GodMode)
        m_AuraType = AT_GODMODE;
    else
        m_AuraType = AT_NONE;
}


Search for:

PHP:
void obj_Player::OnNetPacket(const PKT_S2C_MoveTeleport_s& n)
{
    ...
}

Add:

PHP:
void obj_Player::OnNetPacket(const PKT_S2C_GodMode_s& n)// By Yuri-BR
{
    m_isAdmin_GodMode = n.isGodModeOn;
}

Search for:

PHP:
DEFINE_GAMEOBJ_PACKET_HANDLER(PKT_S2C_MoveTeleport);

Add:

PHP:
DEFINE_GAMEOBJ_PACKET_HANDLER(PKT_S2C_GodMode);// By Yuri-BR

Search for:

PHP:
else if(This->PlayerAuraType == obj_Player::AT_SPAWNPROTECTION) // golden color
{
    r = 1.0f ;
    g = 0.62f ;
    b = 0.15f ;
}

Add:

PHP:
else if(This->PlayerAuraType == obj_Player::AT_GODMODE)// By Yuri-BR
{
    r = 1.0f ;
    g = 0.0f ;
    b = 0.0f ;
}

Search for:

PHP:
if (distance > 10.0f || vehicleSpeed < 8.0f || isHitByVehicle || (this->GroupID != 0 && this->GroupID == gClientLogic().localPlayer_->GroupID) || m_AuraType == AT_SPAWNPROTECTION || CurLoadout.Health == 0)

Add:

PHP:
if (distance > 10.0f || vehicleSpeed < 8.0f || isHitByVehicle || (this->GroupID != 0 && this->GroupID == gClientLogic().localPlayer_->GroupID) || m_AuraType == AT_SPAWNPROTECTION || CurLoadout.Health == 0 || m_isAdmin_GodMode) // fix vehicle hits the player with god mode by Yuri-BR

Search for:

PHP:
AT_SPAWNPROTECTION,

Add:

PHP:
AT_GODMODE,// By Yuri-BR

Search for:

PHP:
float m_AuraTransarency;

Add:

PHP:
bool        m_isAdmin_GodMode;// By Yuri-BR

Search for:

PHP:
void             OnNetPacket(const PKT_S2C_MoveTeleport_s& n);

Add:

PHP:
void             OnNetPacket(const PKT_S2C_GodMode_s& n);// By Yuri-BR
Example of how to use: /god
 
Last edited:
Back
Top