void CCharacter::DieSpikes(int pPlayerID, int spikes_flag) { int Weapon = 0; if (spikes_flag&CCollision::COLFLAG_SPIKE_NORMAL) Weapon = WEAPON_SPIKE_NORMAL; else if (spikes_flag&CCollision::COLFLAG_SPIKE_RED) Weapon = WEAPON_SPIKE_RED; else if (spikes_flag&CCollision::COLFLAG_SPIKE_BLUE) Weapon = WEAPON_SPIKE_BLUE; else if (spikes_flag&CCollision::COLFLAG_SPIKE_GOLD) Weapon = WEAPON_SPIKE_GOLD; else if (spikes_flag&CCollision::COLFLAG_SPIKE_GREEN) Weapon = WEAPON_SPIKE_GREEN; else if (spikes_flag&CCollision::COLFLAG_SPIKE_PURPLE) Weapon = WEAPON_SPIKE_PURPLE; // if the player leaves the game, he will be nullptr and we handle it like a selfkill if (pPlayerID == -1 || GameServer()->m_apPlayers[pPlayerID] == 0) pPlayerID = m_pPlayer->GetCID(); if (!IsFrozen() || pPlayerID == m_pPlayer->GetCID()) Weapon = WEAPON_WORLD; int ModeSpecial = GameServer()->m_pController->OnCharacterDeath(this, GameServer()->m_apPlayers[pPlayerID], Weapon); //if needed the mod can tell the character to not die with modespecial = -1 if(ModeSpecial >= 0){ char aBuf[256]; str_format(aBuf, sizeof(aBuf), "kill spikes killer='%d:%s' victim='%d:%s' weapon=%d special=%d", pPlayerID, Server()->ClientName(pPlayerID), m_pPlayer->GetCID(), Server()->ClientName(m_pPlayer->GetCID()), Weapon, ModeSpecial); GameServer()->Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "game", aBuf); if (IsFrozen() && pPlayerID != m_pPlayer->GetCID()) { // send the kill message CNetMsg_Sv_KillMsg Msg; Msg.m_Killer = pPlayerID; Msg.m_Victim = m_pPlayer->GetCID(); Msg.m_Weapon = WEAPON_NINJA; Msg.m_ModeSpecial = ModeSpecial; GameServer()->SendPackMsg(&Msg, MSGFLAG_VITAL); int siski = m_pPlayer->GetCID(); GameServer()->Console()->Print(0, "babag", std::to_string(siski).c_str()); GameServer()->Console()->Print(0, "babag2", std::to_string(pPlayerID).c_str()); GameServer()->m_apPlayers[siski]->SetTeam(TEAM_SPECTATORS);