Raised This Month: $ Target: $400
 0% 

who hears the sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
anakonda001
Member
Join Date: Jul 2020
Old 08-22-2020 , 07:52   who hears the sound
Reply With Quote #1

guys how to make the sound heard only by the player himself

Code:
if(++g_Frags[iAttacker] == NEADED_FRAGS)
	{
		ChatColor(iAttacker, "%s !yYou have entered the necessary frags", PREFIX);
                emit_sound(id, CHAN_AUTO, FRAG_SOUNDS[1], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
	}
}
the error here emit_sound(id,

when I put "0" it works, but "id" does not

Last edited by anakonda001; 08-22-2020 at 07:58.
anakonda001 is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 08-22-2020 , 08:45   Re: who hears the sound
Reply With Quote #2

Show the enitre function, maybe you don't have that index.
EDIT: Use "iAttacker" instead of "id" because your attacker index is iAttacker not id
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]

Last edited by Shadows Adi; 08-22-2020 at 08:45.
Shadows Adi is offline
anakonda001
Member
Join Date: Jul 2020
Old 08-22-2020 , 09:18   Re: who hears the sound
Reply With Quote #3

Quote:
Originally Posted by Shadows Adi View Post
Show the enitre function, maybe you don't have that index.
EDIT: Use "iAttacker" instead of "id" because your attacker index is iAttacker not id
no enitre
anakonda001 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-22-2020 , 09:52   Re: who hears the sound
Reply With Quote #4

use
Code:
client_cmd(iAttacker, "spk ^"%s^"", FRAG_SOUNDS[1])

instead of emit_sound
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 08-22-2020 at 09:52.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
anakonda001
Member
Join Date: Jul 2020
Old 08-22-2020 , 10:07   Re: who hears the sound
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
use
Code:
client_cmd(iAttacker, "spk ^"%s^"", FRAG_SOUNDS[1])

instead of emit_sound
iAttacker if it doesn't work, then all the players will hear the sounds
anakonda001 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-22-2020 , 12:05   Re: who hears the sound
Reply With Quote #6

Not sure what you mean, but variable iAttacker should be a valid player index ( 1 <= iAttacker <= 32)

And again post the full code or at least the function so we can process what's going on inside the function.

And if you have no idea how to code post in suggestions and requests forum.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 08-22-2020 at 12:08.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
anakonda001
Member
Join Date: Jul 2020
Old 08-22-2020 , 12:19   Re: who hears the sound
Reply With Quote #7

Quote:
Originally Posted by Natsheh View Post
Not sure what you mean, but variable iAttacker should be a valid player index ( 1 <= iAttacker <= 32)

And again post the full code or at least the function so we can process what's going on inside the function.

And if you have no idea how to code post in suggestions and requests forum.
Code:
public Ham_PlayerKilled_Post(iVictim, iAttacker)
{
	if(!is_user_connected(iAttacker) || iVictim == iAttacker)
	{
		return;
	}

	if(g_bUserHero[iAttacker])
	{
		return;
	}

	if(++g_Frags[iAttacker] == NEADED_FRAGS)
	{
		ChatColor(iAttacker, "%s !yYou have entered the necessary frags", PREFIX);
	}
}

Last edited by anakonda001; 08-22-2020 at 12:20.
anakonda001 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 13:48.


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