Advertisement
broweyy1

Untitled

Dec 6th, 2023
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.62 KB | None | 0 0
  1. // Ham Weapon Deploy Forward
  2. public fw_Item_Deploy_Post(weapon_ent)
  3. {
  4.     set_task(0.01, "Item_Deploy_Post", weapon_ent + 50000);
  5. }
  6.  
  7. public Item_Deploy_Post(weapon_ent)
  8. {
  9.     weapon_ent -= 50000;
  10.     if (!is_valid_ent(weapon_ent))
  11.         return;
  12.    
  13.     // Get weapon's owner
  14.     static owner; owner = fm_cs_get_weapon_ent_owner(weapon_ent)
  15.    
  16.     // Valid owner?
  17.     if (!pev_valid(owner)) return;
  18.    
  19.     // Get weapon's id
  20.     static weaponid; weaponid = cs_get_weapon_id(weapon_ent)
  21.    
  22.     // Store current weapon's id for reference
  23.     g_currentweapon[owner] = weaponid
  24.    
  25.     g_categorypro[owner] = g_categoryice[owner] = g_categoryfire[owner] = g_categorygolden[owner] = g_CategoryPlasmatic[owner] = false;
  26.    
  27.     new iImpulse = pev(weapon_ent, pev_impulse);
  28.     switch (iImpulse)
  29.     {
  30.         case 10000:
  31.         {
  32.             g_categorypro[owner] = true;
  33.         }
  34.         case 11000:
  35.         {
  36.             g_categoryice[owner] = true;
  37.         }
  38.         case 12000:
  39.         {
  40.             g_categoryfire[owner] = true;
  41.         }
  42.         case 13000:
  43.         {
  44.             g_categorygolden[owner] = true;
  45.         }
  46.         case 14000:
  47.         {
  48.             g_CategoryPlasmatic[owner] = true;
  49.         }
  50.     }
  51.    
  52.     // Replace weapon models with custom ones
  53.     replace_weapon_models(owner, weaponid)
  54.    
  55.     // Zombie not holding an allowed weapon for some reason
  56.     if (g_class[owner] >= ZOMBIE && !((1<<weaponid) & ZOMBIE_ALLOWED_WEAPONS_BITSUM))
  57.     {
  58.         // Switch to knife
  59.         g_currentweapon[owner] = CSW_KNIFE
  60.         engclient_cmd(owner, "weapon_knife")
  61.     }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement