SA-MP Forums Archive
Server Closed Connection - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Server Closed Connection (/showthread.php?tid=421950)



Server Closed Connection - Akcent_Voltaj - 11.03.2013

everytime i click second button to close dialog i get 'server closed connection'its from here.i dont get any errors/warnings..


PHP код:
    if( dialogid == Dialog_BuyLicense )
                    {
                    if( 
response )//daca apasa primul buton
                    
{
                    if(
listitem == //Fishin
                    
{
                    if(
PlayerInfo[playerid][pFishLic] == 0)
                    {
                    if(
GetPlayerCash(playerid) >= 20000)
                    {
                    
SendClientMessage(playeridCOLOR_GREY"* You bought a fishing license for 20000Lei !");
                    
GivePlayerCash(playerid, - 20000);
                    
PlayerInfo[playerid][pFishLic] = 1;
                    }
                    else
                    {
                    
SendClientMessage(playeridCOLOR_GREY" You don't have 20000Lei !");
                    }
                    }
                    else
                    {
                    
SendClientMessage(playeridCOLOR_GREY" You already have a fishing license !");
                    }
                    return 
1;
                    }
                    if(
listitem == //Weapon
                    
{
                    if(
PlayerInfo[playerid][pGunLic] == 0)
                    {
                    if(
GetPlayerCash(playerid) >= 60000)
                    {
                    
SendClientMessage(playeridCOLOR_GREY"* You bought a weapon license for 60000Lei !");
                    
GivePlayerCash(playerid, - 200);
                    
PlayerInfo[playerid][pGunLic] = 1;
                    }
                    else
                    {
                    
SendClientMessage(playeridCOLOR_GREY" You don't have 60000Lei !");
                    }
                    }
                    else
                    {
                    
SendClientMessage(playeridCOLOR_GREY" You already have a weapon license !");
                    }
                    return 
1;
                    }
                    if(
listitem == //Sailing
                    
{
                    if(
PlayerInfo[playerid][pBoatLic] == 0)
                    {
                    if(
GetPlayerCash(playerid) >= 30000)
                    {
                    
SendClientMessage(playeridCOLOR_GREY"* You bought a sailing license for 30000Lei !");
                    
GivePlayerCash(playerid,-30000);
                    
PlayerInfo[playerid][pBoatLic] = 1;
                    }
                    else
                    {
                    
SendClientMessage(playeridCOLOR_GREY" You don't have 30000Lei !");
                    }
                    }
                    else
                    {
                    
SendClientMessage(playeridCOLOR_GREY" You already have a sailing license !");
                    }
                    return 
1;
                    }
                    if(
listitem == //Flying
                    
{
                    if(
PlayerInfo[playerid][pFlyLic] == 0)
                    {
                    if(
GetPlayerCash(playerid) >= 50000)
                    {
                    
SendClientMessage(playeridCOLOR_GREY"* You bought a flying license for 50000Lei !");
                    
GivePlayerCash(playerid, - 50000);
                    
PlayerInfo[playerid][pFlyLic] = 1;
                    }
                    else
                    {
                    
SendClientMessage(playeridCOLOR_GREY" You don't have 50000Lei !");
                    }
                     }
                    else
                    {
                    
SendClientMessage(playeridCOLOR_GREY" You already have a flying license !");
                    }
                    return 
1;
                    }
                    }
                    } 



Re: Server Closed Connection - Vince - 11.03.2013

http://*******/Y5UWGZ


Re: Server Closed Connection - Akcent_Voltaj - 11.03.2013

i did make the idention..and nothing still same..


Re: Server Closed Connection - Denying - 11.03.2013

Identation just makes you read the code more easily and notice (if there are) problems/mistakes.
It does not make your code work better.

EDIT: Re-post the idented code.


Re: Server Closed Connection - Akcent_Voltaj - 11.03.2013

pawn Код:
if( dialogid == Dialog_BuyLicense )
                    {
                        if( response )//daca apasa primul buton
                        {
                            if(listitem == 0 ) //Fishin
                            {
                                if(PlayerInfo[playerid][pFishLic] == 0)
                                {
                                    if(GetPlayerCash(playerid) >= 20000)
                                    {
                                        SendClientMessage(playerid, COLOR_GREY, "* You bought a fishing license for 20000Lei !");
                                        GivePlayerCash(playerid, - 20000);
                                        PlayerInfo[playerid][pFishLic] = 1;
                                    }
                                    else
                                    {
                                        SendClientMessage(playerid, COLOR_GREY, " You don't have 20000Lei !");
                                    }
                                }
                                else
                                {
                                    SendClientMessage(playerid, COLOR_GREY, " You already have a fishing license !");
                                }
                                return 1;
                            }
                            if(listitem == 1 ) //Weapon
                            {
                                if(PlayerInfo[playerid][pGunLic] == 0)
                                {
                                    if(GetPlayerCash(playerid) >= 60000)
                                    {
                                        SendClientMessage(playerid, COLOR_GREY, "* You bought a weapon license for 60000Lei !");
                                        GivePlayerCash(playerid, - 200);
                                        PlayerInfo[playerid][pGunLic] = 1;
                                    }
                                    else
                                    {
                                        SendClientMessage(playerid, COLOR_GREY, " You don't have 60000Lei !");
                                    }
                                }
                                else
                                {
                                    SendClientMessage(playerid, COLOR_GREY, " You already have a weapon license !");
                                }
                                return 1;
                            }
                            if(listitem == 2 ) //Sailing
                            {
                                if(PlayerInfo[playerid][pBoatLic] == 0)
                                {
                                    if(GetPlayerCash(playerid) >= 30000)
                                    {
                                        SendClientMessage(playerid, COLOR_GREY, "* You bought a sailing license for 30000Lei !");
                                        GivePlayerCash(playerid,-30000);
                                        PlayerInfo[playerid][pBoatLic] = 1;
                                    }
                                    else
                                    {
                                        SendClientMessage(playerid, COLOR_GREY, " You don't have 30000Lei !");
                                    }
                                }
                                else
                                {
                                    SendClientMessage(playerid, COLOR_GREY, " You already have a sailing license !");
                                }
                                return 1;
                            }
                            if(listitem == 3 ) //Flying
                            {
                                if(PlayerInfo[playerid][pFlyLic] == 0)
                                {
                                    if(GetPlayerCash(playerid) >= 50000)
                                    {
                                        SendClientMessage(playerid, COLOR_GREY, "* You bought a flying license for 50000Lei !");
                                        GivePlayerCash(playerid, - 50000);
                                        PlayerInfo[playerid][pFlyLic] = 1;
                                    }
                                    else
                                    {
                                        SendClientMessage(playerid, COLOR_GREY, " You don't have 50000Lei !");
                                    }
                                }
                                else
                                {
                                    SendClientMessage(playerid, COLOR_GREY, " You already have a flying license !");
                                }
                                return 1;
                            }
                        }
                    }
same thing like i told you!


Re: Server Closed Connection - IceCube! - 11.03.2013

Wrong.


Re: Server Closed Connection - DiGiTaL_AnGeL - 11.03.2013

Maybe the dialog's id is the same with another dialog.


Re: Server Closed Connection - Akcent_Voltaj - 11.03.2013

i dont know..if anyone knows.plz edit my dialog....