SA-MP Forums Archive
PlayerPlaySound - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: PlayerPlaySound (/showthread.php?tid=651770)



PlayerPlaySound - Clergy - 27.03.2018

Oui mates, I wanted to know how to play a sound through "PlayerPlaySound" to players nearby the person who enters a CMD. Can you give me an example? Thank you fucking much <3.


Re: PlayerPlaySound - ForCop - 27.03.2018

Quote:
Originally Posted by Clergy
Посмотреть сообщение
Oui mates, I wanted to know how to play a sound through "PlayerPlaySound" to players nearby the person who enters a CMD. Can you give me an example? Thank you fucking much <3.
https://sampwiki.blast.hk/wiki/PlayerPlaySound


Re: PlayerPlaySound - Clergy - 27.03.2018

Quote:
Originally Posted by ForCop
Посмотреть сообщение
But that only plays it to the player, I want to it to play for the nearby players too!


Re: PlayerPlaySound - ForCop - 27.03.2018

Quote:
Originally Posted by Clergy
Посмотреть сообщение
But that only plays it to the player, I want to it to play for the nearby players too!
Код:
CMD:sond(playerid, params[])
{
	new Float:x,Float:y,Float:z;
	GetPlayerPos(playerid, x, y, z);
	for(new i=0; i<MAX_PLAYERS; i++){
		if(!IsPlayerConnected(i)) continue;
		if(IsPlayerInRangeOfPoint(i, 10.0, x,y,z)){ //add radius
			PlayerPlaySound(i, 36401,0.0,0.0,0.0); // add id sond
		}
	}
	return true;
}