Raised This Month: $30 Target: $400
 7% 

Sound and fog problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
D3nyo
Junior Member
Join Date: Sep 2017
Old 11-26-2020 , 09:16   Sound and fog problem
Reply With Quote #1

Hi,
I have a plugin that put some effects when u plant the C4 and the problem is, if T plant the bomb and win, sound and fog stil remain until next round....

Code:
/*.qggL  *  .gggr.  .         '            .              *            .     + 
  PMML  . /|MM        '.       +                    '                  
  |!MM,' /`|MM  .d/"q,  qgg;+Ml qgg;+Ml vgg. .y.            Vv   Vv   Vv   Vv
  | YMM,j' |MM  MM;.jMl |MM` "  |MM` "   qM| j`   x  O      o,   o,   o,   o,
  |  qM#'  |MM  MM|     |MM  +  |MM    .  MMg'  /(_){-}+--===--===--===--===
.j|.  qF  .+MM..'MMbxr` jMM.    jMM.  *   'MF   \=====/   > >  > >  > >  > >
 .   *                                  x, /
  .x/--\xxl ,xx     .   *     ,gb       v#' .        . '                 *
.dMT    'q| |MM  '            '"'         .dM               *
dMM  *    ` |MM/dMg,  qgg;+Ml qgg  j/"`+  qMM-. qgg/dM#,w#Mb  ,g'`fg, j/"`+
MMM    .'   |MM  MM|  |MM` "  |MM  MMbx/  |MM   |MM  |M|  MM  `p'. M| MMbx/
'MMl  +   . |MM  MM|  |MM  .  |MM  .`vMMl |MM   |MM  |M|  MM  , ,!. | .`vMMl
 'vMb...r/` jMM..MM|. jMM.  + jMM. +,.,P' 'MMx: jMM..dM|..MM, M j't | +,.*/


#include < amxmodx > 
#include < cstrike >
#include < engine >
#include < ColorChat >
native csgo_set_user_points(id, amount);
native csgo_get_user_points(id);

/*===========================================================================*/

new const FogDensity[] = { 0, 0, 0, 0, 111, 18, 3, 58, 111, 18, 125, 58, 66, 96, 27, 59, 90, 101, 60, 59, 90,
                                                                                                                                                                 101, 68, 59, 10, 41, 95, 59, 111, 18, 125, 59, 111, 18, 3, 60, 68, 116, 19, 60 }

new const TASK_FOG = 112

new RGB[3];
new CVAR[2];

new const PlantedSound[ ] = "xmas/xmas_bomb_planted.mp3";

public plugin_init( ) {

      register_plugin("[XMAS] Bomb Events", "1.0", "A k c 3 n 7"); 
      register_logevent("logevent_round_end", 2, "1=Round_End"); 

      CVAR[0] = register_cvar("Fog", "1"); 
      CVAR[1] = register_cvar("Dens", "1");

      RGB[0] = 0;
      RGB[1] = 179;
      RGB[2] = 255;
}

public plugin_precache( ) {

       precache_sound(PlantedSound);
//     engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_snow"));
}   

public bomb_planted( Client ) {

  
       PlaySoundToClients (PlantedSound);
       
       static Nume[32];
       get_user_name( Client, Nume, sizeof ( Nume ) -1 );
   
       csgo_set_user_points(Client, csgo_get_user_points(Client) + 300);
       ColorChat(0, GREEN, "^x04 [XMAS]^x03 Player^x04 %s^x03 a primit^x04 300$^x03 pentru ca a impodobit Bradul", Nume);

       /*==========================================================================================================*/

       set_cvar_string("Fog", "1") 
       set_task(0.1, "TaskFog", TASK_FOG, _, _, "b")
}

public logevent_round_end( ) {

       set_cvar_string("Fog", "0")
}

public bomb_defused( Client ) {
       
       static Nume[32];
       get_user_name( Client, Nume, sizeof ( Nume ) -1 );

       csgo_set_user_points(Client, csgo_get_user_points(Client) + 300); 
       ColorChat(0, GREEN, "^x04 [XMAS]^x03 Player^x04 %s^x03 a primit^x04 300$^x03 pentru ca a salvat Craciunul", Nume);  
}
      /*==================================================================================================================*/
 
public TaskFog( ) {

   static density
   density = (4 * get_pcvar_num(CVAR[1]))

   if(get_pcvar_num(CVAR[0]) == 1) {

      message_begin(MSG_ALL, get_user_msgid("Fog"), {0,0,0}, 0);
      write_byte(RGB[0]);
      write_byte(RGB[1]);
      write_byte(RGB[2]);
      write_byte(FogDensity[density]);
      write_byte(FogDensity[density+1]); 
      write_byte(FogDensity[density+2]);
      write_byte(FogDensity[density+3]);
      message_end();   
   }
   else 
   {
      message_begin(MSG_ALL, get_user_msgid("Fog"), {0,0,0}, 0);
      write_byte(0);
      write_byte(0);
      write_byte(0);
      write_byte(0);
      write_byte(0);
      write_byte(0);
      write_byte(0);
      message_end();
   }

   return PLUGIN_CONTINUE;
}

PlaySoundToClients ( const sound [ ] )
{
        if ( equal ( sound [ strlen ( sound ) -4 ], ".mp3" ) )
                client_cmd ( 0, "mp3 play ^"sound/%s^"", sound );
        else
                client_cmd ( 0, "spk ^"%s^"", sound );
}
D3nyo is offline
Reply


Thread Tools
Display Modes

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 01:22.


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