I need help onplayer connect music
#1

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.
Reply
#2

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.
Reply
#3

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.

Reply
#4

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.
Reply
#5

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.
Reply
#6

Yes, though you might get a warning/error because the callbacks are not returning any value.
Reply
#7

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 .
Reply
#8

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;
}
Reply
#9

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"
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)