Raised This Month: $ Target: $400
 0% 

Attach a sound?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
DotNetJunkie
Senior Member
Join Date: May 2005
Location: In front of my pc
Old 05-13-2005 , 09:13  
Reply With Quote #6

well here is my code

Code:
policeradio_resetall() {
	new query[256], players[32], num
	get_players(players,num,"ac")
	for(new i = 0; i < num; i++) {
		if(is_user_connected(players[i])) {
			if(is_user_alive(players[i])) {
				new name[33], authid[32]
				get_user_name(players[i],name,sizeof(name))
				get_user_authid(players[i],authid,31)
    			format( query, 255, "SELECT JobID FROM money WHERE steamid='%s'", authid )
    			result = dbi_query(dbc,query) 
				if( dbi_nextrow( result ) > 0 )
				{ 
	 				new job[32], JobID
	 				dbi_field( result, 1, job, 31) 
	 				dbi_free_result(result)
	 				JobID = str_to_num(job)
	 				if((JobID >= mcpdjobs[0] && JobID <= mcpdjobs[1]))
	 				{
		 				if(policeradio[players[i]]>0) {
			 				policeradio_reset(players[i])
		 				}
	 				}
 				}
 				dbi_free_result(result)
			}
		}
	}
	return 0
}

policeradio_reset(id) {
	policeradio_off(id)
	if(policeradioindex[id]==0) {
		emit_sound(id, CHAN_VOICE, "harburp/policeradiochatter_0.wav", 1.0, ATTN_NORM, SND_PLAY, PITCH_NORM)
	}	
	if(policeradioindex[id]==1) {
		emit_sound(id, CHAN_VOICE, "harburp/policeradiochatter_1.wav", 1.0, ATTN_NORM, SND_PLAY, PITCH_NORM)
	}
	return 0
}

policeradio_off(id) {
	if(policeradioindex[id]==0) {
		emit_sound(id, CHAN_VOICE, "harburp/policeradiochatter_0.wav", 0.0, ATTN_NORM, SND_STOP, PITCH_NORM)
	}
	if(policeradioindex[id]==1) {
		emit_sound(id, CHAN_VOICE, "harburp/policeradiochatter_1.wav", 0.0, ATTN_NORM, SND_STOP, PITCH_NORM)
	}
	return 0
}

policeradio_on(id) {
	policeradio_off(id)
	new policeindex = random_num(0,1)
	if(policeindex==0) {
		emit_sound(id, CHAN_VOICE, "harburp/policeradiochatter_0.wav", 1.0, ATTN_NORM, SND_PLAY, PITCH_NORM)
	}
	if(policeindex==1) {
		emit_sound(id, CHAN_VOICE, "harburp/policeradiochatter_1.wav", 1.0, ATTN_NORM, SND_PLAY, PITCH_NORM)
	}
	policeradioindex[id] = policeindex
	return 0
}
Whenever a player spawns for the first time, policeradio_resetall is called
so they can hear it.
__________________
DotNetJunkie is offline
Send a message via ICQ to DotNetJunkie Send a message via AIM to DotNetJunkie Send a message via MSN to DotNetJunkie Send a message via Yahoo to DotNetJunkie
 



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 16:44.


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