natesmithzombies

ammomatic

Feb 11th, 2017
619
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1. function ammo_matic()
  2. {
  3.     cost = 5000;
  4.     trigs = GetEntArray( "ammo_matic", "targetname" );
  5.     foreach( trig in trigs )
  6.     {
  7.         trig thread ammo_matic_think( cost );
  8.         trig SetCursorHint( "HINT_NOICON" );
  9.         trig SetHintString( "Press and Hold ^3&&1^7 to Buy Ammo [Cost: "+cost+"]" );
  10.     }
  11. }
  12.  
  13. function ammo_matic_think( cost )
  14. {
  15.     while(1)
  16.     {
  17.         self waittill( "trigger", player );
  18.         if( player.score >= cost )
  19.         {
  20.             weapon = player GetCurrentWeapon();
  21.             player zm_weapons::weapon_give( weapon );
  22.             PlaySoundAtPosition( "zmb_cha_ching", self.origin );
  23.             player zm_score::minus_to_player_score( cost );
  24.             self SetHintString("");
  25.             wait(3);
  26.         }
  27.         else
  28.         {
  29.             self SetHintString( "You Do Not Have Enough Money" );
  30.             wait(3);
  31.         }
  32.         self SetHintString( "Press and Hold ^3&&1^7 to Buy Ammo [Cost: "+cost+"]" );
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment