Advertisement
RyanCordell

DRLA - Weapon Ticker

Oct 10th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 8.17 KB | None | 0 0
  1. #define DRLA_WeaponNameID       900
  2. #define DRLA_WeaponNameTrickID  DRLA_WeaponNameID+1
  3.  
  4. #define DRLA_WeaponModID        DRLA_WeaponNameTrickID+1
  5.  
  6. #define DRLA_WeaponNameX        6
  7. #define DRLA_WeaponNameY        0
  8. #define DRLA_WeaponNameWidth    138
  9. #define DRLA_WeaponNameHeight   10
  10.  
  11. #define DRLA_WeaponModX         DRLA_WeaponNameX + 65
  12. #define DRLA_WeaponModY         DRLA_WeaponNameY + 16
  13.  
  14. int extraX;
  15.  
  16. str DRLA_OldWeaponName, DRLA_Weapon_Name_Printer;
  17. str DRLA_OldDualName,   DRLA_Weapon_DualName_Printer;
  18. int DRLA_Weapon_Name_Length;
  19. int DRLA_Screenblocks;
  20.    
  21. SCRIPT "DRLA_WeaponDisplay" ENTER
  22. {
  23.     Delay(2);
  24.     DRLA_OldWeaponName =    StrParam(s:"PDA_WEAPON_", s:StrMid(GetWeapon(),2,StrLen(GetWeapon())), s:"_NAME");
  25.     DRLA_OldDualName =      StrParam(s:"PDA_WEAPON_", s:StrMid(GetWeapon(),2,StrLen(GetWeapon())), s:"DEMONARTIFACTS", s:"_NAME");
  26.  
  27.     int DRLA_Weapon_Bulk_Quantity;
  28.     int DRLA_Weapon_Power_Quantity;
  29.     int DRLA_Weapon_Agility_Quantity;
  30.     int DRLA_Weapon_Technical_Quantity;
  31.     int DRLA_Weapon_Sniper_Quantity;
  32.     int DRLA_Weapon_Firestorm_Quantity;
  33.     int DRLA_Weapon_Nano_Quantity;
  34.     int DRLA_Weapon_Artifact_Quantity;
  35.    
  36.     int x1, x2;
  37.  
  38.     while(true)
  39.     {
  40.         DRLA_Screenblocks = GetCVar ("screenblocks");
  41.         if(DRLA_Screenblocks <= 10 && CheckInventory("DRPGDRLAActive") == 0 && CheckInventory("RLSpecialHUD") == 0)
  42.         {
  43.             if(StrCmp(CheckInventory(GetWeapon()),"None") != 0)
  44.             {
  45.            
  46.                 DRLA_Weapon_Bulk_Quantity =         CheckInventory(StrParam(s:GetWeapon(),s:"BulkMod"));
  47.                 DRLA_Weapon_Power_Quantity =        CheckInventory(StrParam(s:GetWeapon(),s:"PowerMod"));
  48.                 DRLA_Weapon_Agility_Quantity =      CheckInventory(StrParam(s:GetWeapon(),s:"AgilityMod"));
  49.                 DRLA_Weapon_Technical_Quantity =    CheckInventory(StrParam(s:GetWeapon(),s:"TechnicalMod"));
  50.                 DRLA_Weapon_Sniper_Quantity =       CheckInventory(StrParam(s:GetWeapon(),s:"SniperMod"));
  51.                 DRLA_Weapon_Firestorm_Quantity =    CheckInventory(StrParam(s:GetWeapon(),s:"FirestormMod"));
  52.                 DRLA_Weapon_Nano_Quantity =         CheckInventory(StrParam(s:GetWeapon(),s:"NanoMod"));
  53.                 DRLA_Weapon_Artifact_Quantity =     CheckInventory(StrParam(s:GetWeapon(),s:"DemonArtifacts"));
  54.  
  55.                 DRLA_Weapon_Name_Printer =      StrParam(s:"PDA_WEAPON_", s:StrMid(GetWeapon(),2,StrLen(GetWeapon())), s:"_NAME");
  56.                 DRLA_Weapon_DualName_Printer =  StrParam(s:"PDA_WEAPON_", s:StrMid(GetWeapon(),2,StrLen(GetWeapon())), s:"DEMONARTIFACTS", s:"_NAME");
  57.  
  58.                 if(CheckInventory(StrParam(s:GetWeapon(),s:"DemonArtifacts")))
  59.                     DRLA_Weapon_Name_Length =       StrLen(StrParam(l:DRLA_Weapon_DualName_Printer))-7;
  60.                 else
  61.                     DRLA_Weapon_Name_Length =       StrLen(StrParam(l:DRLA_Weapon_Name_Printer))-7;
  62.                
  63.                 x1 = DRLA_WeaponNameX;
  64.                 x2 = -DRLA_WeaponNameWidth - ((DRLA_Weapon_Name_Length*DRLA_Weapon_Name_Length)/5);
  65.  
  66.                 SetHudSize(320,200,0);
  67.                 SetHudClipRect(DRLA_WeaponNameX, DRLA_WeaponNameY, DRLA_WeaponNameWidth, DRLA_WeaponNameHeight);
  68.                 SetFont("STAT_MNO");
  69.  
  70.                 if(CheckInventory(StrParam(s:GetWeapon(),s:"DemonArtifacts")))
  71.                 {
  72.                
  73.                     if(StrCmp(DRLA_OldDualName,DRLA_Weapon_DualName_Printer) != 0)
  74.                     {
  75.                         HudMessage(s:"********************", s:"\c-";   HUDMSG_PLAIN | HUDMSG_NOTWITHFULLMAP | HUDMSG_NOTWITHOVERLAYMAP, DRLA_WeaponNameID,         CR_UNTRANSLATED,    (DRLA_WeaponNameX<<16) + 0.1,               2.1, 0);
  76.                         HudMessage(s:"********************", s:"\c-";   HUDMSG_PLAIN | HUDMSG_NOTWITHFULLMAP | HUDMSG_NOTWITHOVERLAYMAP, DRLA_WeaponNameTrickID,    CR_UNTRANSLATED,    (DRLA_WeaponNameX<<16) + 0.1,               2.1, 0);
  77.                         Delay(5);
  78.                     }
  79.                     HudMessage(l:DRLA_Weapon_DualName_Printer, s:"\c-"; HUDMSG_PLAIN | HUDMSG_NOTWITHFULLMAP | HUDMSG_NOTWITHOVERLAYMAP, DRLA_WeaponNameID,         CR_UNTRANSLATED,    (extraX<<16) + (x1<<16) + 0.1,              2.1, 0);
  80.  
  81.                     // This helps pull off the illusion that it's 'wrapping' around in one line
  82.                     HudMessage(l:DRLA_Weapon_DualName_Printer, s:"\c-"; HUDMSG_PLAIN | HUDMSG_NOTWITHFULLMAP | HUDMSG_NOTWITHOVERLAYMAP, DRLA_WeaponNameTrickID,    CR_UNTRANSLATED,    (extraX<<16) + (x1<<16) + (x2<<16) + 0.1,   2.1, 0);
  83.                 }
  84.                 else
  85.                 {
  86.                     if(StrCmp(DRLA_OldWeaponName,DRLA_Weapon_Name_Printer) != 0)
  87.                     {
  88.                         HudMessage(s:"********************", s:"\c-";   HUDMSG_PLAIN | HUDMSG_NOTWITHFULLMAP | HUDMSG_NOTWITHOVERLAYMAP, DRLA_WeaponNameID,         CR_UNTRANSLATED,    (DRLA_WeaponNameX<<16) + 0.1,               2.1, 0);
  89.                         HudMessage(s:"********************", s:"\c-";   HUDMSG_PLAIN | HUDMSG_NOTWITHFULLMAP | HUDMSG_NOTWITHOVERLAYMAP, DRLA_WeaponNameTrickID,    CR_UNTRANSLATED,    (DRLA_WeaponNameX<<16) + 0.1,               2.1, 0);
  90.                         Delay(5);
  91.                     }
  92.                     HudMessage(l:DRLA_Weapon_Name_Printer, s:"\c-";     HUDMSG_PLAIN | HUDMSG_NOTWITHFULLMAP | HUDMSG_NOTWITHOVERLAYMAP, DRLA_WeaponNameID,         CR_UNTRANSLATED,    (extraX<<16) + (x1<<16) + 0.1,              2.1, 0);
  93.                     HudMessage(l:DRLA_Weapon_Name_Printer, s:"\c-";     HUDMSG_PLAIN | HUDMSG_NOTWITHFULLMAP | HUDMSG_NOTWITHOVERLAYMAP, DRLA_WeaponNameTrickID,    CR_UNTRANSLATED,    (extraX<<16) + (x1<<16) + (x2<<16) + 0.1,   2.1, 0);
  94.                 }
  95.  
  96.                 SetHudClipRect(0, 0, 0, 0);
  97.                 if((StrCmp(GetWeapon(),"RLDeathsGaze") == 0) || (StrCmp(GetWeapon(),"RLHellsReign") == 0) || (StrCmp(GetWeapon(),"RLSoulstormRifle") == 0) || (StrCmp(GetWeapon(),"RLUnmaker") == 0))
  98.                 {
  99.                     HudMessage( s:"\c[LightBlue]",  i:DRLA_Weapon_Bulk_Quantity,        s:"",
  100.                                 s:"\c[Red]",        i:DRLA_Weapon_Power_Quantity,       s:"",
  101.                                 s:"\c[Green]",      i:DRLA_Weapon_Agility_Quantity,     s:"",
  102.                                 s:"\c[Yellow]",     i:DRLA_Weapon_Technical_Quantity,   s:"",
  103.                                 s:"\c[Purple]",     i:DRLA_Weapon_Sniper_Quantity,      s:"",
  104.                                 s:"\c[Orange]",     i:DRLA_Weapon_Firestorm_Quantity,   s:"",
  105.                                 s:"\c[White]",      i:DRLA_Weapon_Nano_Quantity,        s:"",
  106.                                 s:"\c[DarkRed]",    i:DRLA_Weapon_Artifact_Quantity,    s:"",s:"\c-";
  107.                                 HUDMSG_PLAIN | HUDMSG_NOTWITHFULLMAP | HUDMSG_NOTWITHOVERLAYMAP, DRLA_WeaponModID, CR_UNTRANSLATED, (DRLA_WeaponModX<<16) - 1.1, (DRLA_WeaponModY<<16) + 0.1, 0);
  108.                 }
  109.                 else
  110.                 {
  111.                     HudMessage( s:"\c[LightBlue]",  i:DRLA_Weapon_Bulk_Quantity,        s:"",
  112.                                 s:"\c[Red]",        i:DRLA_Weapon_Power_Quantity,       s:"",
  113.                                 s:"\c[Green]",      i:DRLA_Weapon_Agility_Quantity,     s:"",
  114.                                 s:"\c[Yellow]",     i:DRLA_Weapon_Technical_Quantity,   s:"",
  115.                                 s:"\c[Purple]",     i:DRLA_Weapon_Sniper_Quantity,      s:"",
  116.                                 s:"\c[Orange]",     i:DRLA_Weapon_Firestorm_Quantity,   s:"",
  117.                                 s:"\c[White]",      i:DRLA_Weapon_Nano_Quantity,        s:"",s:"\c-";
  118.                                 HUDMSG_PLAIN | HUDMSG_NOTWITHFULLMAP | HUDMSG_NOTWITHOVERLAYMAP, DRLA_WeaponModID, CR_UNTRANSLATED, (DRLA_WeaponModX<<16) + 1.1, (DRLA_WeaponModY<<16) + 0.1, 0);
  119.                 }
  120.                
  121.             }
  122.         }
  123.         else
  124.         {
  125.             HudMessage(s:"\n";  HUDMSG_PLAIN | HUDMSG_NOTWITHFULLMAP | HUDMSG_NOTWITHOVERLAYMAP, DRLA_WeaponNameID,         CR_UNTRANSLATED,    (DRLA_WeaponNameX<<16) + 0.1, 2.1, 0);
  126.             HudMessage(s:"\n";  HUDMSG_PLAIN | HUDMSG_NOTWITHFULLMAP | HUDMSG_NOTWITHOVERLAYMAP, DRLA_WeaponNameTrickID,    CR_UNTRANSLATED,    (DRLA_WeaponNameX<<16) + 0.1, 2.1, 0);
  127.             HudMessage(s:"\n";  HUDMSG_PLAIN | HUDMSG_NOTWITHFULLMAP | HUDMSG_NOTWITHOVERLAYMAP, DRLA_WeaponModID,      CR_UNTRANSLATED,    (DRLA_WeaponNameX<<16) + 0.1, 2.1, 0);
  128.         }
  129.         Delay(2);
  130.     }
  131. }
  132.  
  133. SCRIPT "DRLA_WeaponNameScroller" ENTER
  134. {
  135.     int startX;
  136.     while(true)
  137.     {
  138.         if(DRLA_Screenblocks <= 10)
  139.         {
  140.             if(CheckInventory(StrParam(s:GetWeapon(),s:"DemonArtifacts")))
  141.             {
  142.                 startX = DRLA_Weapon_Name_Length * -1;
  143.                 for(int wdX = startX + DRLA_Weapon_Name_Length; wdX < DRLA_WeaponNameWidth + ((DRLA_Weapon_Name_Length*DRLA_Weapon_Name_Length)/5); wdX++)
  144.                 {
  145.                     extraX = wdX;
  146.                     Delay(1);
  147.                     if(StrCmp(DRLA_OldDualName,DRLA_Weapon_DualName_Printer) != 0)
  148.                     {
  149.                         wdX = startX + DRLA_Weapon_Name_Length;
  150.                         DRLA_OldDualName =      StrParam(s:"PDA_WEAPON_", s:StrMid(GetWeapon(),2,StrLen(GetWeapon())), s:"DEMONARTIFACTS", s:"_NAME");
  151.                         break;
  152.                     }
  153.                 }
  154.             }
  155.             else
  156.             {
  157.                 startX = DRLA_Weapon_Name_Length * -1;
  158.                 for(int wnx = startX + DRLA_Weapon_Name_Length; wnx < DRLA_WeaponNameWidth + ((DRLA_Weapon_Name_Length*DRLA_Weapon_Name_Length)/5); wnx++)
  159.                 {
  160.                     extraX = wnx;
  161.                     Delay(1);
  162.                     if(StrCmp(DRLA_OldWeaponName,DRLA_Weapon_Name_Printer) != 0)
  163.                     {
  164.                         wnx = startX + DRLA_Weapon_Name_Length;
  165.                         DRLA_OldWeaponName =    StrParam(s:"PDA_WEAPON_", s:StrMid(GetWeapon(),2,StrLen(GetWeapon())), s:"_NAME");
  166.                         break;
  167.                     }
  168.                 }
  169.             }
  170.         }
  171.         Delay(1);
  172.     }
  173. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement