Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: C++  |  size: 0.64 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. void DoNoUpgradeSwitch(int ClientID, CGameContext* pGameServer, char* aUpgrade)
  2. {
  3.     if(!pGameServer->m_apPlayers[ClientID]->AccountData.m_LoggedIn)
  4.     {
  5.         pGameServer->SendChatTarget(ClientID, "You are not logged in!");
  6.         return;
  7.     }
  8.  
  9.     char aBuf[512];
  10.     if(!*pSwitcher)
  11.     {
  12.         *pSwitcher = true;
  13.         str_format(aBuf, sizeof(aBuf), "%s activated!", aUpgrade);
  14.         pGameServer->SendChatTarget(ClientID, aBuf);
  15.     }
  16.     else if(*pSwitcher)
  17.     {
  18.         *pSwitcher = false;
  19.         str_format(aBuf, sizeof(aBuf), "%s deactivated!", aUpgrade);
  20.         pGameServer->SendChatTarget(ClientID, aBuf);
  21.     }
  22. }