Jump to content

Question

Posted

AM o problema la un dialog , cand dau cancel imi da server closed connection

[pawn]ShowPlayerDialog(playerid, RADIO, DIALOG_STYLE_LIST, "Choose your radio station", "Radio Zu\nKiss FM\nPro FM\nRadio 21\nRadio Manele\nRadio Manele2\nStop The Music", "Listen", "Cancel");[/pawn]

9 answers to this question

Recommended Posts

Posted

AM o problema la un dialog , cand dau cancel imi da server closed connection

[pawn]ShowPlayerDialog(playerid, RADIO, DIALOG_STYLE_LIST, "Choose your radio station", "Radio Zu\nKiss FM\nPro FM\nRadio 21\nRadio Manele\nRadio Manele2\nStop The Music", "Listen", "Cancel");[/pawn]

Nu e de la codu asta

Cauta la OnPlayerDialog

ceva de genu

[pawn]if(dialogid == RADIO)[/pawn]

Si cauta in acel dialog KickEx sau Kick nu mai stiu sigur..daca nu gasesti pune tot codu ala aici

Massari e curva mea

Posted

[pawn]    if(dialogid == RADIO)

          {

            if(response)

            {

                    if(listitem==0)

    {

                        StopAudioStreamForPlayer(playerid);

                                        PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=224605");

                    }

                    if(listitem==1)

                    {

                        StopAudioStreamForPlayer(playerid);

                                        PlayAudioStreamForPlayer(playerid, "http://80.86.106.136/listen.pls");

                    }

                    if(listitem==2)

                    {

                        StopAudioStreamForPlayer(playerid);

                                        PlayAudioStreamForPlayer(playerid, "http://stream.profm.ro:8012/profm.mp3");

                    }

                    if(listitem==3)

                    {

                        StopAudioStreamForPlayer(playerid);

                                        PlayAudioStreamForPlayer(playerid, "http://www.radio21.ro/site/Radio21Live.m3u");

                    }

                    if(listitem==4)

                    {

                        StopAudioStreamForPlayer(playerid);

                                        PlayAudioStreamForPlayer(playerid, "http://a.fmradiomanele.ro:8054");

                    }

                    if(listitem==5)

                    {

                        StopAudioStreamForPlayer(playerid);

                                        PlayAudioStreamForPlayer(playerid, "http://www.radioparty.ro/manele.m3u");

                    }

                    if(listitem==6)

                    {

                      StopAudioStreamForPlayer(playerid);

                    }

                }

          }[/pawn]]

asa e dialogul

Posted

[pawn]    if(dialogid == RADIO)

          {

            if(response)

            {

                    if(listitem==0)

    {

                        StopAudioStreamForPlayer(playerid);

                                        PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=224605");

                    }

                    if(listitem==1)

                    {

                        StopAudioStreamForPlayer(playerid);

                                        PlayAudioStreamForPlayer(playerid, "http://80.86.106.136/listen.pls");

                    }

                    if(listitem==2)

                    {

                        StopAudioStreamForPlayer(playerid);

                                        PlayAudioStreamForPlayer(playerid, "http://stream.profm.ro:8012/profm.mp3");

                    }

                    if(listitem==3)

                    {

                        StopAudioStreamForPlayer(playerid);

                                        PlayAudioStreamForPlayer(playerid, "http://www.radio21.ro/site/Radio21Live.m3u");

                    }

                    if(listitem==4)

                    {

                        StopAudioStreamForPlayer(playerid);

                                        PlayAudioStreamForPlayer(playerid, "http://a.fmradiomanele.ro:8054");

                    }

                    if(listitem==5)

                    {

                        StopAudioStreamForPlayer(playerid);

                                        PlayAudioStreamForPlayer(playerid, "http://www.radioparty.ro/manele.m3u");

                    }

                    if(listitem==6)

                    {

                      StopAudioStreamForPlayer(playerid);

                    }

                }

                else

                {

                //ce sa apara cand apasa pe celalalt buton ca sa nu mai dea kick

                }

          }[/pawn]

