[Ajuda] Boombox nгo toca a mъsica.
#1

Eu jб fiz e refiz esse sistema, mas, o boombox continua nгo tocando a mъsica e eu fiz atй uma stock pra definir mas mesmo assim nгo vai.

Код:
CMD:boombox(playerid, params[])
{
	static
	    type[24],
	    string[128];

	if (!Inventory_HasItem(playerid, "Boombox"))
	    return SendErrorMessage(playerid, "Vocк nгo tem uma boombox ");

	if (sscanf(params, "s[24]S()[128]", type, string))
	{
	    SendSyntaxMessage(playerid, "/boombox [nome]");
	    SendClientMessage(playerid, COLOR_YELLOW, "[NOMES]:{FFFFFF} colocar, pegar, url");
	    return 1;
	}
	if (!strcmp(type, "colocar", true))
	{
	    if (BoomboxData[playerid][boomboxPlaced])
	        return SendErrorMessage(playerid, "Vocк jб colocou uma boombox.");

		if (Boombox_Nearest(playerid) != INVALID_PLAYER_ID)
		    return SendErrorMessage(playerid, "Vocк estб perto de outra boombox.");

		if (IsPlayerInAnyVehicle(playerid))
		    return SendErrorMessage(playerid, "Vocк precisa sair do veiculo.");

		Boombox_Place(playerid);

		SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s coloca a boombox no chгo.", ReturnName(playerid, 0));
		SendServerMessage(playerid, "Vocк colocou sua boombox no chгo (use \"/boombox\" para ver as opзхes).");
	}
	else if (!strcmp(type, "pegar", true))
	{
	    if (!BoomboxData[playerid][boomboxPlaced])
	        return SendErrorMessage(playerid, "Vocк nгo tem nenhuma boombox no chгo.");

		if (!IsPlayerInRangeOfPoint(playerid, 3.0, BoomboxData[playerid][boomboxPos][0], BoomboxData[playerid][boomboxPos][1], BoomboxData[playerid][boomboxPos][2]))
		    return SendErrorMessage(playerid, "Vocк nгo estб perto da sua boombox.");

		Boombox_Destroy(playerid);
		SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s pega sua boombox.", ReturnName(playerid, 0));
	}
	else if (!strcmp(type, "url", true))
	{
	    if (sscanf(string, "s[128]", string))
	        return SendSyntaxMessage(playerid, "/boombox [url] [url da musica]");

        if (!BoomboxData[playerid][boomboxPlaced])
	        return SendErrorMessage(playerid, "Vocк nгo tem nenhuma boombox no chгo.");

		if (!IsPlayerInRangeOfPoint(playerid, 3.0, BoomboxData[playerid][boomboxPos][0], BoomboxData[playerid][boomboxPos][1], BoomboxData[playerid][boomboxPos][2]))
		    return SendErrorMessage(playerid, "Vocк nгo estб perto da sua boombox.");

    Boombox_SetURL(playerid, string);
		SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s altera a musica da boombox.", ReturnName(playerid, 0));
	}
	return 1;
}
stock

Код:
stock Boombox_SetURL(playerid, url[])
{
	if (BoomboxData[playerid][boomboxPlaced])
	{
	    strpack(BoomboxData[playerid][boomboxURL], url, 128 char);

	    foreach (new i : Player) if (PlayerData[i][pBoombox] == playerid) {
	        StopAudioStreamForPlayer(i);
         PlayAudioStreamForPlayer(i, url, BoomboxData[playerid][boomboxPos][0], BoomboxData[playerid][boomboxPos][1], BoomboxData[playerid][boomboxPos][2], 30.0, 1);
		}
	}
	return 1;
}
Reply
#2

Код:
if (sscanf(params, "s[24]S()[128]", type, string))
What?
Reply
#3

PHP код:
CMD:boombox(playeridparams[])
{
    new
        
type[8],
        
string[128];
    if (!
Inventory_HasItem(playerid"Boombox"))
        return 
SendErrorMessage(playerid"Vocк nгo tem uma boombox ");
    if (
sscanf(params"s[8]S(nada)[128]"typestring))
    {
        
SendSyntaxMessage(playerid"/boombox [nome]");
        
SendClientMessage(playeridCOLOR_YELLOW"[NOMES]:{FFFFFF} colocar, pegar, url");
        return 
1;
    }
    if (!
strcmp(type"colocar"true))
    {
        if (
BoomboxData[playerid][boomboxPlaced])
            return 
SendErrorMessage(playerid"Vocк jб colocou uma boombox.");
        if (
Boombox_Nearest(playerid) != INVALID_PLAYER_ID)
            return 
SendErrorMessage(playerid"Vocк estб perto de outra boombox.");
        if (
IsPlayerInAnyVehicle(playerid))
            return 
SendErrorMessage(playerid"Vocк precisa sair do veiculo.");
        
Boombox_Place(playerid);
        
SendNearbyMessage(playerid30.0COLOR_PURPLE"** %s coloca a boombox no chгo."ReturnName(playerid0));
        
SendServerMessage(playerid"Vocк colocou sua boombox no chгo (use \"/boombox\" para ver as opзхes).");
    }
    else if (!
strcmp(type"pegar"true))
    {
        if (!
BoomboxData[playerid][boomboxPlaced])
            return 
SendErrorMessage(playerid"Vocк nгo tem nenhuma boombox no chгo.");
        if (!
IsPlayerInRangeOfPoint(playerid3.0BoomboxData[playerid][boomboxPos][0], BoomboxData[playerid][boomboxPos][1], BoomboxData[playerid][boomboxPos][2]))
            return 
SendErrorMessage(playerid"Vocк nгo estб perto da sua boombox.");
        
Boombox_Destroy(playerid);
        
SendNearbyMessage(playerid30.0COLOR_PURPLE"** %s pega sua boombox."ReturnName(playerid0));
    }
    else if (!
strcmp(type"url"true))
    {
        if (
sscanf(string"s[128]"string))
            return 
SendSyntaxMessage(playerid"/boombox url [url da musica]");
        if (!
BoomboxData[playerid][boomboxPlaced])
            return 
SendErrorMessage(playerid"Vocк nгo tem nenhuma boombox no chгo.");
        if (!
IsPlayerInRangeOfPoint(playerid3.0BoomboxData[playerid][boomboxPos][0], BoomboxData[playerid][boomboxPos][1], BoomboxData[playerid][boomboxPos][2]))
            return 
SendErrorMessage(playerid"Vocк nгo estб perto da sua boombox.");
    
Boombox_SetURL(playeridstring);
        
SendNearbyMessage(playerid30.0COLOR_PURPLE"** %s altera a musica da boombox."ReturnName(playerid0));
    }
    return 
1;

PHP код:
stock Boombox_SetURL(playeridurl[])
{
    if (
BoomboxData[playerid][boomboxPlaced])
    {
        foreach (new 
Player
        {
            
StopAudioStreamForPlayer(i);
            
PlayAudioStreamForPlayer(iurlBoomboxData[playerid][boomboxPos][0], BoomboxData[playerid][boomboxPos][1], BoomboxData[playerid][boomboxPos][2], 30.01);
        }
        
strpack(BoomboxData[playerid][boomboxURL], url128 char);
    }
    return 
1;

teste la
Reply
#4

Como assim, nгo entendi.
Reply
#5

Teste la o que atualizei.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)