SA-MP Forums Archive
[HELP]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: [HELP]PlayerPlaySound (/showthread.php?tid=377963)



[HELP]PlayerPlaySound - glanz14 - 16.09.2012

Although he would like to reproduce No. 185 of player music, it does not reproduce at all.

Although he would like to pass music at the time of ClassSelection, it does not work at all.

Quote:

public OnPlayerRequestClass(playerid, classid)
{
SetupPlayerForClassSelection(playerid);
SetPlayerSpecialAction(playerid,5);
PlayerPlaySound(playerid, 1185, 0.0, 0.0, 10.0);
return 1;
}

Is it wrong now?


Re: [HELP]PlayerPlaySound - glanz14 - 16.09.2012

My SAMP version is 0.3d.


Re: [HELP]PlayerPlaySound - clarencecuzz - 16.09.2012

pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerSpecialAction(playerid,5);
    PlayerPlaySound(playerid, 1185, 0.0, 0.0, 10.0);
    return 1;
}



Re: [HELP]PlayerPlaySound - glanz14 - 16.09.2012

Quote:

public OnPlayerRequestClass(playerid, classid)
{
SetupPlayerForClassSelection(playerid);
SetPlayerSpecialAction(playerid,5);
PlayerPlaySound(playerid, 1185, 0.0, 0.0, 10.0);
return 1;
}

public SetupPlayerForClassSelection(playerid)
{
SetPlayerPos(playerid,-2093.3120,2312.8262,25.9141);
SetPlayerFacingAngle(playerid, 277.1146);
SetPlayerCameraPos(playerid,-2090.034179,2311.972167,26.926900);
SetPlayerCameraLookAt(playerid,-2093.3120,2312.8262,25.9141);
}

It has become like this.


Re: [HELP]PlayerPlaySound - BadgerLedger - 16.09.2012

Quote:
Originally Posted by glanz14
View Post
It has become like this.
Code:
public OnPlayerRequestClass(playerid, classid)
{
SetupPlayerForClassSelection(playerid);
SetPlayerSpecialAction(playerid,5);
return 1;
}

public SetupPlayerForClassSelection(playerid)
{
PlayerPlaySound(playerid, 1185, 0.0, 0.0, 10.0);
SetPlayerPos(playerid,-2093.3120,2312.8262,25.9141);
SetPlayerFacingAngle(playerid, 277.1146);
SetPlayerCameraPos(playerid,-2090.034179,2311.972167,26.926900);
SetPlayerCameraLookAt(playerid,-2093.3120,2312.8262,25.9141);
}



Re: [HELP]PlayerPlaySound - clarencecuzz - 16.09.2012

pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
    PlayerPlaySound(playerid, 1185, 0.0, 0.0, 0.0);
    SetPlayerPos(playerid,-2093.3120,2312.8262,25.9141);
    SetPlayerFacingAngle(playerid, 277.1146);
    SetPlayerCameraPos(playerid,-2090.034179,2311.972167,26.926900);
    SetPlayerCameraLookAt(playerid,-2093.3120,2312.8262,25.9141);
    SetPlayerSpecialAction(playerid,5);
    return 1;
}
This should work. Are you even having any problems with this? Or do you just want to know if it's right?


Re: [HELP]PlayerPlaySound - glanz14 - 16.09.2012

Thank you for the reply.

Although both were tried, music does not flow too.
It seems that it sounds if it is an ordinary sound effect, but only music does not flow.


Re: [HELP]PlayerPlaySound - BadgerLedger - 16.09.2012

i have no idea what you mean
PlayerPlaySound(playerid, 1183, 0.0, 0.0, 0.0);
try to replace that playerplaysound with the old one maybe?

edit:
if you have the cracked version of the game
it might not have the sound files so sound effects wont play


Re: [HELP]PlayerPlaySound - clarencecuzz - 16.09.2012

Sorry, I edited my post above and you might not have seen it.
pawn Code:
PlayerPlaySound(playerid, 1185, 0.0, 0.0, 0.0);
The floats should be 0 if you're playing it directly to the player.