I need help onplayer connect music -
kidx - 03.07.2011
Quote:
#include <a_samp>
OnPlayerConnect(playerid)
{
PlayerPlaySound(playerid,1183,418.1829,2533.8340,1 6.5637);//to play the sound
}
OnPlayerSpawn(playerid)
{
PlayerPlaySound(playerid,1183,418.1829,2533.8340,1 6.5637);//to stop the sound
}
|
I am trying to make a filter script that plays music when you connect like and stops when you spawn can anyone please help me out with this.
Re: I need help onplayer connect music -
Lorenc_ - 03.07.2011
Check if the Sound ID is right, if you're using a pirated version of GTA SA then no, it will not work out for you. Only purchased GTA SA copies play music and radios finely.
Re: I need help onplayer connect music -
kidx - 03.07.2011
i am just wondering if that code is right cause i get these errors.Also i am using steam version of GTA SA that should work right.
Quote:
C:\Users\kidx\Desktop\[GX]CopsnRobbers\filterscripts\spawn_music.pwn(12) : warning 203: symbol is never used: "OnPlayerConnect"
C:\Users\kidx\Desktop\[GX]CopsnRobbers\filterscripts\spawn_music.pwn(12) : warning 203: symbol is never used: "OnPlayerSpawn"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Warnings.
|
Re: I need help onplayer connect music -
Infamous - 03.07.2011
Remember that they are publics and should be written as:
Код:
public OnPlayerSpawn(playerid)
Also I don't think the steam version does work correctly, or atleast it never used too.
Re: I need help onplayer connect music -
kidx - 03.07.2011
Quote:
#include <a_samp>
public OnPlayerConnect(playerid)
{
PlayerPlaySound(playerid,1183,418.1829,2533.8340,1 6.5637);//to play the sound
}
public OnPlayerSpawn(playerid)
{
PlayerPlaySound(playerid,1183,418.1829,2533.8340,1 6.5637);//to stop the sound
}
|
so the code should look like this am I correct.
Re: I need help onplayer connect music -
Lorenc_ - 03.07.2011
Yes, though you might get a warning/error because the callbacks are not returning any value.
Re: I need help onplayer connect music -
Gertin - 03.07.2011
pawn Код:
#include <a_samp>
public OnPlayerConnect(playerid)
{
PlayerPlaySound(playerid,1183,418.1829,2533.8340,1 6.5637);//to play the sound
}
public OnPlayerSpawn(playerid)
{
PlayerPlaySound(playerid,1069,418.1829,2533.8340,1 6.5637);//to stop the sound
}
Song id 1069 stop the song .
Re: I need help onplayer connect music -
Infamous - 03.07.2011
As mentioned above you will need to return a value to ensure your code works correctly.
Код:
#include <a_samp>
public OnPlayerConnect(playerid)
{
PlayerPlaySound(playerid, 1183, 418.1829, 2533.8340, 1 6.5637); // Start Sound
return 1;
}
public OnPlayerSpawn(playerid)
{
PlayerPlaySound(playerid, 1069, 418.1829, 2533.8340, 1 6.5637); // Stop Sound
return 1;
}
Re: I need help onplayer connect music -
Sasino97 - 03.07.2011
Quote:
Originally Posted by Lorenc_
Check if the Sound ID is right, if you're using a pirated version of GTA SA then no, it will not work out for you. Only purchased GTA SA copies play music and radios finely.
|
I'm using a pirated version, but all works. The problem is that he didn't use the keyword "public"
Re: I need help onplayer connect music -
Mean - 03.07.2011
Quote:
Originally Posted by [GF]Sasino97
I'm using a pirated version, but all works. The problem is that he didn't use the keyword "public"
|
And also the problem was that he put a space between 1 and 6.
Also, in pirated versions, radio doesn't work (if you don't have audio downloaded) but game sounds like this one will work just fine.