Raised This Month: $51 Target: $400
 12% 

[Help] Emit sound loop


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Barlap
Senior Member
Join Date: Apr 2016
Location: Romania
Old 12-08-2021 , 14:22   [Help] Emit sound loop
Reply With Quote #1

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 );
}
Barlap is offline
Send a message via ICQ to Barlap Send a message via Skype™ to Barlap
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-09-2021 , 07:05   Re: [Help] Emit sound loop
Reply With Quote #2

Have you tried spawning tree on new round instead of plugin_init?
__________________
DJEarthQuake is offline
Reply



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 12:25.


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