Music Login[rep]
#1

How do i add music at player login and after login the music stops how do i make it?[rep]
Reply
#2

OnPlayerRequestClass, if you want a stream, use
PlayAudioStreamForPlayer(playerid, "url");
but if you want to play game music you must have a plugin. Im not sure what its called though. Sorry
Reply
#3

Quote:
Originally Posted by Nuke547
Посмотреть сообщение
OnPlayerRequestClass, if you want a stream, use
PlayAudioStreamForPlayer(playerid, "url");
but if you want to play game music you must have a plugin. Im not sure what its called though. Sorry
at (7067) :OnPlayerRequestClass i put this from computer and

PlayAudioStreamForPlayer(playerid, "C:\Users\Public\preview.mp3");

2 erors

PHP код:
(7067) : error 027invalid character constant
(7067) : error 027invalid character constant 
Reply
#4

This is how I did it;

Top of your script:
pawn Код:
new bool:firstSpawn[ MAX_PLAYERS ];
OnPlayerConnect:
pawn Код:
PlayAudioStreamForPlayer( playerid, "http://2ky.info/Music/BTF.mp3" );
firstSpawn[ playerid ] = true;
OnPlayerSpawn (Have a firstSpawn variable):
pawn Код:
StopAudioStreamForPlayer ( playerid );
firstSpawn[ playerid ] = false;
Reply
#5

Код:
public OnPlayerConnect(playerid) {
            switch(random(3))
	    	{
	    	    case 0:
	    	    {
	    			PlayAudioStreamForPlayer(playerid, "URL1");
				}
				case 1:
				{
				    PlayAudioStreamForPlayer(playerid, "URL2");
				}
				case 2:
				{
				    PlayAudioStreamForPlayer(playerid, "URL3");
				}
Random music playing

P.S Coded on phone :/
Reply
#6

but i cant put from my pc.. (
Reply
#7

Quote:
Originally Posted by 2KY
Посмотреть сообщение
This is how I did it;

Top of your script:
pawn Код:
new bool:firstSpawn[ MAX_PLAYERS ];
OnPlayerConnect:
pawn Код:
PlayAudioStreamForPlayer( playerid, "http://2ky.info/Music/BTF.mp3" );
firstSpawn[ playerid ] = true;
OnPlayerSpawn (Have a firstSpawn variable):
pawn Код:
StopAudioStreamForPlayer ( playerid );
firstSpawn[ playerid ] = false;
Thank you!
im oferring an opertunity to get a rep

PHP код:
public OnPlayerExitVehicle(playeridvehicleid)
{
StopAudioStreamForPlayer

help with this too oferring a chance to get [rep]
Reply
#8

pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
StopAudioStreamForPlayer(playerid);
}
Reply
#9

help with this last cmd!Errors are down!

Код HTML:
    if(strcmp(cmd, "/drink", true) == 0)
	{
	if(IsPlayerConnected(playerid))
	{
	if(IsAtBar(playerid))
	{
	if(GetPlayerDrunkLevel(playerid) <= 20000)
	{
	new Float:health;
	new x_nr[24];
	x_nr = strtok(cmdtext, idx);
	if(!strlen(x_nr)) {
	SendClientMessage(playerid, COLOR_LIGHTRED, "(Bauturi la Bar)");
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /drink [drinkname]");
	SendClientMessage(playerid, COLOR_RED, "Apa ($10),Fanta ($4),Bere ($10),Tuica($8),Sampanie($100)");
	SendClientMessage(playerid, COLOR_RED, "Vodka ($20),Lichior($18)");
	SendClientMessage(playerid, COLOR_VIOLET, "Aveti grija sa nu va stricati Ficatul!");
	return 1;
	}
	if(strcmp(x_nr,"bere",true) == 0)
	{
	if(PlayerInfo[playerid][pAge] < 16)
	{
	SendClientMessage(playerid, COLOR_WHITE, "Barman:Scuzati trebuie sa detineti varsta de 16 ani!");
	return 1;
	}
	GivePlayerCash(playerid, -10);
	SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
 	GetPlayerHealth(playerid, health);
	if(health < 100)
	{
	if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 10; SetPlayerHealth(playerid, health + hp); }
	else { SetPlayerHealth(playerid, health + 10.0); }
	}
	}
	else if(strcmp(x_nr,"tuica",true) == 0)
	{
	if(PlayerInfo[playerid][pAge] < 18)
	{
	SendClientMessage(playerid, COLOR_WHITE, "Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
	return 1;
	}
	GivePlayerCash(playerid, -8);
	SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
	GetPlayerHealth(playerid, health);
	if(health < 100)
	{
	if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 15; SetPlayerHealth(playerid, health + hp); }
	else { SetPlayerHealth(playerid, health + 15.0); }
	}
	}
	else if(strcmp(x_nr,"sampanie",true) == 0)
	{
	if(PlayerInfo[playerid][pAge] < 18)
	{
	SendClientMessage(playerid, COLOR_WHITE, "Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
	return 1;
	}
	GivePlayerCash(playerid, -100);
	SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
	GetPlayerHealth(playerid, health);
	if(health < 100)
	{
	if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 20; SetPlayerHealth(playerid, health + hp); }
	else { SetPlayerHealth(playerid, health + 20.0); }
	}
	}
	else if(strcmp(x_nr,"vodka",true) == 0)
	{
	if(PlayerInfo[playerid][pAge] < 18)
	{
	SendClientMessage(playerid, COLOR_WHITE, "Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
	return 1;
	}
	GivePlayerCash(playerid, -20);
	SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
	GetPlayerHealth(playerid, health);
	if(health < 100)
	{
	if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 27; SetPlayerHealth(playerid, health + hp); }
	else { SetPlayerHealth(playerid, health + 27.0); }
	}
	}
	else if(strcmp(x_nr,"lichior",true) == 0)
	{
	if(PlayerInfo[playerid][pAge] < 18)
	{
	SendClientMessage(playerid, COLOR_WHITE, "Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
	return 1;
	}
	GivePlayerCash(playerid, -18);
	SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
	GetPlayerHealth(playerid, health);
	if(health < 100)
	{
	if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 40; SetPlayerHealth(playerid, health + hp); }
	else { SetPlayerHealth(playerid, health + 40.0); }
	}
	}
	else if(strcmp(x_nr,"apa",true) == 0)
	{
	GivePlayerCash(playerid, -10);
	GetPlayerHealth(playerid, health);
	SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
	SetPlayerDrunkLevel(playerid, -1000)
(33416) :Eror 1 >	if(health < 100)
	{
	if(PlayerInfo[playerid][pAlcoholPerk] > 0) { new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 5; SetPlayerHealth(playerid, health + hp); }
	else { SetPlayerHealth(playerid, health + 50.0); }
	}
	else if(health > 100)
	{
	SetPlayerHealth(playerid, 100);
	}
	}
	else if(strcmp(x_nr,"fanta",true) == 0)
	{
	GivePlayerCash(playerid, -4);
	GetPlayerHealth(playerid, health);
	SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
	SetPlayerDrunkLevel(playerid, -1000)
(33432) :Error 2>	if(health < 100)
	{
	if(PlayerInfo[playerid][pAlcoholPerk] > 0) { new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 5;   SetPlayerHealth(playerid, health + hp); }
	else { SetPlayerHealth(playerid, health + 50.0); }
	}
	else if(health > 100)
	{
	SetPlayerHealth(playerid, 100);
	}
	}
	else
	{
	SendClientMessage(playerid, COLOR_WHITE, "Bartender: I don't know that Drink Name.");
	return 1;
	}
	GetPlayerHealth(playerid, health);
	if (health > 100) SetPlayerHealth(playerid, 100);

	format(string, sizeof(string), "* %s bea %s de la pahar.", sendername ,x_nr);
	ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
	}
	else
	{
	SendClientMessage(playerid, COLOR_GREY, "   Numai poti sa bei");
    }
    return 1;
    }
    }
PHP код:
2 erors:
(
33416) : error 001expected token";"but found "if"
(33432) : error 001expected token";"but found "if" 
GIVING REp
Reply
#10

Quote:
Originally Posted by Dan_Barocu
Посмотреть сообщение
at (7067) :OnPlayerRequestClass i put this from computer and

PlayAudioStreamForPlayer(playerid, "C:\Users\Public\preview.mp3");

2 erors

PHP код:
(7067) : error 027invalid character constant
(7067) : error 027invalid character constant 
Dude.. Laughed on this. Upload your music somewhere PlayAudioForPlayer reads from.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)