[Ajuda] Boombox nгo toca a mъsica.
#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


Messages In This Thread
Boombox nгo toca a mъsica. - by AtomicSAMP - 21.11.2015, 18:52
Re: Boombox nгo toca a mъsica. - by n0minal - 21.11.2015, 19:12
Re: Boombox nгo toca a mъsica. - by PT - 21.11.2015, 19:19
Re: Boombox nгo toca a mъsica. - by AtomicSAMP - 21.11.2015, 19:20
Re: Boombox nгo toca a mъsica. - by PT - 22.11.2015, 12:30

Forum Jump:


Users browsing this thread: 1 Guest(s)