Advertisement
ijontichy

lel2

Sep 10th, 2011
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.36 KB | None | 0 0
  1. #include "zcommon.acs"
  2. #library "classWeapons"
  3.  
  4. #include "classWepList.h"
  5.  
  6. #define GAVEWEAPON      1
  7. #define WEAPONSTAYON    2
  8. #define NOCLASS         4
  9.  
  10. global int 6:classes[];
  11.  
  12.  
  13. script 682 (int which)
  14. {
  15.     int pln = PlayerNumber();
  16.     classes[pln] = which;
  17. }
  18.  
  19.  
  20. script 683 (int slot)
  21. {
  22.     int pln = PlayerNumber();
  23.     int found;
  24.     int ret;
  25.     int wep;
  26.     int check;
  27.     int x; int y; int z;
  28.     int i;
  29.  
  30.     if (GetCVar("sv_weaponstay"))
  31.     {
  32.         ret |= WEAPONSTAYON;
  33.     }
  34.  
  35.     slot -= 1;
  36.  
  37.     found = classes[pln] - 1;
  38.  
  39.     if (found == -1)
  40.     {
  41.         ret |= NOCLASS;
  42.     }
  43.  
  44.     /*if (found & MULTIPLECLASSES)
  45.     {
  46.         Print(s:"something broke - classes ", d:found, s:" and ", d:i, " found");
  47.         terminate;
  48.     }*/
  49.     if (ret & NOCLASS)
  50.     {
  51.         Print(s:"something broke - no classes found");
  52.         terminate;
  53.     }
  54.  
  55.     for (i = 0; i < WEPCOUNT; i++)
  56.     {
  57.         wep = classWeps[found][slot][i];
  58.  
  59.         if (!CheckInventory(wep) )
  60.         {
  61.             GiveInventory(wep, 1);
  62.             ret |= GAVEWEAPON;
  63.         }
  64.     }
  65.  
  66.     check = GAVEWEAPON;
  67.  
  68.     if (ret & check == check)
  69.     {
  70.         wep = classWeps[found][slot][2];
  71.  
  72.         x = GetActorX(0);
  73.         y = GetActorY(0);
  74.         z = GetActorZ(0) + 4.0;
  75.  
  76.         Spawn(wep, x, y, z);
  77.     }
  78.  
  79.     SetResultValue(ret);
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement