AlliedModders (
-   Approved Plugins (
-   -   AIO: Winter Plugin (

tuty 12-22-2015 12:12

AIO: Winter Plugin
3 Attachment(s)

AIO (All-In-One) Winter Plugin

After researching a lot on a variety of forums, I could not find what i needed to customize my server for Winter. Instead of installing 100 plugins, I created an AIO one!
With this plugin you can bring the Christmas Environment to your Counter Strike server! Very customizable, this plugin unique style is beyond all the existing Christmas plugins here.
I know there are a LOT of plugins for winter here, but most of them aren't complete, or they contain bugs. Well in this plugin I tried to create an All-In-One Winter plugin that includes almost all the functionalities for a Christmas Server! Merry Christmas everyone!

What does this plugin contains?
  • Gun Snowball Bullets
  • Custom Sky name for the Christmas Environment
  • Custom Darkness on the map, to make it more Environmental (enables mp_flashlight server cvar)
  • Custom Christmas Bomb Sounds (Planted, Exploded, Defused)
  • Custom BOMB replacement
  • Weather Menu (For those who do not have cl_weather cvar enabled. Plugin offers to set it up for the user, asking USER PERMISSION. No slow-hacking)

  • An AWESOME coloured musical tree on each team spawn that plays music and have lightning styles (YEAH!)
  • Santa Hat for each player, or Admin only.
  • Picking up presents, somethimes you get GLOW on your SANTA HAT (HECK YEAH!)
  • Better models, a variety of customizations and model replacements (Christmas Themed, Grenades, Knife, Bomb)
  • Candy Cane knife replacement with player model ! WOAH.
  • Players will drop Presents when they die!
  • Support for maps that has rain built in! (adding snow environment instead of rain)
  • FUN! FUN! FUN!
  • A variety of configurations, including it's own config file!
  • To see what kind of presents you can pick up, read the configuration file!
  • Grenade glow and trails, customizable by 3 different types: 1. All grenades trail/glow is white, 2. HE has red glow/trail, FB has blue glow/trail and SG has green trail/glow. 3. All grenades have random glow/trail colours

Why is it so unique?
  • Has a lot of Half-Life resources
  • Up to date
  • Own configuration file, with a variety of customizable cvars
  • Different Christmas models, new and unique
  • Musical Christmas Trees, on every map, located to each team spawns!
  • 2 different models for Christmas Trees, Santa Hats!
  • Unseen new snowball models for grenades, with trail and glow effects!
  • 3 different models for presents
  • 2 different unique models for the BOMB replacement

PHP Code:

// --| -------------------------------------------------------------
// --| AIO (All-In-One) Winter plugin by: tuty
// --| Feel free to modify the configuration file as you please
// --| Special thanks to: xPaw, Alka, ConnorMcLeod, VEN, v3x and others
// --| -------------------------------------------------------------

// --| When player shoots with his weapon on the wall, it will leave white snowflakes 
// --| Value: 1 / 0
// --| Explanation: Enabled / Disabled
aio_winter_gun_snowball "1"

// --| If Snowballs are enabled, for how long will snowflakes stay alive?
// --| Value: < your amount > in seconds. Must be a floating point number
// --| Explanation: aio_winter_gun_snowball_duration "10.0" - snowflakes will stay alive for 10 seconds
aio_winter_gun_snowball_duration "5.0"

// --| Change the server sky texture to "space" ( Nice themed christmas sky )
// --| Value: 1 / 0
// --| Explanation: Enabled / Disabled
aio_winter_changesky "1"

// --| Set a nice darkness effect on the map, also enabling player flashlights (Christmas night theme)
// --| Value: 1 / 0
// --| Explanation: Enabled / Disabled
aio_winter_darkness "1"

// --| Enabled custom themed bomb event sounds ( Planted, Exploded, Defused )
// --| Value: 1 / 0
// --| Explanation: Enabled / Disabled
aio_winter_bombsounds "1"

// --| Some clients does not have "cl_weather" variable set to 1, 2 or 3 in their main game client
// --| After they entered the server, yhis will enable a menu, reminding/teaching them how to enable snow effects on their client
// --| Has an option to auto set-up for them, WITH THEIR PERMISSION !
// --| Value: 1 / 0
// --| Explanation: Enabled / Disabled
aio_winter_weathermenu "1"

// --| If the previous cvar is set as Enabled, after how long will display the menu to the player?
// --| Value: < x seconds > in seconds. Must be a floating point number
// --| Explanation: aio_winter_weathermenu "10.0" - Will display the menu after 10 seconds
aio_winter_weathermenu "8.0"

// --| Bomb model replacement with a shiny Snow-Man
// --| Value: 1 / 0
// --| Explanation: Enabled / Disabled
aio_winter_custombomb "1"

// --| A shiny, AWESOME musical tree with custom lights, effects and christmas themed song!
// --| Spawned on each side of CT/T spawns.
// --| Value: 1 / 0 - NOTE: Cvars are affected after map change!
// --| Explanation: Enabled / Disabled
aio_winter_tree "1"

// --| Enable santa hats for each players! Yoinnkss!
// --| Value: 1 / 0
// --| Explanation: Enabled / Disabled
aio_winter_hat "1"

// --| If Santa Hats are enabled, are them only for ADMINS ?
// --| Value: 1 / 0
// --| Explanation: Admin Only / Everyone
aio_winter_hat_adminonly "0"

// --| Spawn Christmas presents on dead enemies. Can be picked up by anyone!
// --| When picked up, you will be granted with a random gift.
// --| Gifts:
// --| * Armor
// --| * Armor + Helmet
// --| * Some Ammunition
// --| * Bonus Health
// --| * Random Grenade (HE, FB, SG)
// --| * Bonus Frag/s
// --| * Invisibility (for a certain amount of time)
// --| * Random Glow
// --| * Random Glow on your Santa Hat (lasts one round, only if hats are enabled)
// --| * Defuser Kit (for CT only)
// --| * Camouflage: [You look like enemy until you die]
// --| * Money ( a certain amount )
// --| Value: 1 / 0
// --| Explanation: Enabled / Disabled
aio_winter_presents "1"

// --| If the gifts are enabled, when you pick up the "Bonus Health", how much HP should be added to player?
// --| Value: < x amount > - from 0 to 99999?
// --| Explanation aio_winter_bonus_health_amount "250" - Adds additional 250 HP to the player
aio_winter_bonus_health_amount "50"

// --| If the gifts are enabled, when you pick up the "Armor" or "Armor + Helmet" how much AP should be added to player?
// --| Value: < x amount > - from 0 to 99999?
// --| Explanation: aio_winter_gift_armor "250" - Adds additional 250 AP to the player
aio_winter_gift_armor "100"

// --| If the gifts are enabled, when you pick up the "Bonus Frag/s" how many frags should be added to player?
// --| Value: < x amount > - from 0 to 99999?
// --| Explanation: aio_winter_bonus_frag "5" - 5 Frags will be added to the player
aio_winter_bonus_frag "2"

// --| If the gifts are enabled, when you pick up the "Invisibility" for how long shall be enabled?
// --| Value: < x amount > - from 0 to 99999?
// --| Explanation: aio_winter_invis_duration "5" - Invisiblity lasts 5 seconds
aio_winter_invis_duration "15"

// --| If the gifts are enabled, when you pick up the "Money" how much cash shall be added to player?
// --| Value: < x amount > - from 0 to 99999?
// --| Explanation: aio_winter_gift_money "1500" - $1500 will be added to the player
aio_winter_gift_money "1500"

// --| Enable support for rainy maps. Removing rain from it and replacing it with snow
// --| Value: 1 / 0
// --| Explanation: Enabled / Disabled
aio_winter_rainymap_support "1"

// --| Replace the default knife model with a candy cane!
// --| Value: 1 / 0
// --| Explanation: Candy Cane / Default Knife
aio_winter_candyknife "1"

// --| Replace all grenades ( Flashbang, He, Smoke ) with a custom Christmas themed model
// --| Also adds render and trail for each of them
// --| Value: 1 / 0
// --| Explanation: Custom Grenades / Default Grenades
aio_winter_grenade "1"

// --| If the previous cvar is enabled, we have three options to set up this one, to differentiate the grenades between them.
// --| Value: 0 / 1 / 2
// --| Explanation: 0 - All grenades has a white glow/trail
// --|             1 - HE Grenade has a red glow/trail, FB Grenade has a blue glow/trail and SG Grenade has a green glow/trail
// --|             2 - All grenades has random glow/trail        
// --| -------------------------------------------------------------------------
aio_winter_grenade_type "0"
  • I would recomment a sv_downloadurl for fast downloading, since this plugin contains a "few" resources
  • Client side cvar enabled: cl_weather 1/2/3
  • Latest AMX Mod X Version Guide:
  • Place the AIO_Winter.cfg file into addons/amxmodx/configs folder
  • Place the aio_winter sounds folder into cstrike/sounds/ server directory
  • Place the aio_winter models folder into cstrike/models/ server directory
  • Place the AIO_Winter.amxx file into cstrike/addons/amxmodx/plugins/ server directory
  • Open plugins.ini file located into addons/amxmodx/configs/plugins.ini and add AIO_Winter.amxx then save it.
  • Done.
  • xPaw
  • Alka
  • ConnorMcLeod
  • VEN
  • v3x
  • HamletEagle
  • Others
  • cstrike
  • engine
  • fakemeta
  • fun
  • hamsandwich Demonstration:

It is a 10 minutes gameplay with bots, you can skip thorough it and see new additions along with the demonstration of this plugin
Video has been uploaded now, so until youtube renders to high quality, expect 360p



georgik57 12-22-2015 14:20

Re: AIO: Winter Plugin
Nice job.

My only objection is that all the grenades have the same model and that, for most of the models, you could of made a single model with sub-models in order to have less resources precached so we don't get closer to the almighty 512 limit(which I can help you with if you want).

I also was too lazy to read all the cvars. Are the gameplay-modifying features optional?

tuty 12-22-2015 14:40

Re: AIO: Winter Plugin
I have no clue in 3d modelling so, if you could help me would be great.
Yes, grenades are replaced with same model since all of them act like a snowball.
Check the video. I recorded every aspect during my shitty gameplay where I can't even kill bots lol. And yes, everything listed in there can be disabled.

HamletEagle 12-22-2015 15:00

Re: AIO: Winter Plugin
Yes, Christmas stuff :D

Well, I have some things to say, if you don't mind.

1.register_forward( FM_Touch, "forward_FM_Touch" ) I would like you to use engine here. FM_Touch catch all touch between all entities, and this is bad for server resources. While you filter them and execute your code only when needed the forward is still fired all the time. With engine you can filter by classnames(touched, toucher) so the forward will be called only when needed. szMapName[ 25 ]; should be 32, that is the max size used by engine.
3.In the menu you can not use the info param(3 rd one - because you don't need it) thus in menu handler you could use directly item in the switch(so no longer needing menu_item_getinfo).
4.In EVENT_RoundStart and LOGEvent_Round_Start you have the exact same code, you can create a function for this code and call it from the two events. Repeating code is ugly.
5.bacon_GrenadeDeploy make sure iWeaponEntity is valid before retrieving it's pdatas. Also make sure the owner is alive. Same for bacon_KnifeDeploy
6.In EVENT_DeathMsg:
  • You allocate the string each time, but this is an expensive operation. You can cache engfunc( EngFunc_AllocString, "info_target" ) in plugin _init.
  • Returning PLUGIN_HANDLED could make confusions, simply return would be more appropiate.
7.Finding bomb entity by model it's a poor way. You have multiple ways:
  • Hook BombDropevent with correct filters to be sure you get the moment when bomb is planted: register_event("BombDrop", "OnBombDrop", "a", "4=1"). Loop all grenade entities and check if m_bIsC4 offset is true. Then, you got your C4 entity index. I would do it like this.
  • Use orpheu(but I don't think you will, and it's not really needed here) you could hook CGrenade::ShootSatchelCharge. This function creates the bomb entity, so you will have the index.
There are more ways, bot not so reliable.
8.Remove the stock keyword from your functions. That is used for things that may not be needed(like in an include file where not all functions will be used at same time). IMO it's misused in a plugin.
9.UTIL_GiveWeaponAmmo: use cs_get_user_bpammo, and as weapon index to get_user_weapon(id). It should be a bit better.

georgik57 12-22-2015 15:01

Re: AIO: Winter Plugin

Originally Posted by tuty (Post 2375238)
I have no clue in 3d modelling so, if you could help me would be great.

Sure. You know where to find me. I'll also tell you when I have free time.


Originally Posted by tuty (Post 2375238)
Yes, grenades are replaced with same model since all of them act like a snowball.

The point was that you can't recognize them. So they either need different models, trails and/or HUD icons.


Originally Posted by tuty (Post 2375238)
Check the video. I recorded every aspect during my shitty gameplay where I can't even kill bots lol. And yes, everything listed in there can be disabled.

Nice ^_^

I also have a few suggestions:
Don't spawn the "snowflake" hit sprite when hitting a player or remove it fast because it looks weird hanging in the air.
Be careful with the light messages because they often lower the client FPS(DLIGHT for example).

tuty 12-22-2015 15:03

Re: AIO: Winter Plugin
Hamlet - was expecting you here
Georgik - thanks for the info, i will add your suggestions


HamletEagle 12-23-2015 13:26

Re: AIO: Winter Plugin
1.You have some indentation problems, please fix them.
2.Recheck point 1 from previous list, please use register_touch.
3.I think you should not limit rain removal only to de_aztec. Maybe there are more maps that use env_rain, so you should remove map check and search for env_rain(find_ent_by_class), if you find one remove it and print the message.
4.szFile[80] I am not sure if 80 is enough, configs dir path can be easely changed from core.ini, you could put more(something like 256, IIRC this is the max dimension of a path).
5.In forward_TouchGift checking both IS_PLAYER and is_user_alive is not needed. Keep only is_user_alive, because the native already check what you were doing with IS_PLAYER.
6.In forward_FM_PlaybackEvent do not make vars in a loop, declare them before.

Well, only this.

tuty 12-23-2015 13:28

Re: AIO: Winter Plugin
okay sharp eye. i used register touch. kappa

indentation problems? what editor you're using? cuz i use notepad and it's all good

HamletEagle 12-23-2015 13:49

Re: AIO: Winter Plugin
I still see register_forward( FM_Touch, "forward_FM_Touch" );.

tuty 12-23-2015 13:50

Re: AIO: Winter Plugin

Originally Posted by HamletEagle (Post 2375609)
I still see register_forward( FM_Touch, "forward_FM_Touch" );.

well because i use it to replace grenade w_ model and also to set trails?

updated with fixes.

All times are GMT -4. The time now is 17:48.

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