PlayPlayerSound:@
#1

I have a problem with PlayPlayerSound!
It wont work

Code:
if(checkpointid == nrg)
	{
	SendClientMessage(playerid,lgreen,"You won +2 score and 5000$");
	SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
	GivePlayerMoney(playerid,5000);
	TogglePlayerDynamicCP(playerid, checkpointid, false);
        PlayerPlaySound(playerid, 1098,0.0, 0.0, 0.0);
	}
Anyone?
Reply
#2

You need to put down the coordinates for the player:

pawn Code:
if(checkpointid == nrg)
    {
    SendClientMessage(playerid,lgreen,"You won +2 score and 5000$");
    SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
    GivePlayerMoney(playerid,5000);
    TogglePlayerDynamicCP(playerid, checkpointid, false);
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
        PlayerPlaySound(playerid, 1098,x, y, z);
    }
Reply
#3

if its any of the reward music, it wont work. but apsrt from that,everything looks ok
Reply
#4

Ah oK\ thanks

BTW does any of the Racing Tracks works like Music ones!
Reply
#5

The co ordinates are the offset of the player. They should always be 0.0, 0.0, 0.0 (Unless you want an offset...).
Reply
#6

you only need to put the co-ordinates of the player if you are changing them to create an ~offset~ sound effect. In that case you need to get their position, and use the co-ordinates. ( the offset is not in the same format as, say, holding objects)
eg
pawn Code:
PlayerPlaySound(playerid,1098,0.0,0.0,10.0); // will play the sound at 0,0,10 on the map
If you don't need to offset the sound, setting the co-ordinates to 0.0,0.0,0.0 will play the sound for the player to hear.

if you want to offset the sound
pawn Code:
new Float:px,Float:py,Float:pz;
GetPlayerPos(playerid,px,py,pz);
PlayPlayerSound(playerid,1098,px,py,pz+10); // will play the sound 10m above the player
This is explained in the wiki as such, but the example they give is incorrect
Reply
#7

It was my bad,it seems that some sounds just dont work which fails :@

Any suggestion on what Sound to use when someone Wins something? like a parkour ?
Reply
#8

LOL you all fail xD

SOUND_AWARD_TRACK_START 1097 (music)
SOUND_AWARD_TRACK_STOP 1098 (music)

Here. 1098 STOPS the track. 1097 starts looping it.

So you would start the track with 1097, and then play sound 1098 to stop it.

Did that help?
Reply
#9

Quote:
Originally Posted by CrucixTM
View Post
LOL you all fail xD

SOUND_AWARD_TRACK_START 1097 (music)
SOUND_AWARD_TRACK_STOP 1098 (music)

Here. 1098 STOPS the track. 1097 starts looping it.

So you would start the track with 1097, and then play sound 1098 to stop it.

Did that help?
whenever i try race track music it never works :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)