TShelby

Pvp command

Oct 12th, 2018
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.00 KB | None | 0 0
  1. ACMD(do_pvp)
  2. {
  3.     if (ch->GetArena() != NULL || CArenaManager::instance().IsArenaMap(ch->GetMapIndex()) == true)
  4.     {
  5.         ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't use this in the arena."));
  6.         return;
  7.     }
  8.  
  9. #ifdef ENABLE_DUEL_OPTIONS
  10.     char arg1[256], arg2[256];
  11.     two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
  12.  
  13.     DWORD vid = 0;
  14.     BYTE bIsSpecial = 0;
  15.     str_to_number(vid, arg1);
  16.     str_to_number(bIsSpecial, arg2);
  17. #else
  18.     char arg1[256];
  19.     one_argument(argument, arg1, sizeof(arg1));
  20.  
  21.     DWORD vid = 0;
  22.     str_to_number(vid, arg1);
  23. #endif
  24.    
  25.     LPCHARACTER pkVictim = CHARACTER_MANAGER::instance().Find(vid);
  26.  
  27.     if (!pkVictim)
  28.         return;
  29.  
  30.     if (pkVictim->IsNPC())
  31.         return;
  32.  
  33.     if (pkVictim->GetArena() != NULL)
  34.     {
  35.         pkVictim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't use this in the arena."));
  36.         return;
  37.     }
  38.    
  39. #ifdef ENABLE_DUEL_OPTIONS
  40.     CPVPManager::instance().Insert(ch, pkVictim, bIsSpecial ? true : false);
  41. #else
  42.     CPVPManager::instance().Insert(ch, pkVictim);
  43. #endif
  44. }
Advertisement
Add Comment
Please, Sign In to add comment