Advertisement
broweyy1

Untitled

Dec 16th, 2023
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.42 KB | None | 0 0
  1. public fw_SetModel(entity, const model[])
  2. {
  3.     // We don't care
  4.     if (strlen(model) < 8) return;
  5.    
  6.     // Remove weapons?
  7.     if (get_pcvar_float(cvar_removedropped) > 0.0)
  8.     {
  9.         // Get entity's classname
  10.         static classname[10]
  11.         pev(entity, pev_classname, classname, charsmax(classname))
  12.        
  13.         // Check if it's a weapon box
  14.         if (equal(classname, "weaponbox"))
  15.         {
  16.             // They get automatically removed when thinking
  17.             set_pev(entity, pev_nextthink, get_gametime() + get_pcvar_float(cvar_removedropped))
  18.            
  19.             /// SVC ///
  20.             new iWeaponEnt;
  21.             for (new iItem; iItem < 6 && !is_valid_ent(iWeaponEnt); iItem++)
  22.                 iWeaponEnt = get_ent_data_entity(entity, "CWeaponBox", "m_rgpPlayerItems", iItem);
  23.            
  24.             if (!is_valid_ent(iWeaponEnt))
  25.                 return;
  26.            
  27.             new iImpulse = pev(iWeaponEnt, pev_impulse);
  28.             new color[3];
  29.            
  30.             switch (iImpulse)
  31.             {
  32.                 case 10000: color = { 255, 255, 255 };
  33.                 case 11000: color = { 0, 0, 255 };
  34.                 case 12000: color = { 255, 0, 0 };
  35.                 case 13000: color = { 255, 255, 0 };
  36.                 case 14000: color = { 0, 255, 0 };
  37.             }
  38.            
  39.             /*
  40.             AQUI DEFINES QUÉ CATEGORÍA TENDRA CÚAL GLOW EN LAS ARMAS DEL SUELO
  41.             LO QUE HARIAS SERIA ALGO COMO ESTO:
  42.            
  43.             else if (tu_variable_de_tu_categoria[iPlayer])
  44.                 color = { cantidad_rojo, cantidad_verder, cantidad_azul }
  45.             */
  46.             set_ent_rendering(entity, kRenderFxGlowShell, color[0], color[1], color[2], kRenderNormal, 15);
  47.             /// SVC ///
  48.         }
  49.     }
  50.    
  51.     // Narrow down our matches a bit
  52.     if (model[7] != 'w' || model[8] != '_') return;
  53.    
  54.     // Get damage time of grenade
  55.     static Float:dmgtime
  56.     pev(entity, pev_dmgtime, dmgtime)
  57.    
  58.     // Grenade not yet thrown
  59.     if (dmgtime == 0.0) return;
  60.    
  61.     // Get whether grenade's owner is a zombie
  62.     if (g_class[pev(entity, pev_owner)] >= ZOMBIE)
  63.     {
  64.         if (model[9] == 'h' && model[10] == 'e' && get_pcvar_num(cvar_extrainfbomb)) // Infection Bomb
  65.         {
  66.             // Give it a glow
  67.             set_rendering(entity, kRenderFxGlowShell, 0, 200, 0, kRenderNormal, 16);
  68.            
  69.             // And a colored trail
  70.             message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  71.             write_byte(TE_BEAMFOLLOW) // TE id
  72.             write_short(entity) // entity
  73.             write_short(g_trailSpr) // sprite
  74.             write_byte(10) // life
  75.             write_byte(10) // width
  76.             write_byte(0) // r
  77.             write_byte(200) // g
  78.             write_byte(0) // b
  79.             write_byte(200) // brightness
  80.             message_end()
  81.            
  82.             // Set grenade type on the thrown grenade entity
  83.             set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_INFECTION)
  84.         }
  85.     }
  86.     else if (model[9] == 'h' && model[10] == 'e' && get_pcvar_num(cvar_firegrenades)) // Napalm Grenade
  87.     {
  88.         // Give it a glow
  89.         set_rendering(entity, kRenderFxGlowShell, 200, 0, 0, kRenderNormal, 16);
  90.        
  91.         // And a colored trail
  92.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  93.         write_byte(TE_BEAMFOLLOW) // TE id
  94.         write_short(entity) // entity
  95.         write_short(g_trailSpr) // sprite
  96.         write_byte(10) // life
  97.         write_byte(10) // width
  98.         write_byte(200) // r
  99.         write_byte(0) // g
  100.         write_byte(0) // b
  101.         write_byte(200) // brightness
  102.         message_end()
  103.        
  104.         // Set grenade type on the thrown grenade entity
  105.         set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_NAPALM)
  106.     }
  107.     else if (model[9] == 'f' && model[10] == 'l' && get_pcvar_num(cvar_frostgrenades)) // Frost Grenade
  108.     {
  109.         // Give it a glow
  110.         set_rendering(entity, kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 16);
  111.        
  112.         // And a colored trail
  113.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  114.         write_byte(TE_BEAMFOLLOW) // TE id
  115.         write_short(entity) // entity
  116.         write_short(g_trailSpr) // sprite
  117.         write_byte(10) // life
  118.         write_byte(10) // width
  119.         write_byte(0) // r
  120.         write_byte(100) // g
  121.         write_byte(200) // b
  122.         write_byte(200) // brightness
  123.         message_end()
  124.        
  125.         // Set grenade type on the thrown grenade entity
  126.         set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_FROST)
  127.     }
  128.     else if (model[9] == 's' && model[10] == 'm' && get_pcvar_num(cvar_aurashieldgrenades)) // Aura shield
  129.     {
  130.         // Give it a glow
  131.         set_rendering(entity, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 16);
  132.        
  133.         // And a colored trail
  134.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  135.         write_byte(TE_BEAMFOLLOW) // TE id
  136.         write_short(entity) // entity
  137.         write_short(g_trailSpr) // sprite
  138.         write_byte(10) // life
  139.         write_byte(10) // width
  140.         write_byte(255) // r
  141.         write_byte(255) // g
  142.         write_byte(255) // b
  143.         write_byte(200) // brightness
  144.         message_end()
  145.        
  146.         // Set grenade type on the thrown grenade entity
  147.         set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_AURASHIELD)
  148.     }
  149. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement