Raised This Month: $ Target: $400
 0% 

[PEDIDO] Efecto bomba hielo


  
 
 
Thread Tools Display Modes
Author Message
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 12-23-2012 , 22:45   [PEDIDO] Efecto bomba hielo
#1

Hola a todos me podrian dar el code para hacer este efecto.

http://cloud-2.steampowered.com/ugc/...97F2F98E5D961/

Es un efecto que cuando explota saca lineas a los zombies q estan cerca y cuando no hay los tira al aire.. gracias a los q ayuden
wicho is offline
xGreat
Senior Member
Join Date: Jul 2012
Location: Chilean
Old 12-24-2012 , 12:22   Re: [PEDIDO] Efecto bomba hielo
#2

Tienes el ese plugin ?

Saludos xGreat
__________________
Mi 255
WwW.HnsBJz.Tk = MI FORO

xGreat is offline
Send a message via MSN to xGreat
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 12-24-2012 , 12:38   Re: [PEDIDO] Efecto bomba hielo
#3

Quote:
Originally Posted by xGreat View Post
Tienes el ese plugin ?

Saludos xGreat
Si lo tubiera no estaría preguntando por el, ¿No te parece?
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
Geoslide
Senior Member
Join Date: Jun 2011
Location: Chilean player
Old 12-24-2012 , 13:01   Re: [PEDIDO] Efecto bomba hielo
#4

nel me parece que el usuario esta pidiendo como hacer un efecto, no un plugin.
__________________
Basebuilder V6 - plugin for sale
Jailbreak V6 - plugin for sale
more plugins in progress ...

Geoslide ?
Geoslide is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 12-24-2012 , 13:10   Re: [PEDIDO] Efecto bomba hielo
#5

Sisi pero xGreat pedía el plugin con el efecto... y si solo pedía el plugin de la bomba de hielo, viene default con el zp.

Edit: Viendo la imágen mas detalladamente no son las granadas por defecto pero si no me acuerdo mal ese plugin está todo buguiado...
__________________

Last edited by Neeeeeeeeeel.-; 12-24-2012 at 13:10.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
YakumoHiratsuhi
Veteran Member
Join Date: Dec 2010
Location: Dreαmlαnd.
Old 12-24-2012 , 13:29   Re: [PEDIDO] Efecto bomba hielo
#6

A lo que se refiere el muchacho si mal no comprendo es que quiere que se haga un efecto de laser entre el zombie y la entidad de la granada si es que entro en el radio y se tiren rayos al aire aunque no peguen a ningun zombie
__________________
"Podra parecer ridiculo o imposible, pero este es el camino que seguimos los verdaderos hombres, si hay un muro en el camino, lo derribamos, si no hay camino, haremos uno, con nuestras propias manos, porque el magma de nuestro corazón arde en llamas."

Last edited by YakumoHiratsuhi; 12-24-2012 at 13:30.
YakumoHiratsuhi is offline
Send a message via MSN to YakumoHiratsuhi
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 12-24-2012 , 13:30   Re: [PEDIDO] Efecto bomba hielo
#7

No es un traceline desde la granada hasta el jugador eso que se ve?
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
YakumoHiratsuhi
Veteran Member
Join Date: Dec 2010
Location: Dreαmlαnd.
Old 12-24-2012 , 13:31   Re: [PEDIDO] Efecto bomba hielo
#8

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
No es un traceline desde la granada hasta el jugador eso que se ve?
sepa la madre, pero yo veo algunas lineas deformes, pense que era un rayo
__________________
"Podra parecer ridiculo o imposible, pero este es el camino que seguimos los verdaderos hombres, si hay un muro en el camino, lo derribamos, si no hay camino, haremos uno, con nuestras propias manos, porque el magma de nuestro corazón arde en llamas."
YakumoHiratsuhi is offline
Send a message via MSN to YakumoHiratsuhi
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 12-24-2012 , 13:43   Re: [PEDIDO] Efecto bomba hielo
#9

PHP Code:
new beam;

public 
plugin_precache( )
    
beam precache_model"sprites/laserbeam.spr" );

public 
cuando_explota_la_granada_de_hieloentid )
{
     
//shit here
     
new Float:entOrigin], FloatuserOrigin];
     
peventpev_originentOrigin );
     
     
// esto va en un bucle con todos los jugadores que esten dentro del radio de la entidad de la bomba
     
pevidpev_originuserOrigin );
     
draw_tracelineententOriginuserOrigin );
}

draw_tracelineentv_Originv_EndOrigin )
{
    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byteTE_BEAMPOINTS );
    
engfuncEngFunc_WriteCoordv_Origin] );
    
engfuncEngFunc_WriteCoordv_Origin] );
    
engfuncEngFunc_WriteCoordv_Origin] );
    
engfuncEngFunc_WriteCoordv_EndOrigin] );
    
engfuncEngFunc_WriteCoordv_EndOrigin] );
    
engfuncEngFunc_WriteCoordv_EndOrigin] );
    
write_shortbeam );
    
write_byte);
    
write_byte);
    
write_byte);
    
write_byte);
    
write_byte);
    
write_byte); //red
    
write_byte); //green
    
write_byte255 ); //blue
    
write_byte255 );
    
write_byte255 );
    
message_end( );

Creo que funciona...
__________________

Last edited by Neeeeeeeeeel.-; 12-24-2012 at 13:44.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 12-24-2012 , 13:56   Re: [PEDIDO] Efecto bomba hielo
#10

Si algunas lineas salen deformes y otras rectas.. ok gracias lo voy a testear

P.S: como hago el bucle, perdon pero soy un poco nobato, me ayudarias a colocarlo por favor este es el codigo:

PHP Code:
/*================================================================================
    
    ---------------------------
    -*- [ZP] Grenade: Frost -*-
    ---------------------------
    
    This plugin is part of Zombie Plague Mod and is distributed under the
    terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
    
================================================================================*/

#include <amxmodx>
#include <fun>
#include <fakemeta>
#include <hamsandwich>
#include <amx_settings_api>
#include <cs_weap_models_api>
#include <cs_ham_bots_api>
#include <zp50_core>

// Settings file
new const ZP_SETTINGS_FILE[] = "zombieplague.ini"

// Default sounds
new const sound_grenade_frost_explode[][] = { "warcraft3/frostnova.wav" }
new const 
sound_grenade_frost_player[][] = { "warcraft3/impalehit.wav" }
new const 
sound_grenade_frost_break[][] = { "warcraft3/impalelaunch1.wav" }

#define MODEL_MAX_LENGTH 64
#define SOUND_MAX_LENGTH 64
#define SPRITE_MAX_LENGTH 64

// Models
new g_model_grenade_frost[MODEL_MAX_LENGTH] = "models/zombie_plague/v_grenade_frost.mdl"

// Sprites
new g_sprite_grenade_trail[SPRITE_MAX_LENGTH] = "sprites/laserbeam.spr"
new g_sprite_grenade_ring[SPRITE_MAX_LENGTH] = "sprites/shockwave.spr"
new g_sprite_grenade_explode[SPRITE_MAX_LENGTH] = "sprites/frost_explode.spr"
new g_sprite_grenade_gib[SPRITE_MAX_LENGTH] = "sprites/frost_gib.spr"
new g_sprite_grenade_glass[SPRITE_MAX_LENGTH] = "models/glassgibs.mdl"
new g_sprite_grenade_beam[SPRITE_MAX_LENGTH] = "sprites/laserbeam.spr"

new Array:g_sound_grenade_frost_explode
new Array:g_sound_grenade_frost_player
new Array:g_sound_grenade_frost_break

#define GRAVITY_HIGH 999999.9
#define GRAVITY_NONE 0.000001

#define TASK_FROST_REMOVE 100
#define ID_FROST_REMOVE (taskid - TASK_FROST_REMOVE)

#define MAXPLAYERS 32

#define flag_get(%1,%2) (%1 & (1 << (%2 & 31)))
#define flag_get_boolean(%1,%2) (flag_get(%1,%2) ? true : false)
#define flag_set(%1,%2) %1 |= (1 << (%2 & 31))
#define flag_unset(%1,%2) %1 &= ~(1 << (%2 & 31))

// Hack to be able to use Ham_Player_ResetMaxSpeed (by joaquimandrade)
new Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame

// Explosion radius for custom grenades
const Float:NADE_EXPLOSION_RADIUS 240.0

// HACK: pev_ field used to store custom nade types and their values
const PEV_NADE_TYPE pev_flTimeStepSound
const NADE_TYPE_FROST 3333

// Some constants
const UNIT_SECOND = (1<<12)
const 
BREAK_GLASS 0x01
const FFADE_IN 0x0000
const FFADE_STAYOUT 0x0004

// Custom Forwards
enum _:TOTAL_FORWARDS
{
    
FW_USER_FREEZE_PRE 0,
    
FW_USER_UNFROZEN
}
new 
g_Forwards[TOTAL_FORWARDS]
new 
g_ForwardResult

new g_IsFrozen
new Float:g_FrozenGravity[MAXPLAYERS+1]
new 
g_FrozenRenderingFx[MAXPLAYERS+1]
new 
Float:g_FrozenRenderingColor[MAXPLAYERS+1][3]
new 
g_FrozenRenderingRender[MAXPLAYERS+1]
new 
Float:g_FrozenRenderingAmount[MAXPLAYERS+1]

new 
g_MsgDamageg_MsgScreenFade
new g_trailSprg_exploSprg_glassSprg_explodeSprg_gibSpr
new g_beam

new cvar_grenade_frost_durationcvar_grenade_frost_hudicon

public plugin_init()
{
    
register_plugin("[ZP] Grenade: Frost"ZP_VERSION_STRING"ZP Dev Team")
    
    
RegisterHam(Ham_Player_ResetMaxSpeed"player""fw_ResetMaxSpeed_Post"1)
    
RegisterHamBots(Ham_Player_ResetMaxSpeed"fw_ResetMaxSpeed_Post"1)
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
RegisterHamBots(Ham_TakeDamage"fw_TakeDamage")
    
RegisterHam(Ham_TraceAttack"player""fw_TraceAttack")
    
RegisterHamBots(Ham_TraceAttack"fw_TraceAttack")
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
    
RegisterHamBots(Ham_Killed"fw_PlayerKilled")
    
register_forward(FM_PlayerPreThink"fw_PlayerPreThink")
    
register_forward(FM_SetModel"fw_SetModel")
    
RegisterHam(Ham_Think"grenade""fw_ThinkGrenade")
    
    
g_MsgDamage get_user_msgid("Damage")
    
g_MsgScreenFade get_user_msgid("ScreenFade")
    
    
cvar_grenade_frost_duration register_cvar("zp_grenade_frost_duration""3")
    
cvar_grenade_frost_hudicon register_cvar("zp_grenade_frost_hudicon""1")
    
    
g_Forwards[FW_USER_FREEZE_PRE] = CreateMultiForward("zp_fw_grenade_frost_pre"ET_CONTINUEFP_CELL)
    
g_Forwards[FW_USER_UNFROZEN] = CreateMultiForward("zp_fw_grenade_frost_unfreeze"ET_IGNOREFP_CELL)
}

public 
plugin_natives()
{
    
register_library("zp50_grenade_frost")
    
register_native("zp_grenade_frost_get""native_grenade_frost_get")
    
register_native("zp_grenade_frost_set""native_grenade_frost_set")
}

public 
native_grenade_frost_get(plugin_idnum_params)
{
    new 
id get_param(1)
    
    if (!
is_user_alive(id))
    {
        
log_error(AMX_ERR_NATIVE"[ZP] Invalid Player (%d)"id)
        return 
false;
    }
    
    return 
flag_get_boolean(g_IsFrozenid);
}

public 
native_grenade_frost_set(plugin_idnum_params)
{
    new 
id get_param(1)
    
    if (!
is_user_alive(id))
    {
        
log_error(AMX_ERR_NATIVE"[ZP] Invalid Player (%d)"id)
        return 
false;
    }
    
    new 
set get_param(2)
    
    
// Unfreeze
    
if (!set)
    {
        
// Not frozen
        
if (!flag_get(g_IsFrozenid))
            return 
true;
        
        
// Remove freeze right away and stop the task
        
remove_freeze(id+TASK_FROST_REMOVE)
        
remove_task(id+TASK_FROST_REMOVE)
        return 
true;
    }
    
    return 
set_freeze(id);
}

public 
plugin_precache()
{
    
// Initialize arrays
    
g_sound_grenade_frost_explode ArrayCreate(SOUND_MAX_LENGTH1)
    
g_sound_grenade_frost_player ArrayCreate(SOUND_MAX_LENGTH1)
    
g_sound_grenade_frost_break ArrayCreate(SOUND_MAX_LENGTH1)
    
    
// Load from external file
    
amx_load_setting_string_arr(ZP_SETTINGS_FILE"Sounds""GRENADE FROST EXPLODE"g_sound_grenade_frost_explode)
    
amx_load_setting_string_arr(ZP_SETTINGS_FILE"Sounds""GRENADE FROST PLAYER"g_sound_grenade_frost_player)
    
amx_load_setting_string_arr(ZP_SETTINGS_FILE"Sounds""GRENADE FROST BREAK"g_sound_grenade_frost_break)
    
    
// If we couldn't load custom sounds from file, use and save default ones
    
new index
    
if (ArraySize(g_sound_grenade_frost_explode) == 0)
    {
        for (
index 0index sizeof sound_grenade_frost_explodeindex++)
            
ArrayPushString(g_sound_grenade_frost_explodesound_grenade_frost_explode[index])
        
        
// Save to external file
        
amx_save_setting_string_arr(ZP_SETTINGS_FILE"Sounds""GRENADE FROST EXPLODE"g_sound_grenade_frost_explode)
    }
    if (
ArraySize(g_sound_grenade_frost_player) == 0)
    {
        for (
index 0index sizeof sound_grenade_frost_playerindex++)
            
ArrayPushString(g_sound_grenade_frost_playersound_grenade_frost_player[index])
        
        
// Save to external file
        
amx_save_setting_string_arr(ZP_SETTINGS_FILE"Sounds""GRENADE FROST PLAYER"g_sound_grenade_frost_player)
    }
    if (
ArraySize(g_sound_grenade_frost_break) == 0)
    {
        for (
index 0index sizeof sound_grenade_frost_breakindex++)
            
ArrayPushString(g_sound_grenade_frost_breaksound_grenade_frost_break[index])
        
        
// Save to external file
        
amx_save_setting_string_arr(ZP_SETTINGS_FILE"Sounds""GRENADE FROST BREAK"g_sound_grenade_frost_break)
    }
    
    
// Load from external file, save if not found
    
if (!amx_load_setting_string(ZP_SETTINGS_FILE"Weapon Models""GRENADE FROST"g_model_grenade_frostcharsmax(g_model_grenade_frost)))
        
amx_save_setting_string(ZP_SETTINGS_FILE"Weapon Models""GRENADE FROST"g_model_grenade_frost)
    if (!
amx_load_setting_string(ZP_SETTINGS_FILE"Grenade Sprites""TRAIL"g_sprite_grenade_trailcharsmax(g_sprite_grenade_trail)))
        
amx_save_setting_string(ZP_SETTINGS_FILE"Grenade Sprites""TRAIL"g_sprite_grenade_trail)
    if (!
amx_load_setting_string(ZP_SETTINGS_FILE"Grenade Sprites""RING"g_sprite_grenade_ringcharsmax(g_sprite_grenade_ring)))
        
amx_save_setting_string(ZP_SETTINGS_FILE"Grenade Sprites""RING"g_sprite_grenade_ring)
    if (!
amx_load_setting_string(ZP_SETTINGS_FILE"Grenade Sprites""FROST EXPLODE"g_sprite_grenade_explodecharsmax(g_sprite_grenade_explode)))
             
amx_save_setting_string(ZP_SETTINGS_FILE"Grenade Sprites""FROST EXPLODE"g_sprite_grenade_explode)
    if (!
amx_load_setting_string(ZP_SETTINGS_FILE"Grenade Sprites""FROST GIB"g_sprite_grenade_gibcharsmax(g_sprite_grenade_gib)))
             
amx_save_setting_string(ZP_SETTINGS_FILE"Grenade Sprites""FROST GIB"g_sprite_grenade_gib)
    if (!
amx_load_setting_string(ZP_SETTINGS_FILE"Grenade Sprites""GLASS"g_sprite_grenade_glasscharsmax(g_sprite_grenade_glass)))
        
amx_save_setting_string(ZP_SETTINGS_FILE"Grenade Sprites""GLASS"g_sprite_grenade_glass)
    
    
// Precache sounds
    
new sound[SOUND_MAX_LENGTH]
    for (
index 0index ArraySize(g_sound_grenade_frost_explode); index++)
    {
        
ArrayGetString(g_sound_grenade_frost_explodeindexsoundcharsmax(sound))
        
precache_sound(sound)
    }
    for (
index 0index ArraySize(g_sound_grenade_frost_player); index++)
    {
        
ArrayGetString(g_sound_grenade_frost_playerindexsoundcharsmax(sound))
        
precache_sound(sound)
    }
    for (
index 0index ArraySize(g_sound_grenade_frost_break); index++)
    {
        
ArrayGetString(g_sound_grenade_frost_breakindexsoundcharsmax(sound))
        
precache_sound(sound)
    }
    
    
// Precache models
    
precache_model(g_model_grenade_frost)
    
g_trailSpr precache_model(g_sprite_grenade_trail)
    
g_exploSpr precache_model(g_sprite_grenade_ring)
    
g_glassSpr precache_model(g_sprite_grenade_glass)
    
g_explodeSpr precache_model(g_sprite_grenade_explode)
    
g_gibSpr precache_model(g_sprite_grenade_gib)
    
g_beam precache_model(g_sprite_grenade_beam)
}

public 
zp_fw_core_cure_post(idattacker)
{
    
// Set custom grenade model
    
cs_set_player_view_model(idCSW_FLASHBANGg_model_grenade_frost)
    
    
// If frozen, remove freeze after player is cured
    
if (flag_get(g_IsFrozenid))
    {
        
// Update gravity and rendering values first
        
ApplyFrozenGravity(id)
        
ApplyFrozenRendering(id)
        
        
// Remove freeze right away and stop the task
        
remove_freeze(id+TASK_FROST_REMOVE)
        
remove_task(id+TASK_FROST_REMOVE)
    }
}

public 
zp_fw_core_infect(idattacker)
{
    
// Remove custom grenade model
    
cs_reset_player_view_model(idCSW_FLASHBANG)
}

public 
zp_fw_core_infect_post(idattacker)
{
    
// If frozen, update gravity and rendering
    
if (flag_get(g_IsFrozenid))
    {
        
ApplyFrozenGravity(id)
        
ApplyFrozenRendering(id)
    }
}

public 
client_disconnect(id)
{
    
flag_unset(g_IsFrozenid)
    
remove_task(id+TASK_FROST_REMOVE)
}

public 
fw_ResetMaxSpeed_Post(id)
{
    
// Dead or not frozen
    
if (!is_user_alive(id) || !flag_get(g_IsFrozenid))
        return;
    
    
// Prevent from moving
    
set_user_maxspeed(id1.0)
}

// Ham Trace Attack Forward
public fw_TraceAttack(victimattacker)
{
    
// Non-player damage or self damage
    
if (victim == attacker || !is_user_alive(attacker))
        return 
HAM_IGNORED;
    
    
// Block damage while frozen, as it makes killing zombies too easy
    
if (flag_get(g_IsFrozenvictim))
        return 
HAM_SUPERCEDE;
        
    if (
flag_get(g_IsFrozenattacker))  
                  return 
HAM_SUPERCEDE
    
    return 
HAM_IGNORED;
}

// Ham Take Damage Forward (needed to block explosion damage too)
public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    
// Non-player damage or self damage
    
if (victim == attacker || !is_user_alive(attacker))
        return 
HAM_IGNORED;
        
    if (
flag_get(g_IsFrozenattacker))  
                  return 
HAM_SUPERCEDE
    
    
// Block damage while frozen, as it makes killing zombies too easy
    
if (flag_get(g_IsFrozenvictim))
        return 
HAM_SUPERCEDE;
        
    return 
HAM_IGNORED;
}

// Ham Player Killed Forward
public fw_PlayerKilled(victimattackershouldgib)
{
    
// Frozen player being killed (usually caused by a 3rd party plugin, e.g. lasermines)
    
if (flag_get(g_IsFrozenvictim))
    {
        
// Remove freeze right away and stop the task
        
remove_freeze(victim+TASK_FROST_REMOVE)
        
remove_task(victim+TASK_FROST_REMOVE)
    }
}

// Forward Player PreThink
public fw_PlayerPreThink(id)
{
    
// Not alive or not frozen
    
if (!is_user_alive(id) || !flag_get(g_IsFrozenid))
        return;
    
    
// Stop motion
    
set_pev(idpev_velocityFloat:{0.0,0.0,0.0})
}

// Forward Set Model
public fw_SetModel(entity, const model[])
{
    
// We don't care
    
if (strlen(model) < 8)
        return;
    
    
// Narrow down our matches a bit
    
if (model[7] != 'w' || model[8] != '_')
        return;
    
    
// Get damage time of grenade
    
static Float:dmgtime
    pev
(entitypev_dmgtimedmgtime)
    
    
// Grenade not yet thrown
    
if (dmgtime == 0.0)
        return;
    
    
// Grenade's owner is zombie?
    
if (zp_core_is_zombie(pev(entitypev_owner)))
        return;
    
    
// Flashbang
    
if (model[9] == 'f' && model[10] == 'l')
    {
        
// Give it a glow
        
fm_set_rendering(entitykRenderFxGlowShell0100200kRenderNormal16);
        
        
// And a colored trail
        
message_begin(MSG_BROADCASTSVC_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(entityPEV_NADE_TYPENADE_TYPE_FROST)
    }
}

// Ham Grenade Think Forward
public fw_ThinkGrenade(entity)
{
    
// Invalid entity
    
if (!pev_valid(entity)) return HAM_IGNORED;
    
    
// Get damage time of grenade
    
static Float:dmgtime
    pev
(entitypev_dmgtimedmgtime)
    
    
// Check if it's time to go off
    
if (dmgtime get_gametime())
        return 
HAM_IGNORED;
    
    
// Check if it's one of our custom nades
    
switch (pev(entityPEV_NADE_TYPE))
    {
        case 
NADE_TYPE_FROST// Frost Grenade
        
{
            
frost_explode(entity)
            return 
HAM_SUPERCEDE;
        }
    }
    
    return 
HAM_IGNORED;
}

// Frost Grenade Explosion
frost_explode(ent)
{
    
// Get origin
    
static Float:origin[3]
    
pev(entpev_originorigin)
    
    
// Make the explosion
    
create_blast3(origin)
    
    
// Frost nade explode sound
    
static sound[SOUND_MAX_LENGTH]
    
ArrayGetString(g_sound_grenade_frost_exploderandom_num(0ArraySize(g_sound_grenade_frost_explode) - 1), soundcharsmax(sound))
    
emit_sound(entCHAN_WEAPONsound1.0ATTN_NORM0PITCH_NORM)
    
    
// Collisions
    
new victim = -1
    
    
while ((victim engfunc(EngFunc_FindEntityInSpherevictimoriginNADE_EXPLOSION_RADIUS)) != 0)
    {
        
// Only effect alive zombies
        
if (!is_user_alive(victim) || !zp_core_is_zombie(victim))
            continue;
        
        
set_freeze(victim)
    }
    
    
// Get rid of the grenade
    
engfunc(EngFunc_RemoveEntityent)
}

set_freeze(victim)
{
    
// Already frozen
    
if (flag_get(g_IsFrozenvictim))
        return 
false;
    
    
// Allow other plugins to decide whether player should be frozen or not
    
ExecuteForward(g_Forwards[FW_USER_FREEZE_PRE], g_ForwardResultvictim)
    if (
g_ForwardResult >= PLUGIN_HANDLED)
    {
        
// Get player's origin
        
static origin2[3]
        
get_user_origin(victimorigin2)
        
        
// Broken glass sound
        
static sound[SOUND_MAX_LENGTH]
        
ArrayGetString(g_sound_grenade_frost_breakrandom_num(0ArraySize(g_sound_grenade_frost_break) - 1), soundcharsmax(sound))
        
emit_sound(victimCHAN_BODYsound1.0ATTN_NORM0PITCH_NORM)
        
        
// Glass shatter
        
message_begin(MSG_PVSSVC_TEMPENTITYorigin2)
        
write_byte(TE_BREAKMODEL// TE id
        
write_coord(origin2[0]) // x
        
write_coord(origin2[1]) // y
        
write_coord(origin2[2]+24// z
        
write_coord(16// size x
        
write_coord(16// size y
        
write_coord(16// size z
        
write_coord(random_num(-5050)) // velocity x
        
write_coord(random_num(-5050)) // velocity y
        
write_coord(25// velocity z
        
write_byte(10// random velocity
        
write_short(g_glassSpr// model
        
write_byte(10// count
        
write_byte(25// life
        
write_byte(BREAK_GLASS// flags
        
message_end()
        
        return 
false;
    }
    
    
// Freeze icon?
    
if (get_pcvar_num(cvar_grenade_frost_hudicon))
    {
        
message_begin(MSG_ONE_UNRELIABLEg_MsgDamage_victim)
        
write_byte(0// damage save
        
write_byte(0// damage take
        
write_long(DMG_DROWN// damage type - DMG_FREEZE
        
write_coord(0// x
        
write_coord(0// y
        
write_coord(0// z
        
message_end()
    }
    
    
// Set frozen flag
    
flag_set(g_IsFrozenvictim)
    
    
// Freeze sound
    
static sound[SOUND_MAX_LENGTH]
    
ArrayGetString(g_sound_grenade_frost_playerrandom_num(0ArraySize(g_sound_grenade_frost_player) - 1), soundcharsmax(sound))
    
emit_sound(victimCHAN_BODYsound1.0ATTN_NORM0PITCH_NORM)
    
    
// Add a blue tint to their screen
    
message_begin(MSG_ONEg_MsgScreenFade_victim)
    
write_short(0// duration
    
write_short(0// hold time
    
write_short(FFADE_STAYOUT// fade type
    
write_byte(0// red
    
write_byte(50// green
    
write_byte(200// blue
    
write_byte(100// alpha
    
message_end()
    
    
// Update player entity rendering
    
ApplyFrozenRendering(victim)
    
    
// Block gravity
    
ApplyFrozenGravity(victim)
    
    
// Update player's maxspeed
    
ExecuteHamB(Ham_Player_ResetMaxSpeedvictim)
    
    
// Set a task to remove the freeze
    
set_task(get_pcvar_float(cvar_grenade_frost_duration), "remove_freeze"victim+TASK_FROST_REMOVE)
    return 
true;
}

ApplyFrozenGravity(id)
{
    
// Get current gravity
    
new Float:gravity get_user_gravity(id)
    
    
// Already set, no worries...
    
if (gravity == GRAVITY_HIGH || gravity == GRAVITY_NONE)
        return;
    
    
// Save player's old gravity
    
g_FrozenGravity[id] = gravity
    
    
// Prevent from jumping
    
if (pev(idpev_flags) & FL_ONGROUND)
        
set_user_gravity(idGRAVITY_HIGH// set really high
    
else
        
set_user_gravity(idGRAVITY_NONE// no gravity
}

ApplyFrozenRendering(id)
{
    
// Get current rendering
    
new rendering_fx pev(idpev_renderfx)
    new 
Float:rendering_color[3]
    
pev(idpev_rendercolorrendering_color)
    new 
rendering_render pev(idpev_rendermode)
    new 
Float:rendering_amount
    pev
(idpev_renderamtrendering_amount)
    
    
// Already set, no worries...
    
if (rendering_fx == kRenderFxGlowShell && rendering_color[0] == 0.0 && rendering_color[1] == 100.0
        
&& rendering_color[2] == 200.0 && rendering_render == kRenderNormal && rendering_amount == 25.0)
        return;
    
    
// Save player's old rendering    
    
g_FrozenRenderingFx[id] = pev(idpev_renderfx)
    
pev(idpev_rendercolorg_FrozenRenderingColor[id])
    
g_FrozenRenderingRender[id] = pev(idpev_rendermode)
    
pev(idpev_renderamtg_FrozenRenderingAmount[id])
    
    
// Light blue glow while frozen
    
fm_set_rendering(idkRenderFxGlowShell0100200kRenderNormal25)
}

// Remove freeze task
public remove_freeze(taskid)
{
    
// Remove frozen flag
    
flag_unset(g_IsFrozenID_FROST_REMOVE)
    
    
// Restore gravity
    
set_pev(ID_FROST_REMOVEpev_gravityg_FrozenGravity[ID_FROST_REMOVE])
    
    
// Update player's maxspeed
    
ExecuteHamB(Ham_Player_ResetMaxSpeedID_FROST_REMOVE)
    
    
// Restore rendering
    
fm_set_rendering_float(ID_FROST_REMOVEg_FrozenRenderingFx[ID_FROST_REMOVE], g_FrozenRenderingColor[ID_FROST_REMOVE], g_FrozenRenderingRender[ID_FROST_REMOVE], g_FrozenRenderingAmount[ID_FROST_REMOVE])
    
    
// Gradually remove screen's blue tint
    
message_begin(MSG_ONEg_MsgScreenFade_ID_FROST_REMOVE)
    
write_short(UNIT_SECOND// duration
    
write_short(0// hold time
    
write_short(FFADE_IN// fade type
    
write_byte(0// red
    
write_byte(50// green
    
write_byte(200// blue
    
write_byte(100// alpha
    
message_end()
    
    
// Broken glass sound
    
static sound[SOUND_MAX_LENGTH]
    
ArrayGetString(g_sound_grenade_frost_breakrandom_num(0ArraySize(g_sound_grenade_frost_break) - 1), soundcharsmax(sound))
    
emit_sound(ID_FROST_REMOVECHAN_BODYsound1.0ATTN_NORM0PITCH_NORM)
    
    
// Get player's origin
    
static origin[3]
    
get_user_origin(ID_FROST_REMOVEorigin)
    
    
// Glass shatter
    
message_begin(MSG_PVSSVC_TEMPENTITYorigin)
    
write_byte(TE_BREAKMODEL// TE id
    
write_coord(origin[0]) // x
    
write_coord(origin[1]) // y
    
write_coord(origin[2]+24// z
    
write_coord(16// size x
    
write_coord(16// size y
    
write_coord(16// size z
    
write_coord(random_num(-5050)) // velocity x
    
write_coord(random_num(-5050)) // velocity y
    
write_coord(25// velocity z
    
write_byte(10// random velocity
    
write_short(g_glassSpr// model
    
write_byte(10// count
    
write_byte(25// life
    
write_byte(BREAK_GLASS// flags
    
message_end()
    
    
ExecuteForward(g_Forwards[FW_USER_UNFROZEN], g_ForwardResultID_FROST_REMOVE)
}

// Frost Grenade: Freeze Blast
create_blast3(const Float:originF[3])
{
    
// Smallest ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+385.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(0// red
    
write_byte(100// green
    
write_byte(200// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()
    
    
// Medium ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+470.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(0// red
    
write_byte(100// green
    
write_byte(200// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()
    
    
// Largest ring
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_BEAMCYLINDER// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+555.0// z axis
    
write_short(g_exploSpr// sprite
    
write_byte(0// startframe
    
write_byte(0// framerate
    
write_byte(4// life
    
write_byte(60// width
    
write_byte(0// noise
    
write_byte(0// red
    
write_byte(100// green
    
write_byte(200// blue
    
write_byte(200// brightness
    
write_byte(0// speed
    
message_end()
    
    
// TE_SPRITETRAIL
    
engfunc(EngFunc_MessageBeginMSG_BROADCAST ,SVC_TEMPENTITYoriginF0)
    
write_byte(TE_SPRITETRAIL// TE ID
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+70// z axis
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z axis
    
write_short(g_gibSpr// Sprite Index
    
write_byte(80// Count
    
write_byte(20// Life
    
write_byte(2// Scale
    
write_byte(50// Velocity Along Vector
    
write_byte(10// Rendomness of Velocity
    
message_end();    

         
// TE_EXPLOSION 
    
engfunc(EngFunc_MessageBeginMSG_BROADCAST,SVC_TEMPENTITYoriginF0)
    
write_byte(TE_EXPLOSION)
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x axis
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y axis
    
engfunc(EngFunc_WriteCoordoriginF[2]+75// z axis
    
write_short(g_explodeSpr)
    
write_byte(22)
    
write_byte(35)
    
write_byte(TE_EXPLFLAG_NOSOUND)
    
message_end()
    
    
// TE_DLIGHT
         
engfunc(EngFunc_MessageBeginMSG_BROADCAST,SVC_TEMPENTITYoriginF0)
         
write_byte(TE_DLIGHT// TE id
         
engfunc(EngFunc_WriteCoordoriginF[0]) // x
         
engfunc(EngFunc_WriteCoordoriginF[1]) // y
         
engfunc(EngFunc_WriteCoordoriginF[2]) // z
         
write_byte(50// radius
         
write_byte(100// red
         
write_byte(200// green
         
write_byte(200// blue
         
write_byte(30// life
         
write_byte(30// decay rate
         
message_end()  
}

// Set entity's rendering type (from fakemeta_util)
stock fm_set_rendering(entityfx kRenderFxNone255255255render kRenderNormalamount 16)
{
    static 
Float:color[3]
    
color[0] = float(r)
    
color[1] = float(g)
    
color[2] = float(b)
    
    
set_pev(entitypev_renderfxfx)
    
set_pev(entitypev_rendercolorcolor)
    
set_pev(entitypev_rendermoderender)
    
set_pev(entitypev_renderamtfloat(amount))
}

// Set entity's rendering type (float parameters version)
stock fm_set_rendering_float(entityfx kRenderFxNoneFloat:color[3], render kRenderNormalFloat:amount 16.0)
{
    
set_pev(entitypev_renderfxfx)
    
set_pev(entitypev_rendercolorcolor)
    
set_pev(entitypev_rendermoderender)
    
set_pev(entitypev_renderamtamount)

perdon por las molestias..

Last edited by wicho; 12-24-2012 at 14:33.
wicho is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:39.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode