21.11.2015, 18:52
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.
stock
Код:
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 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; }