Advertisement
KiLLerBoy_001

Some funcs

Aug 26th, 2020 (edited)
962
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.11 KB | None | 0 0
  1.     void MaxAmmo(int mode)
  2.     {
  3.         if (mode == 1) // Current
  4.         {
  5.             QUEUE_JOB_BEGIN_CLAUSE()
  6.             {
  7.                 WEAPON::GET_CURRENT_PED_WEAPON(PLAYER::PLAYER_PED_ID(), &hashvar, 1);
  8.                 if (WEAPON::GET_MAX_AMMO(PLAYER::PLAYER_PED_ID(), hashvar, &maxAmmo))
  9.                 {
  10.                     WEAPON::SET_PED_AMMO(PLAYER::PLAYER_PED_ID(), hashvar, maxAmmo, 0);
  11.                     maxAmmo = WEAPON::GET_MAX_AMMO_IN_CLIP(PLAYER::PLAYER_PED_ID(), hashvar, 1);
  12.                     if (maxAmmo > 0)
  13.                         WEAPON::SET_AMMO_IN_CLIP(PLAYER::PLAYER_PED_ID(), hashvar, maxAmmo);
  14.                 }
  15.             }
  16.             QUEUE_JOB_END_CLAUSE
  17.         }
  18.         else if (mode == 2) // All
  19.         {
  20.             QUEUE_JOB_BEGIN_CLAUSE()
  21.             {
  22.                 for (int i = 0; i < 90; i++)
  23.                 {
  24.                     if (WEAPON::GET_MAX_AMMO(PLAYER::PLAYER_PED_ID(), MISC::GET_HASH_KEY(WeaponNames[i]), &maxAmmo))
  25.                     {
  26.                         WEAPON::SET_PED_AMMO(PLAYER::PLAYER_PED_ID(), MISC::GET_HASH_KEY(WeaponNames[i]), maxAmmo, 0);
  27.                         maxAmmo = WEAPON::GET_MAX_AMMO_IN_CLIP(PLAYER::PLAYER_PED_ID(), MISC::GET_HASH_KEY(WeaponNames[i]), 1);
  28.                         if (maxAmmo > 0)
  29.                             WEAPON::SET_AMMO_IN_CLIP(PLAYER::PLAYER_PED_ID(), MISC::GET_HASH_KEY(WeaponNames[i]), maxAmmo);
  30.                     }
  31.                 }
  32.             }
  33.             QUEUE_JOB_END_CLAUSE
  34.         }
  35.     }
  36.  
  37.  
  38.  
  39.     void GiveAllWeapons(Player selectedPlayer)
  40.     {
  41.         Evar = selectedPlayer;
  42.         QUEUE_JOB_BEGIN_CLAUSE()
  43.         {
  44.  
  45.             for (int i = 0; i < 90; i++)
  46.             {
  47.                 WEAPON::GIVE_DELAYED_WEAPON_TO_PED(Evar,MISC::GET_HASH_KEY(WeaponNames[i]), 1000, 0);
  48.  
  49.                 for (int j = 0; j < 383; j++)
  50.                 {
  51.                     WEAPON::GIVE_WEAPON_COMPONENT_TO_PED(Evar, MISC::GET_HASH_KEY(WeaponNames[i]), MISC::GET_HASH_KEY(WeaponCompNames[j]));
  52.                 }
  53.             }
  54.         }
  55.         QUEUE_JOB_END_CLAUSE
  56.     }
  57.  
  58.  
  59.     void Stun(Ped playerPed)
  60.     {
  61.         Pvar = playerPed;
  62.         QUEUE_JOB_BEGIN_CLAUSE()
  63.         {
  64.             Vector3 From;
  65.             Vector3 To = ENTITY::GET_WORLD_POSITION_OF_ENTITY_BONE(Pvar, PED::GET_PED_BONE_INDEX(Pvar, 39317));
  66.             From = To;
  67.             From.z = From.z + 0.0001f;
  68.             Vehicle Vehicle = PED::GET_VEHICLE_PED_IS_IN(Pvar, 0);
  69.             MISC::SHOOT_SINGLE_BULLET_BETWEEN_COORDS(From.x, From.y, From.z, To.x, To.y, To.z, 0, false, RAGE_JOAAT("WEAPON_STUNGUN"), PLAYER::PLAYER_PED_ID(), false, true, 9999999.0f);
  70.         }
  71.         QUEUE_JOB_END_CLAUSE
  72.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement