Raised This Month: $ Target: $400
 0% 

[Help] Emit sound loop


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 


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 11:30.


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