Raised This Month: $51 Target: $400
 12% 

[Help] Gravity of snowflakes


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
The Professional
Member
Join Date: Nov 2015
Location: İstanbul
Old 12-19-2016 , 12:22   [Help] Gravity of snowflakes
Reply With Quote #1

I want to set gravity of snowflakes.. This possible?

PHP Code:
#include <amxmodx>
#include <engine>
#include <hamsandwich>

#define PLUGIN  "Snow Plugin"
#define VERSION "2016"
#define AUTHOR  "Ult_Nut"

#define get_bit(%1,%2)  (%1 & (1 << (%2 & MAXCLIENTS-1)))
#define set_bit(%1,%2)  (%1 |= (1 << (%2 & MAXCLIENTS-1)))
#define reset_bit(%1,%2)        (%1 &= ~(1 << (%2 & MAXCLIENTS-1)))
           
#define MAXCLIENTS 32
#define SNOW_SPRITE "sprites/snow1.spr" //snow_white-TalRasha.spr
#define CLASSNAME "SnowEntity"

new g_bAlive;

new 
g_iSpriteSnow;
new 
g_iMaxPlayers;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_event("HLTV""Event_NewRound""a""1=0""2=0");
    
    new 
ent create_entity("info_target");
    
    
entity_set_string(entEV_SZ_classnameCLASSNAME);
    
entity_set_float(entEV_FL_nextthinkget_gametime() + 2.0);
    
    
register_think(CLASSNAME"ThinkSnow");
    
    
RegisterHam(Ham_Spawn"player""Ham_PlayerSpawn_Post"1);
    
RegisterHam(Ham_Killed"player""HamPlayerKilled_Post"1);
    
    
g_iMaxPlayers get_maxplayers();
}
public 
plugin_precache()
{
    
g_iSpriteSnow precache_model(SNOW_SPRITE);
}
public 
Ham_PlayerSpawn_Post(id)
{
    if(
is_user_alive(id)) set_bit(g_bAliveid);
}
public 
Event_NewRound(){
    
set_fog(251035);
    
//set_lights ("f");
}
public 
HamPlayerKilled_Post(id)
{
    
reset_bit(g_bAliveid);
}
public 
ThinkSnow(ent)
{
    
entity_set_float(entEV_FL_nextthinkget_gametime() + 0.010);
    
    static 
id;
    for(
id 1id <= g_iMaxPlayersid++)
    {
        if(!
get_bit(g_bAliveid)) continue;
        
        new 
Float:fOrigin[3], iOrigin[3];
        
entity_get_vector(idEV_VEC_originfOrigin);
        
FVecIVec(fOriginiOrigin);
        
iOrigin[0] += random_num(-10001000);
        
iOrigin[1] += random_num(-10001000);
        
iOrigin[2] += random_num(1001000);
        
UTIL_CreateSnow(iOriging_iSpriteSnow112);
    }
}
stock UTIL_CreateSnow(const iOrigin[3], const iSpriteID, const iCount, const iLife, const iScale)
{
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
    
write_byte(TE_SPRITETRAIL);
    
write_coord(iOrigin[0]);
    
write_coord(iOrigin[1]);
    
write_coord(iOrigin[2]);
    
write_coord(iOrigin[0]);
    
write_coord(iOrigin[1]);
    
write_coord(iOrigin[2]);
    
write_short(iSpriteID);
    
write_byte(iCount);
    
write_byte(iLife);
    
write_byte(iScale);
    
write_byte(random_num(15));
    
write_byte(random_num(18));
    
message_end();
}

stock set_fog(redgreenblue){
    
message_begin(MSG_ALLget_user_msgid("Fog"));
    
write_byte(red);
    
write_byte(green);
    
write_byte(blue);
    
write_long(_:0.00065)
    
message_end();

__________________

Last edited by The Professional; 12-19-2016 at 12:40.
The Professional is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 12-19-2016 , 12:56   Re: [Help] Gravity of snowflakes
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?p=735477

Cvars:

sw_toggle - is mod on/off? (default ON - 1)
sw_friendly - is friendly fire on/off? (default OFF - 0)
sw_damage - damage done by snowball (default 100)
sw_life - life of snowball splat (default 3.0)
sw_dm - is deathmatch on/off? (defualt OFF - 0)
sw_dm_time - time to respawn (default 2.0)
sw_chill_chance - chance to chill player (from 0 - off, to 100 - maximum chance, default 30)
sw_chill_duration - duration of chill (default 5.0)
sw_chill_speed - percentage of speed that player receives when chilled (default 50.0)
sw_snowball_gravity - gravity of snowball (default 0.3)
sw_snowball_velocity - how many times snowball velocity will be multipied (default 2.0 times)
sw_crosshair_remove - will be crosshair removed (default ON - 1)
sw_spawn_protection - is spawn protection on? (default ON - 1)
sw_spawn_protection_time - time of spawn protection (default 3.0)
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 12-19-2016 , 13:18   Re: [Help] Gravity of snowflakes
Reply With Quote #5

ooo, i'm sorry, i will make some reserach and come back
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 12-19-2016 , 13:41   Re: [Help] Gravity of snowflakes
Reply With Quote #7

Soorry, abolute nothing found, i have no idea how to do that, you can use Winter Environment by Alka, but is almost the same , i assume you want to change the speed of snowing fallind down no ?
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Old 12-19-2016, 13:48
The Professional
This message has been deleted by The Professional.
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 12-20-2016 , 02:25   Re: [Help] Gravity of snowflakes
Reply With Quote #9

It may be possibile with my Gravity API but idk ...
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 12-20-2016 , 06:44   Re: [Help] Gravity of snowflakes
Reply With Quote #10

ok, try this one:
PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>

new const PlayerClass[ ] = "player";

public 
plugin_init( )
{
    
RegisterHamHam_Spawn PlayerClass"hook_spawn");    
}

public 
hook_spawnent )
{
    
SetGravityent 800 );
    
}

public 
client_putinserverent SetGravityent 800 );


SetGravityid iGravity )
{
    static 
GravityPointer;
    
GravityPointer get_cvar_pointer"sv_gravity" );

    if( 
is_user_aliveid ) && iGravity 
    {
        
set_user_gravityidfloatiGravity ) / floatget_pcvar_numGravityPointer ) ) );
    }

}

public 
plugin_cfg( )
{
    
set_cvar_num"sv_gravity"55 );

__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
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 07:21.


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