SA-MP Forums Archive
[HELP] I need help about Onplayerrequestclass . +REP1 - 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)
+--- Thread: [HELP] I need help about Onplayerrequestclass . +REP1 (/showthread.php?tid=471285)



[HELP] I need help about Onplayerrequestclass . +REP1 - VenomMancer - 22.10.2013

Hello all

I need help OnplayerRequestClass ..
I want player listen music.
i know how to make it, but i dont know how to make player listen music like "Harlem Shake,Titanium etc."

If you understand please help me for make it

Thanks be4 +REP1.


Re: [HELP] I need help about Onplayerrequestclass . +REP1 - ]Rafaellos[ - 22.10.2013

You can use THIS.


Re: [HELP] I need help about Onplayerrequestclass . +REP1 - VenomMancer - 22.10.2013

Quote:
Originally Posted by ]Rafaellos[
Посмотреть сообщение
You can use THIS.
How to make the music is of when player spawn ?


Re: [HELP] I need help about Onplayerrequestclass . +REP1 - newbie scripter - 22.10.2013

When A Player Spawns, here
Код:
public OnPlayerSpawn(playerid)
{
 // The Code LIke PlayAudioStreamForPlayer(blablabla);
return 1;
}
On Request Class

Код:
public OnPlayerRequestClass(playerid, classid)
{
   // code
return 1;
}
and more!


Re: [HELP] I need help about Onplayerrequestclass . +REP1 - VenomMancer - 23.10.2013

anyone can make for me ?

i am a newbe scripter


Re: [HELP] I need help about Onplayerrequestclass . +REP1 - [CG]Milito - 23.10.2013

pawn Код:
OnPlayerConnect(playerid)
{
    PlayAudioStreamForPlayer(playerid, YOUR URL);
    return 1;
}

OnPlayerSpawn(playerid)
{
    StopAudioStreamForPlayer(playerid);
    return 1;
}
I don't recommend you using OnPlayerRequestClass callback because it gets called when a player changes the skin so the song will repeat and repeat whenever they just choose the skin.
That's why I made the code using OnPlayerConnect and OnPlayerSpawn callbacks


Re: [HELP] I need help about Onplayerrequestclass . +REP1 - newbie scripter - 23.10.2013

where do you want to play the music? and also tell us the URL we will or i will make 1 for u or PM me


Re: [HELP] I need help about Onplayerrequestclass . +REP1 - mahardika - 24.10.2013

Код:
OnPlayerConnect(playerid)
{
       PlayAudioStreamForPlayer(playerid, http://media.soundcloud.com/stream/TlAsBOPpA3Vm.mp3); //harlem shake yeah!
       return 1;
}

OnPlayerSpawn(playerid)
{
      StopAudioStreamForPlayer(playerid);
      return 1;
}



Respuesta: Re: [HELP] I need help about Onplayerrequestclass . +REP1 - [CG]Milito - 24.10.2013

Quote:
Originally Posted by mahardika
Посмотреть сообщение
Код:
OnPlayerConnect(playerid)
{
       PlayAudioStreamForPlayer(playerid, http://media.soundcloud.com/stream/TlAsBOPpA3Vm.mp3); //harlem shake yeah!
       return 1;
}

OnPlayerSpawn(playerid)
{
      StopAudioStreamForPlayer(playerid);
      return 1;
}
Did you just copy my code?


Re: Respuesta: Re: [HELP] I need help about Onplayerrequestclass . +REP1 - mahardika - 24.10.2013

Quote:
Originally Posted by [CG]Milito
Посмотреть сообщение
Did you just copy my code?
a little... just add the music...
Quote:
Originally Posted by VenomMancer
Посмотреть сообщение
i know how to make it, but i dont know how to make player listen music like "Harlem Shake,Titanium etc."