Hello, can somebody help me with a code piece for this plugin.
I want to make the xmas tree emit music non stop but the music stops when u join any team
Here is the code:
Code:
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >
new const MODEL[ ] = "models/icero_events/xmas/ice_tree.mdl";
new const SONG[ ] = "icero_events/tree_xmas.wav";
#define AMBIENT_SOUND_LARGERADIUS 8
public plugin_precache( ) {
precache_model( MODEL );
precache_sound( SONG );
}
public plugin_init( ) {
register_plugin( "Xmas Tree", "Deathrun", "xPaw" );
new iSpawn = engfunc( EngFunc_FindEntityByString, FM_NULLENT, "classname", "info_player_start" );
if( !iSpawn ) return;
new iEntity = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "ambient_generic" ) );
set_pev( iEntity, pev_message, SONG );
set_pev( iEntity, pev_spawnflags, AMBIENT_SOUND_LARGERADIUS );
set_pev( iEntity, pev_effects, EF_BRIGHTFIELD );
new Float:vOrigin[ 3 ];
pev( iSpawn, pev_origin, vOrigin );
set_pev( iEntity, pev_origin, vOrigin );
set_pev( iEntity, pev_health, 10.0 );
ExecuteHam( Ham_Spawn, iEntity );
engfunc( EngFunc_SetModel, iEntity, MODEL );
engfunc( EngFunc_DropToFloor, iEntity );
}