Raised This Month: $32 Target: $400
 8% 

Solved WorldModel / W_Model Frost Grenade


Post New Thread Reply   
 
Thread Tools Display Modes
PowereXe
Member
Join Date: Jan 2017
Location: Turkey, Istanbul
Old 05-26-2017 , 19:46   Re: [Request] WorldModel / W_Model Frost Grenade
Reply With Quote #11

Something Is Wrong. Precached Model, It's OK. But When I Threw The Bomb, Seemed Standart W_Flashbang Model. I Checked With HL Model Viewer, Deleted And Precached Again. But The Same Problem.

Here Is The New SMA:

PHP Code:
#include <amxmodx>
#include <engine>
#include <cstrike>
#include <fun>
#include <biohazard>
#include <hamsandwich>
#include <fakemeta>
#include <fakemeta_util>

#define RADIUS 250.0
#define FROST_DURATION 5.0
#define FROST_CODE 3245879
#define ice_model "models/dd_iceblock.mdl"
#define V_MODEL "models/v_ice_cube_z.mdl"
#define W_MODEL "models/w_ice_cube_lawliet.mdl"

new g_frostexp
new g_frost_gibs;
new 
iceent[33], g_glassSprg_msgScreenFadegrenadetrailg_msgDamage

public plugin_init()
{
    
register_plugin("T.Knight Avalanche Frost" "2.0" "Halil ibrahim")
    
register_cvar("fros""hardy"FCVAR_SERVER|FCVAR_SPONLY)
    
register_event("HLTV""Event_NewRound""a""1=0""2=0")
    
register_forward(FM_SetModel"fw_SetModel")
    
register_forward(FM_Touch"fw_Touch")
    
RegisterHam(Ham_Item_Deploy,"weapon_flashbang""fw_Item_Deploy_Post"1)
    
RegisterHam(Ham_Killed"player""player_dead")
    
g_msgDamage get_user_msgid("Damage")
    
g_msgScreenFade get_user_msgid("ScreenFade")
}
public 
plugin_precache()
{
    
grenadetrail engfunc(EngFunc_PrecacheModel"sprites/laserbeam.spr")
    
    
g_glassSpr engfunc(EngFunc_PrecacheModel"models/glassgibs.mdl")
    
engfunc(EngFunc_PrecacheModelice_model)
    
engfunc(EngFunc_PrecacheModelV_MODEL)
    
engfunc(EngFunc_PrecacheModelW_MODEL )
    
engfunc(EngFunc_PrecacheSound"/weapons/frostnova.wav")
    
engfunc(EngFunc_PrecacheSound"/weapons/impalehit.wav")
    
engfunc(EngFunc_PrecacheSound"weapons/impalelaunch1.wav")
    
g_frostexp precache_model("sprites/frost_kurukafa.spr")
    
g_frost_gibs precache_model("sprites/frostbomb_buzparcacigi.spr")
}

public 
client_putinserver(id)
{    
    new 
g_Ham_Bot

    
if(!g_Ham_Bot && is_user_bot(id))
    {
        
g_Ham_Bot 1
        set_task
(0.1"Do_RegisterHam_Bot"id)
    }
}

public 
Do_RegisterHam_Bot(id)
{
    
RegisterHamFromEntity(Ham_Killedid"player_dead")
}

public 
fw_Item_Deploy_Post(weapon_ent)
{
    static 
idid fm_cs_get_weapon_ent_owner(weapon_ent)
    if (!
pev_valid(id))
        return
        
    
set_pev(idpev_viewmodel2V_MODEL)
}

public 
fw_Touch(pfnptd)
{
    if(!
pev_valid(pfn))
        return
        
    static 
Classname[32]; pev(pfnpev_classnameClassnamesizeof(Classname))
    if(
equal(Classname"grenade"))
    {
        if(
pev(pfnpev_iuser2) != FROST_CODE)
            return

        
frost_explode(pfn)
        
        
set_pev(pfnpev_iuser20)
        
        
engfunc(EngFunc_RemoveEntitypfn)
    }
}

frost_explode(ent)
{
    
// Get origin
    
static Float:originF[3], Owner
    pev
(entpev_originoriginF)
    
Owner pev(entpev_owner)
    
// Make the explosion
    
yeni_balast_ates(originF)
    
    
// Fire nade explode sound
    
emit_sound(entCHAN_WEAPON"frostnova.wav"1.0ATTN_NORM0PITCH_NORM)
    
    static 
Float:PlayerOrigin[3]
    for(new 
0get_maxplayers(); i++)
    {
        if(!
is_user_alive(i))
            continue
        if(
cs_get_user_team(i) == cs_get_user_team(Owner))
            continue
        
pev(ipev_originPlayerOrigin)
        if(
get_distance_f(originFPlayerOrigin) > RADIUS)
            continue
            
        if(!
is_user_connected(Owner)) Owner i
        ami_frozen
(i)
        
        
message_begin(MSG_ONE_UNRELIABLEg_msgDamage_i)
        
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()
        
        
emit_sound(iCHAN_BODY"impalehit.wav"1.0ATTN_NORM0PITCH_NORM)
        
        
message_begin(MSG_ONEg_msgScreenFade_i)
        
write_short(0// duration
        
write_short(0// hold time
        
write_short(0x0004// fade type
        
write_byte(0// red
        
write_byte(50// green
        
write_byte(200// blue
        
write_byte(100// alpha
        
message_end()
                
        
set_task(FROST_DURATION"remove_freeze"i)
    }
}

public 
remove_freeze(id)
{
    
// Not alive or not frozen anymore
    
if (!is_user_alive(id))
        return;
        
    
// Gradually remove screen's blue tint
    
message_begin(MSG_ONEg_msgScreenFade_id)
    
write_short((1<<12)) // duration
    
write_short(0// hold time
    
write_short(0x0000// fade type
    
write_byte(0// red
    
write_byte(50// green
    
write_byte(200// blue
    
write_byte(100// alpha
    
message_end()
    
    
ice_entityid)
    
    
// Broken glass sound
    
emit_sound(idCHAN_BODY"impalelaunch1.wav"1.0ATTN_NORM0PITCH_NORM)
    
    
// Get player's origin
    
static origin2[3]
    
get_user_origin(idorigin2)
    
    
// 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(0x01// flags
    
message_end()
}

public 
fw_SetModel(entity, const model[])
{
    
// We don't care
    
if (strlen(model) < 8)
        return;
    
    if (
model[9] == 'f' && model[10] == 'l' && model[11] == 'a' && model[12] == 's' && model[13] == 'h' && model[14] == 'b'// Napalm Grenade
    
{
        
// Give it a glow
        
fm_set_rendering(entitykRenderFxGlowShell84231247kRenderNormal16);
        
        
set_pev(entitypev_iuser2FROST_CODE)
        
engfunc(EngFunc_SetModelentityW_MODEL);
        
        
// And a colored trail
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_BEAMFOLLOW// TE id
        
write_short(entity// entity
        
write_short(grenadetrail// sprite
        
write_byte(10// life
        
write_byte(10// width
        
write_byte(0// r
        
write_byte(191// g
        
write_byte(255// b
        
write_byte(200// brightness
        
message_end()
    }
}

public 
Event_NewRound()
{
    for(new 
0get_maxplayers(); i++)
    {
        
ice_entityi)
    }
}

public 
player_dead(id)
{
    
ice_entityid)
}

public 
ami_frozen(id)
{
    
ice_entityid
}

stock ice_entity(idstatus
{
    if(
status)
    {
        static 
entFloat:o[3]
        if(!
is_user_alive(id))
        {
            
ice_entity(id,0)
            return
        }
        
        if( 
is_valid_ent(iceent[id]))
        {
            if( 
peviceent[id], pev_iuser3 ) != id)
            {
                if(
pev(iceent[id], pev_team) == 6969remove_entity(iceent[id])
            }
            else
            {
                
pev(id,pev_origin,o)
                if( 
pev(id,pev_flags) & FL_DUCKING o[2] -= 15.0
                
else o[2] -= 35.0
                entity_set_origin
(iceent[id], o)
                return
            }
        }
        
        
pevidpev_origin)
        if( 
pevidpev_flags ) & FL_DUCKING  o[2] -= 15.0
        
else o[2] -= 35.0
        ent 
create_entity("info_target")
        
set_peventpev_classname"DareDevil" )
        
        
entity_set_model(entice_model)
        
dllfunc(DLLFunc_Spawnent)
        
set_pev(entpev_solidSOLID_BBOX)
        
set_pev(entpev_movetypeMOVETYPE_FLY)
        
entity_set_origin(ento)
        
entity_set_size(entFloat:{ -3.0, -3.0, -3.0 }, Float:{ 3.03.03.0 })
        
set_peventpev_iuser3id )
        
set_peventpev_team6969 )
        
set_rendering(entkRenderFxNone255255255kRenderTransAdd255)
        
iceent[id] = ent
    
}
    else
    {
        if(
is_valid_ent(iceent[id]))
        {
            if( 
pev(iceent[id], pev_team) == 6969 remove_entity(iceent[id])
            
iceent[id] = -1
        
}
    }
}

yeni_balast_ates(const Float:originF[3])
{
    
message_begin (MSG_BROADCAST,SVC_TEMPENTITY)
    
write_byte(TE_SPRITE)
    
engfunc(EngFunc_WriteCoordoriginF[0]+random_float(-5.05.0))
    
engfunc(EngFunc_WriteCoordoriginF[1]+random_float(-5.05.0))
    
engfunc(EngFunc_WriteCoordoriginF[2]+90.0)
    
write_short(g_frostexp)
    
write_byte(13//Büyüklük
    
write_byte(150//Saydamlık
    
message_end()
    
    
message_begin (MSG_BROADCAST,SVC_TEMPENTITY)
    
write_byteTE_SPRITETRAIL )
    
engfunc(EngFunc_WriteCoordoriginF]) // başlangıç
    
engfunc(EngFunc_WriteCoordoriginF])
    
engfunc(EngFunc_WriteCoordoriginF] + 200.0)
    
engfunc(EngFunc_WriteCoordoriginF]) // hızı
    
engfunc(EngFunc_WriteCoordoriginF])
    
engfunc(EngFunc_WriteCoordoriginF] + 30.0)
    
write_short(g_frost_gibs// sprite dosyası
    
write_byte(30// kaç adet dağılacağı
    
write_byte(random_num(27,30))
    
write_byte(2
    
write_byte(50)
    
write_byte(10)
    
message_end() 
    
    
}

stock fm_cs_get_weapon_ent_owner(ent)
{
    if (
pev_valid(ent) != 2)
        return -
1
    
    
return get_pdata_cbase(ent414)

PowereXe is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 05-26-2017 , 19:53   Re: [Request] WorldModel / W_Model Frost Grenade
Reply With Quote #12

Change line 26: register_forward(FM_SetModel, "fw_SetModel", 1)
PartialCloning is offline
PowereXe
Member
Join Date: Jan 2017
Location: Turkey, Istanbul
Old 05-26-2017 , 20:43   Re: [Request] WorldModel / W_Model Frost Grenade
Reply With Quote #13

Worked Fine Bro Very Very Thanks

Could You Help Me About Behemoth Grenade. It's A Little Bit Different From The Frost Bomb.
https://forums.alliedmods.net/showthread.php?t=297887
PowereXe is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 05-26-2017 , 20:58   Re: [Request] WorldModel / W_Model Frost Grenade
Reply With Quote #14

It's the same idea. But I replied there.
PartialCloning is offline
Reply



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 06:30.


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