PLAYING OWN TRACK!
#1

Hi!

I saw, that in some servers while skin selection music is playing! How to do that? I wanna play my own track!
Reply
#2

Use the audio plugin or PlayPlayerSound.
Reply
#3

https://sampwiki.blast.hk/wiki/PlayerPlaySound

https://sampforum.blast.hk/showthread.php?tid=82162
Reply
#4

Where can I find PlayPlayerSound? The function I mean! Is there a thread?
Reply
#5

https://sampwiki.blast.hk/wiki/PlayerPlaySound

So just add like PlayerPlaySound(playerid, 1097, 0.0, 0.0, 0.0); when the setting up the player for class selection and then do PlayerPlaySound(playerid, 1186, 0.0, 0.0, 0.0); in public OnPlayerSpawn(playerid).

Edit: Damn I'm slow at posting 3 posts while I was writing xD


Edit 2:
Quote:
Originally Posted by samtey
Посмотреть сообщение
Where can I find PlayPlayerSound? The function I mean! Is there a thread?
The function is included in the regular sa-mp server package..
Reply
#6

The second PlayerplaySound under OnPlayerSpawn, ok, and the first?
Reply
#7

Quote:
Originally Posted by samtey
Посмотреть сообщение
The second PlayerplaySound under OnPlayerSpawn, ok, and the first?
At OnPlayerConnect or public OnPlayerRequestClass(playerid, classid) or both of them.
Reply
#8

The first at OnPlayerRequestClass and the second one at OnPlayerSpawn!
Right?

Well, does the music stop when the player chose his skin and gets spawn at his place?
Reply
#9

Yes the music will stop when you spawn PlayerPlaySound(playerid, 1186, 0.0, 0.0, 0.0); stops the music id 1186 is the stop id for that music. https://sampwiki.blast.hk/wiki/SoundID
Reply
#10

Hmm, he gave me one error:

Код:
D:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\gamemodes\deathmatch.pwn(184) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
But I defined already:

pawn Код:
new PlayerInfo[MAX_PLAYERS][pInfo];

Here the line:

PHP код:
PlayerPlaySound(playerid11830.00.00.0); 





Oh, and something else! Should I use ID 1186 for every track to stop?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)