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

emit_sound function


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
A k c 3 n 7
Junior Member
Join Date: Oct 2014
Location: Romania
Old 09-16-2017 , 12:58   emit_sound function
Reply With Quote #1

i have this code
Code:
emit_sound(id, CHAN_AUTO, g_szPlantSound[0], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
but i want to hear just TERO team
__________________


Last edited by A k c 3 n 7; 09-16-2017 at 12:58.
A k c 3 n 7 is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 09-16-2017 , 13:22   Re: emit_sound function
Reply With Quote #2


new players[32], num, iplayer;
get_players(players, num, "ceh", "TERRORIST");
for (new i = 0, i < num, i++){
iplayer = player[i];
emit_sound(iplayer, ...);
}

------

if (cs_get_user_team(id) = CS_TEAM_T){
emit_sound(id, ...);
}
__________________
Relaxing is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 09-16-2017 , 13:40   Re: emit_sound function
Reply With Quote #3

@Relaxing it doesn't work this way.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
A k c 3 n 7
Junior Member
Join Date: Oct 2014
Location: Romania
Old 09-16-2017 , 14:10   Re: emit_sound function
Reply With Quote #4

yeah... nothing
__________________

A k c 3 n 7 is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 09-16-2017 , 15:38   Re: emit_sound function
Reply With Quote #5

Quote:
Originally Posted by PRoSToTeM@ View Post
@Relaxing it doesn't work this way.
I was a bit confused about get_players. I thought that it could output function/s to certain id's. Could that be a suggestion for the next 1.9?
__________________
Relaxing is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 09-16-2017 , 15:52   Re: emit_sound function
Reply With Quote #6

I already answered on the other forum, but I guess it might be helpful for other people looking for this as well
https://forums.alliedmods.net/showpo...07&postcount=5
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 09-16-2017 , 16:17   Re: emit_sound function
Reply With Quote #7

Code:
new players[32], pnum get_players(players, pnum, "e", "TERRORIST") new id for (--pnum; pnum >= 0; pnum--) {       id = players[pnum]       emit_sound(id, channel, sample, vol, attn, flags, pitch) }

Set the 'a' flag on get_players to get only alive players.
__________________









Last edited by CrazY.; 09-16-2017 at 16:18.
CrazY. is offline
Old 09-16-2017, 20:46
kristi
This message has been deleted by kristi. Reason: i was wrong :/
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 09-16-2017 , 22:26   Re: emit_sound function
Reply With Quote #8

Hm? Why?
__________________








CrazY. is offline
generalmemer
Member
Join Date: Sep 2017
Old 09-16-2017 , 23:33   Re: emit_sound function
Reply With Quote #9

This should be ok
Code:
new Players[32], PlayersNum, id; get_players(Players, PlayersNum, "ceh", "TERRORIST")     for( new i; i < PlayersNum; i++ ) {     id = Players[i];     emit_sound(id, CHAN_AUTO, g_szPlantSound[0], VOL_NORM, ATTN_NORM, 0, PITCH_NORM); }
PHP Code:
/*
"c" - do not include bots
"e" - match with team
"h" - do not include HLTV proxies
 */ 
generalmemer is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 09-17-2017 , 04:21   Re: emit_sound function
Reply With Quote #10

SVC_SOUND is the answer. Just loop and send it to the each client you need.
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
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 04:23.


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