Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  1. #using scripts\codescripts\struct;
  2. #using scripts\shared\audio_shared;
  3. #using scripts\shared\callbacks_shared;
  4. #using scripts\shared\clientfield_shared;
  5. #using scripts\shared\exploder_shared;
  6. #using scripts\shared\scene_shared;
  7. #using scripts\shared\util_shared;
  8.  
  9. #insert scripts\shared\shared.gsh;
  10. #insert scripts\shared\version.gsh;
  11.  
  12. #using scripts\zm\_load;
  13. #using scripts\zm\_zm_weapons;
  14.  
  15. //Perks
  16. #using scripts\zm\_zm_pack_a_punch;
  17. #using scripts\zm\_zm_perk_additionalprimaryweapon;
  18. #using scripts\zm\_zm_perk_doubletap2;
  19. #using scripts\zm\_zm_perk_deadshot;
  20. #using scripts\zm\_zm_perk_juggernaut;
  21. #using scripts\zm\_zm_perk_quick_revive;
  22. #using scripts\zm\_zm_perk_sleight_of_hand;
  23. #using scripts\zm\_zm_perk_staminup;
  24. #using scripts\zm\_zm_perk_widows_wine;
  25.  
  26. //Powerups
  27. #using scripts\zm\_zm_powerup_double_points;
  28. #using scripts\zm\_zm_powerup_carpenter;
  29. #using scripts\zm\_zm_powerup_fire_sale;
  30. #using scripts\zm\_zm_powerup_free_perk;
  31. #using scripts\zm\_zm_powerup_full_ammo;
  32. #using scripts\zm\_zm_powerup_insta_kill;
  33. #using scripts\zm\_zm_powerup_nuke;
  34.  
  35. //Traps
  36. #using scripts\zm\_zm_trap_electric;
  37.  
  38. #using scripts\zm\zm_usermap;
  39. #define SNOW_FX "dlc0/factory/fx_snow_player_os_factory"
  40. #precache( "client_fx", SNOW_FX );
  41.  
  42. function main()
  43. {
  44. callback::on_localplayer_spawned( &on_localplayer_spawned );
  45.  
  46. level.weather_intensity = 0.3;
  47. clientfield::register( "world", "weather_intensity", VERSION_SHIP, 2, "int", &weather_intensity, !CF_HOST_ONLY, !CF_CALLBACK_ZERO_ON_NEW_ENT );
  48.  
  49. zm_usermap::main();
  50.  
  51. include_weapons();
  52.  
  53. util::waitforclient( 0 );
  54.  
  55. }
  56.  
  57. function on_localplayer_spawned( localClientNum )
  58. {
  59. if( self == GetLocalPlayer( localClientNum ) )
  60. self thread falling_snow(localClientNum);
  61. }
  62.  
  63. function falling_snow(localClientNum)
  64. {
  65. self endon( "disconnect" );
  66. self endon( "entityshutdown" );
  67. self endon( "death" );
  68. while(1)
  69. {
  70. if(level.weather_intensity == 0)
  71. {
  72. wait .1;
  73. continue;
  74. }
  75. PlayFX( localClientNum, SNOW_FX, self.origin );
  76. wait level.weather_intensity;
  77. }
  78. }
  79. function weather_intensity( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
  80. {
  81. // If value = 0 that will stop the weather
  82. // Lower the numbers to increase intensity ( Cannot go below 0 )
  83.  
  84. switch(newVal)
  85. {
  86. case 0:
  87. level.weather_intensity = 0;
  88. break;
  89. case 1:
  90. level.weather_intensity = 0.1;
  91. break;
  92. case 2:
  93. level.weather_intensity = 0.15;
  94. break;
  95. case 3:
  96. level.weather_intensity = 0.05;
  97. break;
  98. }
  99. }
  100.  
  101. function include_weapons()
  102. {
  103. zm_weapons::load_weapon_spec_from_table("gamedata/weapons/zm/zm_levelcommon_weapons.csv", 1);
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement