Advertisement
RyanCordell

ACSF_GetWeapon butchery

Mar 5th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.85 KB | None | 0 0
  1.         case ACSF_GetWeapon:
  2.         {
  3.             // [RC] GetWeapon
  4.             enum
  5.             {
  6.                 GWF_GETTAG = 1,
  7.             };
  8.  
  9.             int flags = argCount >= 1 && args[0] ? args[0] : 0;
  10.  
  11.             AWeapon *weapon = activator->player->ReadyWeapon;
  12.  
  13.             if (activator == NULL || activator->player == NULL || // Non-players do not have weapons
  14.                 activator->player->ReadyWeapon == NULL)
  15.             {
  16.                 return GlobalACSStrings.AddString("None", stack, stackdepth);
  17.             }
  18.             else
  19.             {
  20.                 if (argCount >= 1 && flags & GWF_GETTAG)
  21.                 {
  22.                     return GlobalACSStrings.AddString((weapon->Tag == NULL) ? weapon->GetClass()->TypeName.GetChars() : weapon->Tag->GetChars(), stack, stackdepth);
  23.                 }
  24.                 else
  25.                 {
  26.                     return GlobalACSStrings.AddString(weapon->GetClass()->TypeName.GetChars(), stack, stackdepth);
  27.                 }
  28.             }
  29.         }
  30.         break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement