SA-MP Forums Archive
PLAYING OWN TRACK! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: PLAYING OWN TRACK! (/showthread.php?tid=272985)



PLAYING OWN TRACK! - samtey - 30.07.2011

Hi!

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


Re: PLAYING OWN TRACK! - Snipa - 30.07.2011

Use the audio plugin or PlayPlayerSound.


Re: PLAYING OWN TRACK! - MadeMan - 30.07.2011

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

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


AW: PLAYING OWN TRACK! - samtey - 30.07.2011

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


Re: PLAYING OWN TRACK! - robanswe - 30.07.2011

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..


AW: PLAYING OWN TRACK! - samtey - 30.07.2011

The second PlayerplaySound under OnPlayerSpawn, ok, and the first?


Re: AW: PLAYING OWN TRACK! - robanswe - 30.07.2011

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.


AW: PLAYING OWN TRACK! - samtey - 30.07.2011

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?


Re: PLAYING OWN TRACK! - robanswe - 30.07.2011

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


AW: PLAYING OWN TRACK! - samtey - 30.07.2011

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?