void CGameContext::ConUnFreeze(IConsole::IResult *pResult, void *pUserData) { if(!CheckRights(pResult->m_ClientID, pResult->GetVictim(), (CGameContext *)pUserData)) return; CGameContext *pSelf = (CGameContext *)pUserData; int Victim = pResult->GetVictim(); static bool Warning = false; char aBuf[128]; CCharacter* pChr = pSelf->GetPlayerChar(Victim); if(!pChr) return; if(pChr->m_DeepFreeze && !Warning) { pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "warning", "This client is deeply frozen, repeat the command to defrost him."); Warning = true; return; } if(pChr->m_DeepFreeze && Warning) { pChr->m_DeepFreeze = false; Warning = false; } pChr->m_FreezeTime = 2; pChr->GetPlayer()->m_RconFreeze = false; CServer* pServ = (CServer*)pSelf->Server(); str_format(aBuf, sizeof(aBuf), "'%s' ClientID=%d has been defrosted.", pServ->ClientName(Victim), Victim); pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info", aBuf); }
void CGameContext::ConRename(IConsole::IResult *pResult, void *pUserData) { if(!CheckRights(pResult->m_ClientID, pResult->GetVictim(), (CGameContext *)pUserData)) return; const char *newName = pResult->GetString(0); CGameContext *pSelf = (CGameContext *)pUserData; int Victim = pResult->GetVictim(); CPlayer *pPlayer = pSelf->m_apPlayers[Victim]; if(!pPlayer) return; CCharacter* pChr = pSelf->m_apPlayers[Victim]->GetCharacter(); if(!pChr) return; //change name char oldName[MAX_NAME_LENGTH]; str_copy(oldName, pSelf->Server()->ClientName(Victim), MAX_NAME_LENGTH); pSelf->Server()->SetClientName(Victim, newName); char aBuf[256]; str_format(aBuf, sizeof(aBuf), "%s has changed %s's name to '%s'", pSelf->Server()->ClientName(pResult->m_ClientID), oldName, pSelf->Server()->ClientName(Victim)); pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info", aBuf); str_format(aBuf, sizeof(aBuf), "%s changed your name to %s.", pSelf->Server()->ClientName(pResult->m_ClientID), pSelf->Server()->ClientName(Victim)); pSelf->SendChatTarget(Victim, aBuf); }
ServoTitleInfo::ServoTitleInfo(bool new_mode, QWidget *parent) : QWidget(parent), ui(new Ui::ServoTitleInfo), mNewMode( new_mode ) { ui->setupUi(this); // foreach ( examinee::Device const* device, test::servo::Parameters::Instance().TestCollection().Devices().Get() ) // { // ui->GsType->addItem( device->Name() + " " + device->Manufacturer(), QVariant::fromValue( device ) ); // } ui->PressureNominal->setValidator( new QIntValidator( 10, 315, this ) ); ui->MaxExpenditure->setValidator( new QIntValidator( 1, 660, this ) ); ui->MaxExpenditureA->setValidator( new QIntValidator( -660, 660, this ) ); ui->MaxExpenditureB->setValidator( new QIntValidator( -660, 660, this ) ); ui->ControlReelResist->setValidator( new QDoubleValidator( INT32_MIN, INT32_MAX , 2, this ) ); on_RaspredControl_activated( ui->RaspredControl->currentIndex() ); on_ControlType_activated( ui->ControlType->currentIndex() ); on_PosCount_valueChanged( ui->PosCount->value() ); if ( !mNewMode ) FromParams(); CheckRights(); }
void CGameContext::ConFastReload(IConsole::IResult *pResult, void *pUserData) { if(!CheckRights(pResult->m_ClientID, pResult->GetVictim(), (CGameContext *)pUserData)) return; CGameContext *pSelf = (CGameContext *)pUserData; int Victim = pResult->GetVictim(); CPlayer *pPlayer = pSelf->m_apPlayers[Victim]; if(!pPlayer) return; CCharacter* pChr = pSelf->m_apPlayers[Victim]->GetCharacter(); if(!pChr) return; char aBuf[128]; if (!pChr->m_FastReload) { pChr->m_ReloadMultiplier = 10000; pChr->m_FastReload = true; str_format(aBuf, sizeof(aBuf), "You got XXL by %s.", pSelf->Server()->ClientName(pResult->m_ClientID)); pSelf->SendChatTarget(Victim, aBuf); } else { pChr->m_ReloadMultiplier = 1000; pChr->m_FastReload = false; str_format(aBuf, sizeof(aBuf), "%s removed your XXL.", pSelf->Server()->ClientName(pResult->m_ClientID)); pSelf->SendChatTarget(Victim, aBuf); } pChr->m_DDRaceState = DDRACE_CHEAT; }
StandParams::StandParams(bool new_mode, QWidget *parent) : QWidget(parent), ui(new Ui::StandParams), mNewMode( new_mode ) { ui->setupUi(this); if ( test::hydro::Parameters::Instance().PosCount() < 3 ) { ui->l_tr->setVisible( false ); ui->DD1B_ON->setVisible( false ); ui->DD2B_ON->setVisible( false ); ui->DD3B_ON->setVisible( false ); ui->OnDynamic_2->setVisible( false ); ui->l_br->setVisible( false ); ui->DD1B_OFF->setVisible( false ); ui->DD2B_OFF->setVisible( false ); ui->DD3B_OFF->setVisible( false ); ui->OffDynamic_2->setVisible( false ); } if (!mNewMode) FromParams(); CheckRights(); }
void CGameContext::ConScore(IConsole::IResult *pResult, void *pUserData) { if(!CheckRights(pResult->m_ClientID, pResult->GetVictim(), (CGameContext *)pUserData)) return; int Victim = pResult->GetVictim(); int Score = clamp(pResult->GetInteger(0), -9999, 9999); CGameContext *pSelf = (CGameContext *)pUserData; CPlayer *pPlayer = pSelf->m_apPlayers[Victim]; if(!pPlayer) return; if (!g_Config.m_SvRconScore) { pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info", "You can't set a score, if sv_rcon_score is not enabled."); return; } CCharacter* pChr = pSelf->m_apPlayers[Victim]->GetCharacter();; if(!pChr) return; pSelf->m_apPlayers[Victim]->m_Score = Score; char aBuf[256]; str_format(aBuf, sizeof(aBuf), "%s set score of %s to %i" ,pSelf->Server()->ClientName(pResult->m_ClientID),pSelf->Server()->ClientName(Victim), Score); pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info", aBuf); str_format(aBuf, sizeof(aBuf), "%s set your to %i.", pSelf->Server()->ClientName(pResult->m_ClientID), Score); pSelf->SendChatTarget(Victim, aBuf); }
void CGameContext::ConBlood(IConsole::IResult *pResult, void *pUserData) { if(!CheckRights(pResult->m_ClientID, pResult->GetVictim(), (CGameContext *)pUserData)) return; int Victim = pResult->GetVictim(); CGameContext *pSelf = (CGameContext *)pUserData; CPlayer *pPlayer = pSelf->m_apPlayers[Victim]; if(!pPlayer) return; CCharacter* pChr = pSelf->m_apPlayers[Victim]->GetCharacter();; if(!pChr) return; char aBuf[128]; if (!pChr->m_Bloody) { pChr->m_Bloody = true; str_format(aBuf, sizeof(aBuf), "You got bloody by %s.", pSelf->Server()->ClientName(pResult->m_ClientID)); pSelf->SendChatTarget(Victim, aBuf); } else { pChr->m_Bloody = false; str_format(aBuf, sizeof(aBuf), "%s removed your blood.", pSelf->Server()->ClientName(pResult->m_ClientID)); pSelf->SendChatTarget(Victim, aBuf); } }
//Restored void CGameContext::ConHammer(IConsole::IResult *pResult, void *pUserData) { CGameContext *pSelf = (CGameContext *)pUserData; int Victim = pResult->GetVictim(); if(!CheckRights(pResult->m_ClientID, Victim, (CGameContext *)pUserData)) return; char aBuf[128]; int Type = pResult->GetInteger(0); CPlayer *pPlayer = pSelf->m_apPlayers[Victim]; if(!pPlayer) return; CCharacter* pChr = pSelf->GetPlayerChar(Victim); if(!pChr) return; CServer* pServ = (CServer*)pSelf->Server(); if(Type > 10 || Type < 0) { pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info", "Select hammer between 0 and 10"); } else { pChr->m_HammerType = Type; pChr->m_DDRaceState = DDRACE_CHEAT; str_format(aBuf, sizeof(aBuf), "Hammer of '%s' ClientID=%d setted to %d", pServ->ClientName(Victim), Victim, Type); pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info", aBuf); } }
void CGameContext::ConFreeze(IConsole::IResult *pResult, void *pUserData) { if(!CheckRights(pResult->m_ClientID, pResult->GetVictim(), (CGameContext *)pUserData)) return; CGameContext *pSelf = (CGameContext *)pUserData; int Seconds = -1; int Victim = pResult->GetVictim(); char aBuf[128]; if(pResult->NumArguments() == 1) Seconds = clamp(pResult->GetInteger(0), -2, 9999); CCharacter* pChr = pSelf->GetPlayerChar(Victim); if(!pChr) return; if(pSelf->m_apPlayers[Victim]) { pChr->Freeze(Seconds); pChr->GetPlayer()->m_RconFreeze = Seconds != -2; CServer* pServ = (CServer*)pSelf->Server(); if(Seconds >= 0) str_format(aBuf, sizeof(aBuf), "'%s' ClientID=%d has been Frozen for %d.", pServ->ClientName(Victim), Victim, Seconds); else if(Seconds == -2) { pChr->m_DeepFreeze = true; str_format(aBuf, sizeof(aBuf), "'%s' ClientID=%d has been Deep Frozen.", pServ->ClientName(Victim), Victim); } else str_format(aBuf, sizeof(aBuf), "'%s' ClientID=%d is Frozen until you unfreeze him.", pServ->ClientName(Victim), Victim); pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info", aBuf); } }
void CGameContext::ModifyWeapons(IConsole::IResult *pResult, void *pUserData, int Weapon, bool Remove) { CGameContext *pSelf = (CGameContext *) pUserData; if (!CheckRights(pResult->m_ClientID, pResult->GetVictim(), pSelf)) return; int ClientID = pResult->GetVictim(); if (clamp(Weapon, -1, NUM_WEAPONS - 1) != Weapon) { pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info", "invalid weapon id"); return; } CCharacter* pChr = GetPlayerChar(ClientID); if (!pChr) return; if (Weapon == -1) { if (Remove && (pChr->GetActiveWeapon() == WEAPON_SHOTGUN || pChr->GetActiveWeapon() == WEAPON_GRENADE || pChr->GetActiveWeapon() == WEAPON_RIFLE)) pChr->SetActiveWeapon(WEAPON_GUN); if (Remove) { pChr->SetWeaponGot(WEAPON_SHOTGUN, false); pChr->SetWeaponGot(WEAPON_GRENADE, false); pChr->SetWeaponGot(WEAPON_RIFLE, false); } else pChr->GiveAllWeapons(); } else if (Weapon != WEAPON_NINJA) { if (Remove && pChr->GetActiveWeapon() == Weapon) pChr->SetActiveWeapon(WEAPON_GUN); if (Remove) pChr->SetWeaponGot(Weapon, false); else pChr->GiveWeapon(Weapon, -1); } else { if (Remove) { pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info", "you can't remove ninja"); return; } pChr->GiveNinja(); } pChr->m_DDRaceState = DDRACE_CHEAT; }
void CGameContext::ConSetlvl1(IConsole::IResult *pResult, void *pUserData) { CGameContext *pSelf = (CGameContext *)pUserData; if(!CheckRights(pResult->m_ClientID, pResult->GetVictim(), (CGameContext *)pUserData)) return; int Victim = pResult->GetVictim(); CServer* pServ = (CServer*)pSelf->Server(); if(pSelf->m_apPlayers[Victim] && Victim != pResult->m_ClientID) pServ->SetRconLevel(Victim, pServ->AUTHED_HELPER); }
void CGameContext::ConUnMember(IConsole::IResult *pResult, void *pUserData) { if(!CheckRights(pResult->m_ClientID, pResult->GetVictim(), (CGameContext *)pUserData)) return; CGameContext *pSelf = (CGameContext *)pUserData; int Victim = pResult->GetVictim(); CPlayer *pPlayer = pSelf->m_apPlayers[Victim]; if(!pPlayer) return; pSelf->MemberList->UnMember(Victim, pSelf); }
// mute through client id void CGameContext::ConMuteID(IConsole::IResult *pResult, void *pUserData) { CGameContext *pSelf = (CGameContext *) pUserData; int Victim = pResult->GetVictim(); if (!CheckRights(pResult->m_ClientID, Victim, (CGameContext *)pUserData)) return; NETADDR Addr; pSelf->Server()->GetClientAddr(Victim, &Addr); pSelf->Mute(pResult, &Addr, clamp(pResult->GetInteger(0), 1, 86400), pSelf->Server()->ClientName(Victim)); }
void CGameContext::ConUnSuper(IConsole::IResult *pResult, void *pUserData) { CGameContext *pSelf = (CGameContext *) pUserData; int Victim = pResult->GetVictim(); if (!CheckRights(pResult->m_ClientID, Victim, (CGameContext *)pUserData)) return; CCharacter* pChr = pSelf->GetPlayerChar(Victim); if (pChr && pChr->m_Super) { pChr->m_Super = false; pChr->Teams()->SetForceCharacterTeam(Victim, pChr->m_TeamBeforeSuper); } }
void CGameContext::ConSuper(IConsole::IResult *pResult, void *pUserData) { CGameContext *pSelf = (CGameContext *) pUserData; int Victim = pResult->GetVictim(); if (!CheckRights(pResult->m_ClientID, Victim, (CGameContext *)pUserData)) return; CCharacter* pChr = pSelf->GetPlayerChar(Victim); if (pChr && !pChr->m_Super) { pChr->m_Super = true; pChr->UnFreeze(); pChr->m_TeamBeforeSuper = pChr->Team(); pChr->Teams()->SetCharacterTeam(Victim, TEAM_SUPER); pChr->m_DDRaceState = DDRACE_CHEAT; } }
void CGameContext::ConUnIceHammer(IConsole::IResult *pResult, void *pUserData) { if(!CheckRights(pResult->m_ClientID, pResult->GetVictim(), (CGameContext *)pUserData)) return; CGameContext *pSelf = (CGameContext *)pUserData; int Victim = pResult->GetVictim(); CPlayer *pPlayer = pSelf->m_apPlayers[Victim]; if(!pPlayer) return; CCharacter* pChr = pSelf->m_apPlayers[Victim]->GetCharacter(); if (!pChr) return; pChr->m_IceHammer = false; }
void CGameContext::ConForcePause(IConsole::IResult *pResult, void *pUserData) { CGameContext *pSelf = (CGameContext *)pUserData; CServer* pServ = (CServer*)pSelf->Server(); int Victim = pResult->GetVictim(); if (!CheckRights(pResult->m_ClientID, Victim, (CGameContext *)pUserData)) return; int Seconds = 0; if (pResult->NumArguments() > 0) Seconds = clamp(pResult->GetInteger(0), 0, 360); CPlayer *pPlayer = pSelf->m_apPlayers[Victim]; if (!pPlayer) return; pPlayer->m_ForcePauseTime = Seconds*pServ->TickSpeed(); pPlayer->m_Paused = CPlayer::PAUSED_FORCE; }
void CGameContext::ConSetJumps(IConsole::IResult *pResult, void *pUserData) { if(!CheckRights(pResult->m_ClientID, pResult->GetVictim(), (CGameContext *)pUserData)) return; CGameContext *pSelf = (CGameContext *)pUserData; int Victim = pResult->GetVictim(); CPlayer *pPlayer = pSelf->m_apPlayers[Victim]; if(!pPlayer) return; CCharacter *pChr = pSelf->m_apPlayers[Victim]->GetCharacter(); if (!pChr) return; pChr->Core()->m_MaxJumps = clamp(pResult->GetInteger(0), 0, 9999); pChr->m_DDRaceState = DDRACE_CHEAT; }
void CGameContext::ConVis(IConsole::IResult *pResult, void *pUserData) { if(!CheckRights(pResult->m_ClientID, pResult->GetVictim(), (CGameContext *)pUserData)) return; CGameContext *pSelf = (CGameContext *)pUserData; int Victim = pResult->GetVictim(); if(!pSelf->m_apPlayers[pResult->m_ClientID]) return; char aBuf[128]; if(pSelf->m_apPlayers[Victim]) { pSelf->m_apPlayers[Victim]->m_Invisible = false; CServer* pServ = (CServer*)pSelf->Server(); str_format(aBuf, sizeof(aBuf), "'%s' ClientID=%d is visible.", pServ->ClientName(Victim), Victim); pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info", aBuf); } }
void CGameContext::ConWhisper(IConsole::IResult *pResult, void *pUserData) { if(!CheckRights(pResult->m_ClientID, pResult->GetVictim(), (CGameContext *)pUserData)) return; CGameContext *pSelf = (CGameContext *)pUserData; int Victim = pResult->GetVictim(); CCharacter* pChr = pSelf->m_apPlayers[pResult->m_ClientID]->GetCharacter(); const char *message = pResult->GetString(0); if(!pChr) return; char aBuf[256]; str_format(aBuf, sizeof(aBuf), "%s: %s", pSelf->Server()->ClientName(pResult->m_ClientID), message); pSelf->SendChatTarget(Victim, aBuf); str_format(aBuf, sizeof(aBuf), "-->%s: %s", pSelf->Server()->ClientName(pResult->m_ClientID), message); pSelf->SendChatTarget(pResult->m_ClientID, aBuf); }
// unmute by mute list index void CGameContext::ConUnmute(IConsole::IResult *pResult, void *pUserData) { CGameContext *pSelf = (CGameContext *) pUserData; char aIpBuf[64]; char aBuf[64]; int Victim = pResult->GetVictim(); if (!CheckRights(pResult->m_ClientID, Victim, (CGameContext *)pUserData)) return; if (Victim < 0 || Victim >= pSelf->m_NumMutes) return; pSelf->m_NumMutes--; pSelf->m_aMutes[Victim] = pSelf->m_aMutes[pSelf->m_NumMutes]; net_addr_str(&pSelf->m_aMutes[Victim].m_Addr, aIpBuf, sizeof(aIpBuf), false); str_format(aBuf, sizeof(aBuf), "Unmuted %s", aIpBuf); pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "mutes", aBuf); }
void CGameContext::ConTeleport(IConsole::IResult *pResult, void *pUserData) { CGameContext *pSelf = (CGameContext *) pUserData; int TeleTo = pResult->GetInteger(0); int Tele = pResult->GetVictim(); if (!CheckRights(pResult->m_ClientID, Tele, (CGameContext *)pUserData)) return; if (pSelf->m_apPlayers[TeleTo]) { CCharacter* pChr = pSelf->GetPlayerChar(Tele); if (pChr && pSelf->GetPlayerChar(TeleTo)) { pChr->Core()->m_Pos = pSelf->m_apPlayers[TeleTo]->m_ViewPos; pChr->m_DDRaceState = DDRACE_CHEAT; } } }
ControlPanelsTitleInfo::ControlPanelsTitleInfo(bool new_mode, QWidget *parent) : QWidget(parent), ui(new Ui::ControlPanelsTitleInfo), mNewMode( new_mode ) { ui->setupUi(this); foreach ( examinee::Device const* device, test::control_board::Parameters::Instance().TestCollection().Devices().Get() ) { ui->GsType->addItem( device->Name() + " " + device->Manufacturer(), QVariant::fromValue( device ) ); } ui->GsType->setCurrentIndex( -1 ); ui->Voltage->setValidator( new QDoubleValidator( 1, 40, 2, this ) ); ui->MaxAmperage->setValidator( new QDoubleValidator( 0, 3, 3, this ) ); if ( !mNewMode ) FromParams(); CheckRights(); }
//XXLmod void CGameContext::ConSkin(IConsole::IResult *pResult, void *pUserData) { if(!CheckRights(pResult->m_ClientID, pResult->GetVictim(), (CGameContext *)pUserData)) return; const char *Skin = pResult->GetString(0); CGameContext *pSelf = (CGameContext *)pUserData; int Victim = pResult->GetVictim(); CPlayer *pPlayer = pSelf->m_apPlayers[Victim]; if(!pPlayer) return; CCharacter* pChr = pSelf->m_apPlayers[Victim]->GetCharacter();; if(!pChr) return; //change skin str_copy(pSelf->m_apPlayers[Victim]->m_TeeInfos.m_SkinName, Skin, sizeof(pSelf->m_apPlayers[Victim]->m_TeeInfos.m_SkinName)); char aBuf[256]; str_format(aBuf, sizeof(aBuf), "%s's skin changed to %s" ,pSelf->Server()->ClientName(Victim), Skin); pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info", aBuf); }
void CGameContext::ConLogOut(IConsole::IResult *pResult, void *pUserData) { CGameContext *pSelf = (CGameContext *)pUserData; CServer* pServer = (CServer*)pSelf->Server(); int Victim; if(pResult->NumArguments() == 0) Victim = pResult->m_ClientID; else Victim = pResult->GetInteger(0); if(!CheckRights(pResult->m_ClientID, Victim, (CGameContext *)pUserData)) return; /*if (g_Config.m_SvRconScore) pSelf->m_apPlayers[Victim]->m_Score = 0;*/ // logout from membertile pSelf->m_apPlayers[Victim]->m_IsMember = false; pSelf->m_apPlayers[Victim]->m_IsLoggedIn = false; // DDRace level reset pSelf->OnSetAuthed(Victim, pServer->AUTHED_NO); // from server.cpp if(pServer->m_aClients[Victim].m_State != CServer::CClient::STATE_EMPTY) { CMsgPacker Msg(NETMSG_RCON_AUTH_STATUS); Msg.AddInt(0); //authed Msg.AddInt(0); //cmdlist pServer->SendMsgEx(&Msg, MSGFLAG_VITAL, Victim, true); pServer->m_aClients[Victim].m_Authed = pServer->AUTHED_NO; pServer->m_aClients[Victim].m_pRconCmdToSend = 0; pServer->SendRconLine(Victim, "Logout successful."); char aBuf[32]; str_format(aBuf, sizeof(aBuf), "ClientID=%d logged out", Victim); pServer->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", aBuf); } }
void MainWindow::enable_modes(bool enabled) { ui->act_test_case1->setEnabled( enabled ); ui->act_test_case2->setEnabled( enabled ); ui->act_test_case3->setEnabled( enabled ); ui->act_test_case4->setEnabled( enabled ); ui->ManualControl->setEnabled( enabled ); ui->TestCase1->setEnabled( enabled ); ui->TestCase2->setEnabled( enabled ); ui->TestCase3->setEnabled( enabled ); ui->TestCase4->setEnabled( enabled ); ui->app_settings->setEnabled( enabled ); ui->device_list->setEnabled( enabled ); ui->hydro_list->setEnabled( enabled ); ui->servo_list->setEnabled( enabled ); ui->load_isp_params->setEnabled( enabled ); CheckRights(); }
void CGameContext::ConRainbow(IConsole::IResult *pResult, void *pUserData) { if(!CheckRights(pResult->m_ClientID, pResult->GetVictim(), (CGameContext *)pUserData)) return; CGameContext *pSelf = (CGameContext *)pUserData; int Victim = pResult->GetVictim(); int Rainbowtype = clamp(pResult->GetInteger(0), 0, 2); CPlayer *pPlayer = pSelf->m_apPlayers[Victim]; if(!pPlayer) return; CCharacter* pChr = pSelf->m_apPlayers[Victim]->GetCharacter(); if(!pChr) return; char aBuf[256]; if ((pSelf->m_apPlayers[Victim]->m_Rainbow == RAINBOW_NONE || pSelf->m_apPlayers[Victim]->m_Rainbow == RAINBOW_BLACKWHITE) && Rainbowtype <= 1) { pSelf->m_apPlayers[Victim]->m_Rainbow = RAINBOW_COLOR; str_format(aBuf, sizeof(aBuf), "You got rainbow by %s.", pSelf->Server()->ClientName(pResult->m_ClientID)); pSelf->SendChatTarget(Victim, aBuf); } else if ((pSelf->m_apPlayers[Victim]->m_Rainbow == RAINBOW_NONE || pSelf->m_apPlayers[Victim]->m_Rainbow == RAINBOW_COLOR) && Rainbowtype == 2) { pSelf->m_apPlayers[Victim]->m_Rainbow = RAINBOW_BLACKWHITE; str_format(aBuf, sizeof(aBuf), "You got black and white rainbow by %s.", pSelf->Server()->ClientName(pResult->m_ClientID)); pSelf->SendChatTarget(Victim, aBuf); } else { pSelf->m_apPlayers[Victim]->m_Rainbow = RAINBOW_NONE; str_format(aBuf, sizeof(aBuf), "%s removed your rainbow.", pSelf->Server()->ClientName(pResult->m_ClientID)); pSelf->SendChatTarget(Victim, aBuf); } }
void MainWindow::showEvent( QShowEvent *e ) { CheckRights(); ui->statusBar->showMessage("Текущий пользователь: " + app::Settings::Instance().User() ); QMainWindow::showEvent( e ); }