Server Closed Connection
#1

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;
                    }
                    }
                    } 
Reply
#2

http://*******/Y5UWGZ
Reply
#3

i did make the idention..and nothing still same..
Reply
#4

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.
Reply
#5

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!
Reply
#6

Wrong.
Reply
#7

Maybe the dialog's id is the same with another dialog.
Reply
#8

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


Forum Jump:


Users browsing this thread: 2 Guest(s)