AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Plugin for snow (https://forums.alliedmods.net/showthread.php?t=231958)

P.Marian 12-23-2013 04:44

Plugin for snow
 
Who is this plugin for Snow?

http://i.imgur.com/hdouoV0.jpg

Kia 12-23-2013 04:46

Re: Plugin for snow
 
There are already multiple threads about this plugin, search for them.

preetham 12-23-2013 04:51

Re: Plugin for snow
 
1 Attachment(s)
Here u go! :)

Code:

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>

#define PLUGIN "Realistic Snow Fall"
#define VERSION "0.1"
#define AUTHOR "KillaH"

new const sprite[] = "sprites/fsnow/snow1.spr"
new cvar
new r, g, b
public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_touch("fsnow","*","remove")
    set_task(0.1, "prepare", _, _, _, "b")
    set_task(10.0, "remove", _, _, _, "b")
    cvar = register_cvar("number_flakes", "64")
    r = register_cvar("R", "255")
    g = register_cvar("G", "255")
    b = register_cvar("B", "255")
   
}
public plugin_precache()
{
    precache_model(sprite)
}
public prepare(id)
{
    new Float:origin[3]
    new map[64]
    get_mapname(map,63)
    if(equal(map,"cs_assault"))
        origin[2] = 999.0
    else if(equal(map,"de_dust2"))
        origin[2] = 250.0
    else if(equal(map, "de_nuke"))
        origin[2] = 120.0
    else if(equal(map, "de_inferno"))
        origin[2] = 430.0
    else if(equal(map, "de_dust"))
        origin[2] = 210.0
    else
        return
   
    for(new i;i<get_pcvar_num(cvar);i++)
    {
        origin[0] = random_float(-2999.9,2999.9)
        origin[1] = random_float(-2999.9,2999.9)
        new ent = create_entity("env_sprite")
        static Float:color[3]
        color[0] = get_pcvar_float(r)
        color[1] = get_pcvar_float(g)
        color[2] = get_pcvar_float(b)
        entity_set_string(ent, EV_SZ_classname, "fsnow")
        entity_set_model(ent,sprite)
        entity_set_int(ent, EV_INT_spawnflags, SF_SPRITE_STARTON)
        entity_set_float(ent, EV_FL_framerate, 30.0)
        entity_set_float(ent, EV_FL_scale, 1.0)
        entity_set_int(ent, EV_INT_rendermode, kRenderTransAdd)
        entity_set_float(ent, EV_FL_renderamt, 255.0)
   
       
        set_pev(ent, pev_rendercolor, color)
        entity_set_origin(ent, origin)
        entity_set_int(ent, EV_INT_solid, SOLID_BBOX)
        entity_set_int(ent, EV_INT_movetype, MOVETYPE_TOSS)
        entity_set_size(ent,Float:{1.0,1.0,1.0},Float:{1.0,1.0,1.0})       
        entity_set_float(ent, EV_FL_gravity,0.4)
        new Float:v[3]
        entity_get_vector(ent,EV_VEC_velocity,v)
        v[0]=random_float(-250.0,250.0)
        v[1]=random_float(-250.0,250.0)
        entity_set_vector(ent,EV_VEC_velocity,v)
       
    }
}

public remove(ent) {
    remove_entity(ent)
}

an u need a snow sprite.. paste in sprited>fsnow>**paste .spr file here**

P.Marian 12-23-2013 04:51

Re: Plugin for snow
 
Neither is good.

Edit later: preetham, We'll try

preetham 12-23-2013 04:54

Re: Plugin for snow
 
Quote:

Originally Posted by P.Marian (Post 2075350)
Neither is good.

Edit later: preetham, We'll try

Marian, code which gave u is the exact code of the plugin in ur picture..

P.Marian 12-24-2013 03:12

Re: Plugin for snow
 
Thank you very very much


All times are GMT -4. The time now is 11:55.

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