Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Sistema de JBL desenvolvido por Guilherme Porto
- #include <a_samp>
- #include <streamer>
- #define MAX_JBL 30 //Máixmo de JBL's que podem está conectadas simultaneamente
- #define D_JBL 777 //ID da Dialog JBL
- enum JBL_Info
- {
- Text3D:TextJBL[MAX_JBL],
- JblUsed[MAX_JBL],
- Float:xJBL[MAX_JBL],
- Float:yJBL[MAX_JBL],
- Float:zJBL[MAX_JBL],
- StringMusica[100]
- };
- new InfoJBL[JBL_Info], JBL[MAX_PLAYERS], OuvindoMusica[MAX_PLAYERS];
- public OnGameModeInit()
- {
- SetTimer("ChamadaJBL", 1000, true);
- for(new j; j < MAX_JBL; j++)
- {
- InfoJBL[JblUsed][j] = -1;
- InfoJBL[xJBL][j] = -1; InfoJBL[yJBL][j] = -1; InfoJBL[zJBL][j] = -1;
- InfoJBL[TextJBL][j] = CreateDynamic3DTextLabel("{FFFFFF}JBL", -1, -999.0, -98383.3, -9292.0, 10.0);
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- JBL[playerid] = -1;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(JBL[playerid] > -1)
- {
- for(new j; j < MAX_JBL; j++)
- {
- if(InfoJBL[JblUsed][j] == JBL[playerid])
- {
- InfoJBL[JblUsed][j] = -1;
- DestroyDynamic3DTextLabel(InfoJBL[TextJBL][j]);
- InfoJBL[TextJBL][j] = CreateDynamic3DTextLabel("{FFFFFF}JBL", -1, -999.0, -98383.3, -9292.0, 10.0);//Text3D
- }
- }
- DestroyDynamicObject(JBL[playerid]);
- JBL[playerid] = -1;
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[128], idx; cmd = strtok(cmdtext, idx);
- if(strcmp(cmd, "/LigarJBL", true) == 0)
- {
- if(IsPlayerAdmin(playerid))
- {
- if(GetPlayerInterior(playerid) != 0)
- {
- return SendClientMessage(playerid, 0xFF4500FF, "| ERRO | Não é permitido usar esse comando em interiores");
- }
- if(IsPlayerInAnyVehicle(playerid))
- {
- return SendClientMessage(playerid, 0xFF4500FF, "| ERRO | Você não pode usar esse comando em veículos");
- }
- if(JBL[playerid] > -1)
- {
- return SendClientMessage(playerid, 0xFF4500FF, "| ERRO | Sua JBL já está ligada em algum lugar");
- }
- new stringj[1200];
- strcat(stringj,"{FFFFFF}Douglas e Vinícius - Figurinha - part. MC Bruninho\n");
- strcat(stringj,"Henrique e Juliano - ALÔ BEBÊ\n");
- strcat(stringj,"Henrique e Juliano - NÃO GOSTO EU AMO\n");
- strcat(stringj,"Zé Neto e Cristiano - CONDOMÍNIO FECHADO\n");
- strcat(stringj,"Marília Mendonça & Maiara e Maraisa - Você nem é tudo isso\n");
- strcat(stringj,"Diego & Victor Hugo, Raí Saia Rodada - Pisadinha\n");
- strcat(stringj,"Os Barões da Pisadinha - Tá Rocheda\n");
- strcat(stringj,"Os Barões da Pisadinha ft. Luan Estilizado - Galera do Interior\n");
- strcat(stringj,"Os Barões da Pisadinha - Só Basta você me Ligar Ft. Xand Avião\n");
- strcat(stringj,"Do Fundo da Grota - Baitaca\n");
- strcat(stringj,"Kawe - Gigante\n");
- strcat(stringj,"MC Hariel - Espancando Recalque (GR6 Explode) DJ Pedro\n");
- strcat(stringj,"Hungria Hip Hop - Um Pedido\n");
- strcat(stringj,"Childish\n");
- strcat(stringj,"Internet Money - Lemonade\n");
- strcat(stringj,"Pop Smoke - Enjoy Yourself ft. KAROL G\n");
- strcat(stringj,"TA COM SAUDADE QUER TBT - MC Talibã e MC Rennan\n");
- strcat(stringj,"MC Luan da Bs e MC Vitin LC - Bipolar\n");
- strcat(stringj,"Grupo Revelação Oficial - Deixa Acontecer\n");
- strcat(stringj,"Zé Neto e Cristiano - WHISKY E GELO\n");
- strcat(stringj,"Aviões - Inquilina\n");
- strcat(stringj,"Roses (Imanbek Remix)\n");
- strcat(stringj,"Stereo Love - Original\n");
- strcat(stringj,"Rap Das Armas\n");
- strcat(stringj,"I'm an Albatraoz\n");
- strcat(stringj,"Fogo na Babilonia\n");
- strcat(stringj,"Cerveja de Garrafa - Atitude 67\n");
- strcat(stringj,"Deixa Acontecer - Grupo Revelação\n");
- strcat(stringj,"Cheia de Manias - Raça Negra");
- return ShowPlayerDialog(playerid, D_JBL, DIALOG_STYLE_LIST, "{FFFFFF}JBL - Playlist", stringj, "Tocar", "Fechar");
- }
- else
- {
- return SendClientMessage(playerid, 0xFF4500FF, "| ERRO | Você não tem permissão");
- }
- }
- if(strcmp(cmd, "/PararJBL", true) == 0)
- {
- if(IsPlayerAdmin(playerid))
- {
- SendClientMessage(playerid, 0xFFFF00FF, "| INFO | Você parou de ouvir musica da JBL");
- OuvindoMusica[playerid] = 0;
- StopAudioStreamForPlayer(playerid);
- return 1;
- }
- else
- {
- return SendClientMessage(playerid, 0xFF4500FF, "| ERRO | Você não tem permissão");
- }
- }
- if(strcmp(cmd, "/DesligarJBL", true) == 0)
- {
- if(IsPlayerAdmin(playerid))
- {
- if(JBL[playerid] == -1)
- {
- return SendClientMessage(playerid, 0xFF4500FF, "| ERRO | Você não ligou sua JBL");
- }
- for(new j; j < MAX_JBL; j++)
- {
- if(InfoJBL[JblUsed][j] == JBL[playerid])
- {
- new Float:X, Float:Y, Float:Z; GetDynamicObjectPos(InfoJBL[JblUsed][j], X, Y, Z);
- if(IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z))
- {
- SendClientMessage(playerid, 0xFFFF00FF, "| INFO | Você desligou sua JBL");
- DestroyDynamicObject(InfoJBL[JblUsed][j]);
- JBL[playerid] = -1;
- InfoJBL[JblUsed][j] = -1;
- DestroyDynamic3DTextLabel(InfoJBL[TextJBL][j]);
- InfoJBL[TextJBL][j] = CreateDynamic3DTextLabel("{FFFFFF}JBL", -1, -999.0, -98383.3, -9292.0, 10.0);//Text3D
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerInRangeOfPoint(i, 20.0, X, Y, Z))
- {
- StopAudioStreamForPlayer(i);
- OuvindoMusica[i] = 0;
- }
- }
- return 1;
- }
- else
- {
- return SendClientMessage(playerid, 0xFF4500FF, "| ERRO | Você não está próximo da sua JBL");
- }
- }
- }
- return SendClientMessage(playerid, 0xFF4500FF, "| ERRO | Sua JBL não foi encontrada");
- }
- else
- {
- return SendClientMessage(playerid, 0xFF4500FF, "| ERRO | Você não tem permissão");
- }
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == D_JBL)
- {
- if(response)
- {
- for(new j; j < MAX_JBL; j++)
- {
- if(InfoJBL[JblUsed][j] > -1)
- {
- new Float:XB, Float:YB, Float:ZB; GetDynamicObjectPos(InfoJBL[JblUsed][j], XB, YB, ZB);
- if(IsPlayerInRangeOfPoint(playerid, 20.0, XB, YB, ZB))
- {
- return SendClientMessage(playerid, 0xFF4500FF, "| ERRO | Já tem uma JBL tocando nesse local");
- }
- }
- }
- for(new j; j < MAX_JBL; j++)
- {
- if(InfoJBL[JblUsed][j] == -1)
- {
- new String1[128], Nome[MAX_PLAYER_NAME]; GetPlayerName(playerid, Nome, sizeof(Nome));
- format(String1, sizeof(String1), "| JBL | O(A) Jogador(a) %s[%d] ligou sua JBL", Nome, playerid);
- SendClientMessageToAll(0xFFFF00FF, String1);
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
- GetPlayerPos(playerid, InfoJBL[xJBL][j], InfoJBL[yJBL][j], InfoJBL[zJBL][j]);
- GetXYInFrontOfPlayer(playerid, InfoJBL[xJBL][j], InfoJBL[yJBL][j], 0.7);
- JBL[playerid] = CreateDynamicObject(2226, InfoJBL[xJBL][j], InfoJBL[yJBL][j], InfoJBL[zJBL][j] - 0.9, 0.0, 0, 0);
- InfoJBL[JblUsed][j] = JBL[playerid];
- DestroyDynamic3DTextLabel(InfoJBL[TextJBL][j]);
- new strp[80]; format(strp, sizeof(strp), "{FF00FF}JBL {FFFFFF}Ligada\nJogador(a): %s[%d]", Nome, playerid);
- InfoJBL[TextJBL][j] = CreateDynamic3DTextLabel(strp, -1, InfoJBL[xJBL][j], InfoJBL[yJBL][j], InfoJBL[zJBL][j]-0.5, 10.0);
- Streamer_Update(playerid);
- switch(listitem)
- {
- case 0:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/rld8terrprn93s7/Figurinha.mp3");
- }
- case 1:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/91gkmceb2ku6het/AloBebe.mp3");
- }
- case 2:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/787ksks2ul7tlh7/NaoGostoEuAmo.mp3");
- }
- case 3:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/ubpciz2k2vemwv2/CondominioFechado.mp3");
- }
- case 4:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/nb9hquikxue2863/VoceNemEtudoIsso.mp3");
- }
- case 5:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/xu2qiy39hkmnlhx/Pisadinha.mp3");
- }
- case 6:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/5fi1batjo85mo5v/TaRocheda.mp3");
- }
- case 7:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/apiacgvhcu1dlsq/GaleraDoInterior.mp3");
- }
- case 8:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/xmzfao1b53v6nd2/SoBastaVoceMeLigar.mp3");
- }
- case 9:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/ci73wbvt4auuco2/Baitaca.mp3");
- }
- case 10:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/z03wo3a9e80q06r/Gigante.mp3");
- }
- case 11:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/xgwrfimts7yqyen/EspancandoRecalque.mp3");
- }
- case 12:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/0rqa3f9w7qkjp50/UmPedido.mp3");
- }
- case 13:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/wvuu1orf810khlk/Childish.mp3");
- }
- case 14:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/5xlcn4ra7cd400s/Lemonade.mp3");
- }
- case 15:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/k68sqj0stkg8too/EnjoyYourself.mp3");
- }
- case 16:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/2etlj6ozb7oqnec/TaComSaudadeQuerTBT.mp3");
- }
- case 17:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/96pw316ogwzxff0/Bipolar.mp3");
- }
- case 18:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/uyutzsqzl323crv/DeixaAcontecer.mp3");
- }
- case 19:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/b9lhnkcz60fcoea/WhiskyeGelo.mp3");
- }
- case 20:
- {
- format(InfoJBL[StringMusica][j], 100, "https://dl.dropboxusercontent.com/s/1go2fdn2xneav6g/Inquilina.mp3");
- }
- case 21:
- {
- format(InfoJBL[StringMusica][j], 100, "https://drive.google.com/u/1/uc?id=1s_DrW_8Hlqg0ALLsijYfq8_0kvhyK7oE&export=download");
- }
- case 22:
- {
- format(InfoJBL[StringMusica][j], 100, "https://drive.google.com/u/1/uc?id=1-9z8mEMYuevvVo-MMfP5hBx8yB4me3_y&export=download");
- }
- case 23:
- {
- format(InfoJBL[StringMusica][j], 100, "https://drive.google.com/u/2/uc?id=1a0P8xFLrk3lUUyyRk7_eYMfIQX4qYGSc&export=download");
- }
- case 24:
- {
- format(InfoJBL[StringMusica][j], 100, "https://drive.google.com/u/0/uc?id=1-_b0p6A3AyhdAKerLRn5stYUKoabH5CW&export=download");
- }
- case 25:
- {
- format(InfoJBL[StringMusica][j], 100, "https://drive.google.com/u/2/uc?id=1tfOXMi2B-ZOWBDihtNV2Ob2FzRqfKmrT&export=download");
- }
- case 26:
- {
- format(InfoJBL[StringMusica][j], 100, "https://drive.google.com/u/0/uc?id=1n5jo1VJmuVdFSXCf_oMRVEJ3Md0P59au&export=download");
- }
- case 27:
- {
- format(InfoJBL[StringMusica][j], 100, "https://drive.google.com/u/1/uc?id=1EomyjO7inB-FGN-Qcywyc1OBVH4gCyEE&export=download");
- }
- case 28:
- {
- format(InfoJBL[StringMusica][j], 100, "https://drive.google.com/u/2/uc?id=1URS2aeyC-egYhGFQSQ3E4tUNc-ShcKMq&export=download");
- }
- }
- return 1;
- }
- }
- return SendClientMessage(playerid, 0xFF4500FF, "| ERRO | Não é possivel colocar uma JBL pois já tem muitas JBL's ligadas no servidor");
- }
- }
- return 1;
- }
- forward ChamadaJBL();
- public ChamadaJBL()
- {
- for (new i = 0, g = GetPlayerPoolSize(); i <= g; i++)
- {
- if(IsPlayerConnected(i))
- {
- for(new j; j < MAX_JBL; j++)
- {
- if(InfoJBL[JblUsed][j] > -1)
- {
- new Float:XB, Float:YB, Float:ZB; GetDynamicObjectPos(InfoJBL[JblUsed][j], XB, YB, ZB);
- if(IsPlayerInRangeOfPoint(i, 20.0, XB, YB, ZB) && OuvindoMusica[i] == 0)
- {
- PlayAudioStreamForPlayer(i, InfoJBL[StringMusica][j], XB, YB, ZB, 20.0, 1); OuvindoMusica[i] = 120;
- break;
- }
- }
- }
- if(OuvindoMusica[i] > 0)
- {
- OuvindoMusica[i] --;
- }
- }
- }
- return 1;
- }
- stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
- {
- new Float:a;
- GetPlayerPos(playerid, x, y, a);
- GetPlayerFacingAngle(playerid, a);
- if (GetPlayerVehicleID(playerid)) {
- GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
- }
- x += (distance * floatsin(-a, degrees));
- y += (distance * floatcos(-a, degrees));
- }
- strtok(const string[], &index)
- {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' '))
- {
- index++;
- }
- new offset = index;
- new result[20];
- while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement