SA-MP Forums Archive
Class Selection Music - 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: Class Selection Music (/showthread.php?tid=380639)



Class Selection Music - IIKINGII - 26.09.2012

Hi guys i want a class selection music i got this

public OnPlayerConnect(playerid)
{
if(IsPlayerNPC(playerid)) return 1;

PlayAudioStreamForPlayer(playerid, "http://www.fileden.com/files/2012/9/26/3351322/Hiphop%20Instrumentals%20-%20rap%20freestyle%20beats.mp3");

new string[128];
new pname[24];


Re: Class Selection Music - XtremeR - 26.09.2012

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
PlayAudioStreamForPlayer(playerid, "http://www.fileden.com/files/2012/9/26/3351322/Hiphop%20Instrumentals%20-%20rap%20freestyle%20beats.mp3");//play it
    return 1;
}
public OnPlayerSpawn(playerid)
{
StopAudioStreamForPlayer(playerid);//stop it
    return 1;
}
i hope that helps


Re: Class Selection Music - IIKINGII - 26.09.2012

I gona test if it works you got ++rep


Re: Class Selection Music - XtremeR - 26.09.2012

make sure that your Radio Volume is full


Re: Class Selection Music - IIKINGII - 26.09.2012

Sow this needs under player spawn
{
StopAudioStreamForPlayer(playerid);//stop it
return 1;
}


Re: Class Selection Music - XtremeR - 26.09.2012

only
pawn Код:
StopAudioStreamForPlayer(playerid);
so no errors or warnings come


Re: Class Selection Music - IIKINGII - 26.09.2012

Pawno dont works if i press run


Re: Class Selection Music - Gangster-rocks - 26.09.2012

Lol Post your codes and where did u put your codes


Re: Class Selection Music - XtremeR - 26.09.2012

this will 100% Work
pawn Код:
public OnPlayerSpawn(playerid)
{
    StopAudioStreamForPlayer(playerid);
    return 1;
}



Re: Class Selection Music - IIKINGII - 26.09.2012

public OnPlayerRequestClass(playerid, classid)
{
PlayAudioStreamForPlayer(playerid, "http://www.fileden.com/files/2012/9/26/3351322/Hiphop%20Instrumentals%20-%20rap%20freestyle%20beats.mp3");//play it
return 1;
}
{
if(IsPlayerNPC(playerid)) return 1;

//Set up the class selection
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,-1753.6743,885.2703,295.8750);
SetPlayerCameraPos(playerid,-1753.6849,892.0016,295.8750);
SetPlayerCameraLookAt(playerid,-1753.6743,885.2703,295.8750);
SetPlayerFacingAngle(playerid,0.6323);

//Do things to the player
SetPlayerColor(playerid,COLOR_DEADCONNECT);
SetPlayerTeamFromClass(playerid,classid);


public OnPlayerSpawn(playerid)
{
StopAudioStreamForPlayer(playerid);//stop it
return 1;
}
{
if(IsPlayerNPC(playerid))
{
if(strcmp(PlayerName(playerid), "Billy") == 0)
{
PutPlayerInVehicle(playerid,NPCTram,0);
SetPlayerColor(playerid,COLOR_DARKOLIVEGREEN);
SetPlayerSkin(playerid,255);
IsSpawned[playerid] =1;
print("[NPC SPAWN] Billy has been placed in his tram.");
}
return 1;
}
new string[128];
new pname[128];