ShowPlayerDialog(playerid, radio, DIALOG_STYLE_MSGBOX, "Здравствуйте!", "Если Вы хотите,чтобы играла музыка\nНажмите ОК,если нет, ОТМЕНА.", "OK", "Отмена"); PlayAudioStreamForPlayer(playerid,"http://stream.radiohunter.com.br:7070/listen.pls");
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case radio://if dialog id = radio
{//then
if(response)//if pressed OK
{
//playeaudiostream
PlayAudioStreamForPlayer(playerid,"http://stream.radiohunter.com.br:7070/listen.pls");
}
else(!response)//id canceled
{
//else nothing
}
}
}
return 1;
}
D:\Games\SAMP сервер\SampDM\gamemodes\SampDMv.1.2.pwn(2644 -- 2645) : error 028: invalid subscript (not an array or too many subscripts): "response" D:\Games\SAMP сервер\SampDM\gamemodes\SampDMv.1.2.pwn(2649) : error 002: only a single statement (or expression) can follow each "case" D:\Games\SAMP сервер\SampDM\gamemodes\SampDMv.1.2.pwn(2649 -- 2650) : error 029: invalid expression, assumed zero Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
switch(dialogid) { case radio://if dialog id = radio {//then if(response)//if pressed OK { //playeaudiostream PlayAudioStreamForPlayer(playerid,"http://stream.radiohunter.com.br:7070/listen.pls"); } else(!response)//id canceled { StopAudioStreamForPlayer(playerid); return 1; } if(dialogid == 100) { if(response) { if(!strlen(inputtext)) { ShowPlayerDialog(playerid,100,DIALOG_STYLE_INPUT,"Авторизация","Здравствуйте.\nВы у нас уже зарегистрированны!\nВведите свой пароль для авторизации.","Принять","Отмена"); return 1; } new pass[64]; strmid(pass,inputtext,0,strlen(inputtext),64); OnPlayerLogin(playerid,pass); } else { ShowPlayerDialog(playerid,100,DIALOG_STYLE_INPUT,"Авторизация","Здравствуйте.\nВы у нас уже зарегистрированны!\nВведите свой пароль для авторизации.","Принять","Отмена"); } } if(dialogid == 101) { if(response) { if(!strlen(inputtext)) { ShowPlayerDialog(playerid,101,DIALOG_STYLE_INPUT,"Регистрация","Здравствуйте.\nВы у нас ещё не зарегистрированны!\nВведите свой пароль для регистрации.","Принять","Отмена"); return 1; } new pass[64]; strmid(pass,inputtext,0,strlen(inputtext),64); OnPlayerRegister(playerid,pass); } else { ShowPlayerDialog(playerid,101,DIALOG_STYLE_INPUT,"Регистрация","Здравствуйте.\nВы у нас ещё не зарегистрированны!\nВведите свой пароль для регистрации.","Принять","Отмена"); } } return 1; }
PlayAudioStreamForPlayer(playerid, "PUT THE MUSIC URL HERE");
public OnPlayerConnect(playerid)
{
PlayAudioStreamForPlayer(playerid, "http://MySongURL.com");
return 1;
}
public OnPlayerSpawn(playerid)
{
PlayAudioStreamForPlayer(playerid, "Link/URL To MP3");
// Your Code
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
D:\Games\SAMP сервер\SampDM\gamemodes\SampDMv.1.2.pwn(1202 -- 1203) : error 028: invalid subscript (not an array or too many subscripts): "response" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
switch(dialogid)
{
case radio://if dialog id = radio
{//then
if(response)//if pressed OK
{
//playeaudiostream
PlayAudioStreamForPlayer(playerid,"http://stream.radiohunter.com.br:7070/listen.pls");
}
else(!response)//id canceled
{
StopAudioStreamForPlayer(playerid);
return 1;
}
if(dialogid == radio)//if dialog id = radio
{//then
if(response)//if pressed OK
{
//playeaudiostream
PlayAudioStreamForPlayer(playerid,"http://stream.radiohunter.com.br:7070/listen.pls");
}
else(!response)//id canceled
{
StopAudioStreamForPlayer(playerid);
}
D:\Games\SAMP сервер\SampDM\gamemodes\SampDMv.1.2.pwn(2421 -- 2422) : error 028: invalid subscript (not an array or too many subscripts): "response" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
Try this as this may work:
Under OnPlayerConnect or OnPlayerSpawn pawn Код:
pawn Код:
|