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 >
/*==================================================================*/
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("RoundEnd", 2, "1=Round_End")
}
public plugin_precache( ) {
precache_sound(PlantedSound);
// engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_snow"));
}
public bomb_planted( Client ) {
PlaySoundToClients (PlantedSound);
new Name[32];
get_user_name( Client, Name, sizeof ( Name ) -1 );
cs_set_user_money(Client, cs_get_user_money(Client) + 300);
ColorChat(0, GREEN, "^x04 [XMAS]^x03 jucatorul^x04 %s^x03 a primit^x04 300$^x03 pentru ca a impodobit Bradul", Name);
/*==========================================================================================================*/
}
public bomb_planting(Client) {
if( is_user_bot( Client ) || is_user_hltv( Client ) )
return;
if( !task_exists( Client ) )
set_task( 0.1, "task_MakeFogToPlayer", Client, _,_, "b");
}
public task_MakeFogToPlayer( Client )
{
if( !is_user_connected( Client ) )
return;
MakeFog( Client, 255, 255, 255, 111, 18, 3, 58 );
}
public RoundEnd( Client ) {
remove_task( Client );
}
public bomb_defused( Client ) {
new Name[32];
get_user_name( Client, Name, sizeof ( Name ) -1 );
cs_set_user_money(Client, cs_get_user_money(Client) + 300);
ColorChat(0, GREEN, "^x04 [XMAS]^x03 jucatorul^x04 %s^x03 a primit^x04 300$^x03 pentru ca a salvat Craciunul", Name);
}
MakeFog( Client, const iRed, const iGreen, const iBlue, const iSD, const iED, const iD1, const iD2 )
{
new iMsgIdFog;
message_begin( Client == 0 ? MSG_ALL : MSG_ONE_UNRELIABLE, !iMsgIdFog ? ( iMsgIdFog = get_user_msgid( "Fog" ) ) : iMsgIdFog, {0, 0, 0}, Client );
write_byte( iRed ); // R
write_byte( iGreen ); // G
write_byte( iBlue ); // B
write_byte( iSD ); // SD
write_byte( iED ); // ED
write_byte( iD1 ); // D1
write_byte( iD2 ); // D2
message_end( );
}
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 );
}