Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public fw_SetModel(entity, const model[])
- {
- // We don't care
- if (strlen(model) < 8) return;
- // Remove weapons?
- if (get_pcvar_float(cvar_removedropped) > 0.0)
- {
- // Get entity's classname
- static classname[10]
- pev(entity, pev_classname, classname, charsmax(classname))
- // Check if it's a weapon box
- if (equal(classname, "weaponbox"))
- {
- // They get automatically removed when thinking
- set_pev(entity, pev_nextthink, get_gametime() + get_pcvar_float(cvar_removedropped))
- /// SVC ///
- new iWeaponEnt;
- for (new iItem; iItem < 6 && !is_valid_ent(iWeaponEnt); iItem++)
- iWeaponEnt = get_ent_data_entity(entity, "CWeaponBox", "m_rgpPlayerItems", iItem);
- if (!is_valid_ent(iWeaponEnt))
- return;
- new iImpulse = pev(iWeaponEnt, pev_impulse);
- new color[3];
- switch (iImpulse)
- {
- case 10000: color = { 255, 255, 255 };
- case 11000: color = { 0, 0, 255 };
- case 12000: color = { 255, 0, 0 };
- case 13000: color = { 255, 255, 0 };
- case 14000: color = { 0, 255, 0 };
- }
- /*
- AQUI DEFINES QUÉ CATEGORÍA TENDRA CÚAL GLOW EN LAS ARMAS DEL SUELO
- LO QUE HARIAS SERIA ALGO COMO ESTO:
- else if (tu_variable_de_tu_categoria[iPlayer])
- color = { cantidad_rojo, cantidad_verder, cantidad_azul }
- */
- set_ent_rendering(entity, kRenderFxGlowShell, color[0], color[1], color[2], kRenderNormal, 15);
- /// SVC ///
- }
- }
- // Narrow down our matches a bit
- if (model[7] != 'w' || model[8] != '_') return;
- // Get damage time of grenade
- static Float:dmgtime
- pev(entity, pev_dmgtime, dmgtime)
- // Grenade not yet thrown
- if (dmgtime == 0.0) return;
- // Get whether grenade's owner is a zombie
- if (g_class[pev(entity, pev_owner)] >= ZOMBIE)
- {
- if (model[9] == 'h' && model[10] == 'e' && get_pcvar_num(cvar_extrainfbomb)) // Infection Bomb
- {
- // Give it a glow
- set_rendering(entity, kRenderFxGlowShell, 0, 200, 0, kRenderNormal, 16);
- // And a colored trail
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
- write_byte(TE_BEAMFOLLOW) // TE id
- write_short(entity) // entity
- write_short(g_trailSpr) // sprite
- write_byte(10) // life
- write_byte(10) // width
- write_byte(0) // r
- write_byte(200) // g
- write_byte(0) // b
- write_byte(200) // brightness
- message_end()
- // Set grenade type on the thrown grenade entity
- set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_INFECTION)
- }
- }
- else if (model[9] == 'h' && model[10] == 'e' && get_pcvar_num(cvar_firegrenades)) // Napalm Grenade
- {
- // Give it a glow
- set_rendering(entity, kRenderFxGlowShell, 200, 0, 0, kRenderNormal, 16);
- // And a colored trail
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
- write_byte(TE_BEAMFOLLOW) // TE id
- write_short(entity) // entity
- write_short(g_trailSpr) // sprite
- write_byte(10) // life
- write_byte(10) // width
- write_byte(200) // r
- write_byte(0) // g
- write_byte(0) // b
- write_byte(200) // brightness
- message_end()
- // Set grenade type on the thrown grenade entity
- set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_NAPALM)
- }
- else if (model[9] == 'f' && model[10] == 'l' && get_pcvar_num(cvar_frostgrenades)) // Frost Grenade
- {
- // Give it a glow
- set_rendering(entity, kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 16);
- // And a colored trail
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
- write_byte(TE_BEAMFOLLOW) // TE id
- write_short(entity) // entity
- write_short(g_trailSpr) // sprite
- write_byte(10) // life
- write_byte(10) // width
- write_byte(0) // r
- write_byte(100) // g
- write_byte(200) // b
- write_byte(200) // brightness
- message_end()
- // Set grenade type on the thrown grenade entity
- set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_FROST)
- }
- else if (model[9] == 's' && model[10] == 'm' && get_pcvar_num(cvar_aurashieldgrenades)) // Aura shield
- {
- // Give it a glow
- set_rendering(entity, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 16);
- // And a colored trail
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
- write_byte(TE_BEAMFOLLOW) // TE id
- write_short(entity) // entity
- write_short(g_trailSpr) // sprite
- write_byte(10) // life
- write_byte(10) // width
- write_byte(255) // r
- write_byte(255) // g
- write_byte(255) // b
- write_byte(200) // brightness
- message_end()
- // Set grenade type on the thrown grenade entity
- set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_AURASHIELD)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement