08.01.2014, 13:15
I have edited this ******* player filterscript and now I have problems with it see whats wrong, when I type link and press enter it just wont play :P anyone?
ondialogresponse
Код:
CMD:adminradio(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] == 0) { SendClientMessage(playerid, 0xD776FF, "{FFFF00}[LZ]{AFAFAF} Niste autorizovani da koristite tu komandu."); return 1; } PlayerU2B[playerid] = 4; ShowPlayerDialog(playerid,16918,DIALOG_STYLE_INPUT,"{FFFF00}|LZ|Admin radio","{FFFFFF}Da pustite pesmu svim igracima:\n - Idite na www.*******.com\n - Prekopirajte dati link\n - Kliknite 'Pusti' i uzivajte!","Pusti","Izlaz"); return 1; }
Код:
if(dialogid == 16918) { if(response) { if(strlen(inputtext)) { new result[128], videostr[128]; strmid(result,inputtext,31,44,strlen(inputtext)); format(videostr,sizeof(videostr),"www.*******-mp3.org/api/itemInfo/?video_id=%s",result); strmid(PlayerU2BLink[playerid], result, 0, 32); if(PlayerU2B[playerid] == 4) { HTTP(playerid,HTTP_GET,videostr,"","U2BInfo"); } } }
Код:
forward U2BInfo(playerid, response_code, data[]); public U2BInfo(playerid, response_code, data[]) { new result[33], u2bstr[33]; new streamedurl[128]; new crypted = strfind(data, "\"h\"", true, -1); strmid(result,data,crypted+7,crypted+39,strlen(data)); format(u2bstr,sizeof(u2bstr), "%s", result); format(streamedurl, sizeof(streamedurl), "http://www.*******-mp3.org/get?video_id=%s&h=%s",PlayerU2BLink[playerid], u2bstr); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { PlayAudioStreamForPlayer(i, streamedurl); return 1; } else return 1; } return 1; }