Advertisement
Johurt

[FNC] TakeWeaponsBySlots

Mar 8th, 2019
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.61 KB | None | 0 0
  1. stock TakeWeaponsBySlots(playerid, slots[], size = sizeof(slots))
  2. {
  3.     new slotid, value, c, weapons[26], give = true;
  4.     if(size < 1) return 1;
  5.     for(c = 0; c < 13; c++) GetPlayerWeaponData(playerid, c, weapons[c], weapons[c + 13]);
  6.     ResetPlayerWeapons(playerid);
  7.     for(c = 0; c < 13; c++)
  8.     {
  9.         for(slotid = 0; slotid < size; slotid++)
  10.         {
  11.             value = slots[slotid];
  12.             if(value == 0) continue;
  13.             else if(value == c)
  14.             {
  15.                 give = false;
  16.                 break;
  17.             }
  18.         }
  19.         if(!give)
  20.         {
  21.             give = true;
  22.             continue;
  23.         }
  24.         GivePlayerWeapon(playerid, weapons[c], weapons[c + 13]);
  25.     }
  26.     return 1;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement