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=607891)



PlayerPlaySound - GeneralAref - 25.05.2016

i can't hear sound in this plz help me:
Код:
public OnPlayerRequestClass(playerid,classid){
	SetPlayerInterior(playerid,17);
	SetPlayerPos(playerid,480.8415,-14.3506,1000.6797);
	SetPlayerFacingAngle(playerid,271.6728);
	SetPlayerCameraPos(playerid,491.7506,-13.9768,1001.6797);
	SetPlayerCameraLookAt(playerid,480.8415,-14.3506,1000.6797);
	PlayerPlaySound(playerid,1097,491.7506,-13.9768,1001.6797);
	ApplyAnimation(playerid,"DANCING","dance_loop",4.0,1,0,0,0,0);
	if(classid==0){
	    PlayerPlaySound(playerid,1097,491.7506,-13.9768,1001.6797);
	    ApplyAnimation(playerid,"DANCING","dance_loop",4.0,1,0,0,0,0);}
	return 1;}



Re: PlayerPlaySound - Lucky13 - 25.05.2016

Код:
public OnPlayerRequestClass(playerid,classid)
{
	SetPlayerInterior(playerid,17);
	SetPlayerPos(playerid,480.8415,-14.3506,1000.6797);
	SetPlayerFacingAngle(playerid,271.6728);
	SetPlayerCameraPos(playerid,491.7506,-13.9768,1001.6797);
	SetPlayerCameraLookAt(playerid,480.8415,-14.3506,1000.6797);
	PlayerPlaySound(playerid,1097,0.0,0.0,0.0);
	ApplyAnimation(playerid,"DANCING","dance_loop",4.0,1,0,0,0,0);
	return 1;
}



Re: PlayerPlaySound - GeneralAref - 25.05.2016

not work.


Re: PlayerPlaySound - BloodyRP - 25.05.2016

Maybe ur Ingame volume is disabled?


Re: PlayerPlaySound - GeneralAref - 25.05.2016

volume is enabled.


Re: PlayerPlaySound - Darkwood17 - 25.05.2016

Why are you using the same functions with the same parameters twice?
Use 0.0 as parameter for no position:
Код:
public OnPlayerRequestClass(playerid,classid)
{
	PlayerPlaySound(playerid, 1097, 0.0, 0.0, 0.0);
	SetPlayerInterior(playerid, 17);
	SetPlayerPos(playerid, 480.8415, -14.3506, 1000.6797);
	SetPlayerFacingAngle(playerid, 271.6728);
	SetPlayerCameraPos(playerid, 491.7506, -13.9768, 1001.6797);
	SetPlayerCameraLookAt(playerid, 480.8415, -14.3506, 1000.6797);
	ApplyAnimation(playerid, "DANCING", "dance_loop", 4.0, 1, 0, 0, 0, 0);
	if(classid == 0)
	{
	    // Do something
	}
	return 1;
}
But I doubt that the sound will play when it's used in OnPlayerRequestClass(), so try putting the function under the OnPlayerConnect() callback (or somewhere else) instead:
Код:
public OnPlayerConnect(playerid)
{
	PlayerPlaySound(playerid, 1097, 0.0, 0.0, 0.0);
	return 1;
}