View Single Post
sorin862000
New Member
Join Date: Dec 2013
Location: Espaņa
Old 12-01-2013 , 21:54   Re: Winter Environment
Reply With Quote #93

Quote:
Originally Posted by robert810 View Post
Maybe someone can take out StepSound? thanks

Here you go,this is not mine I found this on the web.Works for me with amxmodx 1.8.2 .

Code:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN "Winter Environment"
#define VERSION "1.0"
#define AUTHOR "Alka"

new const g_szBombModels[][] = {
    
    "models/ch-m/c4-christmastree2.mdl",
    "models/ch-m/c4-christmastree.mdl",
    "models/ch-m/frost_man.mdl",
    "models/ch-m/present1.mdl"
};
new const g_szBombSounds[][] = {
    
    "ch-s/bmb_planted.wav",
    "ch-s/bmb_defused.wav",
    "ch-s/bmb_defuse_failure.wav"
};

new g_iLedSprite;

public plugin_init() {
    
    register_plugin(PLUGIN, VERSION, AUTHOR);
    
    register_forward(FM_SetModel, "fwd_SetModel", 1);
    
    register_logevent("logevent_BombPlanted", 3, "2=Planted_The_Bomb");
    register_logevent("logevent_BombDefused", 3, "2=Defused_The_Bomb");
    register_logevent("logevent_BombExploded", 6, "3=Target_Bombed");
    
    register_message(SVC_TEMPENTITY, "message_TempEntity");
}

public plugin_precache()
{
    engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_snow"));
    
    new i;
    for(i = 0 ; i < sizeof g_szBombModels ; i++)
        precache_model(g_szBombModels[i]);
    for(i = 0 ; i < sizeof g_szBombSounds ; i++)
        precache_sound(g_szBombSounds[i]);
    
    g_iLedSprite = precache_model("sprites/ledglow.spr");
}

public fwd_SetModel(ent, const szModel[])
{
    if(!pev_valid(ent))
        return FMRES_IGNORED;
    
    if(equal(szModel, "models/w_c4.mdl"))
    {
        static iRndModel; iRndModel = random_num(0, sizeof g_szBombModels - 1);
        engfunc(EngFunc_SetModel, ent, g_szBombModels[iRndModel]);
        
        return FMRES_SUPERCEDE;
    }
    return FMRES_IGNORED;
}

public logevent_BombPlanted()
{
    emit_sound(0, CHAN_AUTO, g_szBombSounds[0], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
}

public logevent_BombDefused()
{
    client_cmd(0, "wait;stopsound");
    emit_sound(0, CHAN_AUTO, g_szBombSounds[1], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
}

public logevent_BombExploded()
{
    emit_sound(0, CHAN_AUTO, g_szBombSounds[2], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
}

public message_TempEntity(msg_id, msg_dest, msg_ent)
{
    if(get_msg_arg_int(1) == TE_GLOWSPRITE)
    {
        if(get_msg_arg_int(5) == g_iLedSprite)
            return PLUGIN_HANDLED;
    }
    return PLUGIN_CONTINUE;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Attached Files
File Type: zip Footsteps Edited.zip (924.2 KB, 247 views)

Last edited by sorin862000; 12-01-2013 at 22:07.
sorin862000 is offline
Send a message via Yahoo to sorin862000 Send a message via Skype™ to sorin862000