Stiu si eu ... branza e pe bani, dar eu tot ma joc pe gratis!

Posted

Cauta la sfarsitul la OnDialogResponse sa nu ai un else cu kick,daca nu pune cum a zis ice si pui la else

[pawn]ShowPlayerDialog(playerid, -1, 0, "", "", "", "")[/pawn]

Nu sunt foarte sigur ca merge da incearca.

gXvsYS
Posted

Incearca asa:

[pawn]    if(dialogid == RADIO)

          {

            if(response)

            {

                    if(listitem==0)

    {

                        StopAudioStreamForPlayer(playerid);

                                        PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=224605");

                    }

                    if(listitem==1)

                    {

                        StopAudioStreamForPlayer(playerid);

                                        PlayAudioStreamForPlayer(playerid, "http://80.86.106.136/listen.pls");

                    }

                    if(listitem==2)

                    {

                        StopAudioStreamForPlayer(playerid);

                                        PlayAudioStreamForPlayer(playerid, "http://stream.profm.ro:8012/profm.mp3");

                    }

                    if(listitem==3)

                    {

                        StopAudioStreamForPlayer(playerid);

                                        PlayAudioStreamForPlayer(playerid, "http://www.radio21.ro/site/Radio21Live.m3u");

                    }

                    if(listitem==4)

                    {

                        StopAudioStreamForPlayer(playerid);

                                        PlayAudioStreamForPlayer(playerid, "http://a.fmradiomanele.ro:8054");

                    }

                    if(listitem==5)

                    {

                        StopAudioStreamForPlayer(playerid);

                                        PlayAudioStreamForPlayer(playerid, "http://www.radioparty.ro/manele.m3u");

                    }

                    if(listitem==6)

                    {

                      StopAudioStreamForPlayer(playerid);

                    }

                }

                else

                {

                SendClientMessage(playerid, 0xAA3333AA,"Ai ales Cancel");

                }

          }[/pawn]

kAdmin progress - 84%

Posted

if(response)
{
..........................
}
else
{
}
Lasi gol la else ca sa iasa din dialog. Dar s-ar putea sa ai ceva de genul la OnDialogResponse
if(response)
{
	if(dialogid == id || dialogid == id)
	{
         ........................................................
}
else
{
        Kick(playerid);
}

Posted

Am avut si eu aceasta problema si chiar nu am stiut cum s-o rezolv.. pentru ca nimeni nu a explicat cum trebuie... am facut tot ce ati zis aici de multe ori, insa degeaba, oricum ar fi tot da "Server closed the connection". insa, m-am gandit la altceva:

unde aveti comenda care va arata dialogul:

EX:

[pawn]if(strcmp(cmd, "/help", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

      ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Server Help", "nanana", "Select", "Close");

}

return 1;

}[/pawn]

vedeti la coada aveti doua butoane: "Select" sau "Close". Pur si simplu stergeti "close" de acolo, iar la inceputul dialogului mai faceti un rand pe care sa scrie "close"

ex:

[pawn]if(strcmp(cmd, "/help", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

      ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Server Help", "Close\n nanana\nblalbla\netc", "Select", "");

}

return 1;

}[/pawn]

Iar ca atunci cand apasati pe close sa se inchida, adaugati unde aveti ce sa va arate in dialog[ if(dialogid = nanana) ], codul:

[pawn]

{

        if(response) //

        {

            if(listitem == 0) //

            {

            return 1;

    }[/pawn]

insa trebuie sa modificati la toate categoriile listitem == x ca sa vi-l treaca pe cel cu "close" primul.

ex:

unde aveti [pawn]listitem == 0[/pawn]

inlocuiti cu [pawn]listitem == 1[/pawn]

si tot asa la toate, si puneti-l pe cel cu close(cel pe care l-am postat mai sus), primul.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.