Dialog not responding
#4

Property system dialogresponse:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 219)
    {
        if(response == 1)
        {
            if(GetPlayerBusinessID(playerid) == 1)return 0;
            new busid;
            format(file,sizeof(file),"Business/%i.ini",cpid[playerid]);
            if(GetPlayerBusinessID(playerid) > -1)return SendClientMessage(playerid,Red,"Jыs jau turite garaюа");
            if(dini_Int(file,"Cost") > GetPlayerMoney(playerid))return SendClientMessage(playerid,Red,"You do not have enough cash to buy this business.");
            GivePlayerMoney(playerid, -dini_Int(file,"Cost"));
            GetPlayerName(playerid,Name,sizeof(Name));
            dini_Set(file, "Name", Name);
            dini_Set(file, "Owner",Name);
            dini_IntSet(file, "OwnedBus",1);
            dini_IntSet(file, "HasOwner",1);
            format(Label, sizeof(Label), "{ccccff}%s's business\n\n{999999}%s\n{00BC00}Cost: {999999}$%i\n{00BC00}ID: {999999}%i",Name,dini_Get(file, "Owner"),dini_Int(file, "Cost"),busid);
            Update3DTextLabelText(BusinessInfo[cpid[playerid]][bLabel],White,Label);
            format(String,sizeof(String),"You have successfully purchased the %s.",dini_Get(file, "Name"));
            SendClientMessage(playerid,Green,String);
        }
        if(response == 0)
        {
            SendClientMessage(playerid,Yellow,"You chose not to buy this business");
        }
        return 1;
    }
    if(dialogid == 220)
    {
        if(response == 1)
        {
            GetPlayerName(playerid,Name,sizeof(Name));
            format(file,sizeof(file),"Business/%i.ini",GetPlayerBusinessID(playerid));
            format(Label, sizeof(Label), "{ccccff}For Sale\n\n{999999}No Owner\n{00BC00}Cost: {999999}$%i",dini_Get(file, "Name"),dini_Int(file, "Cost"));
            Update3DTextLabelText(BusinessInfo[cpid[playerid]][bLabel],White,Label);
            dini_Set(file, "Owner","No Owner");
            dini_IntSet(file, "Cost",dini_Int(file, "Cost"));
            dini_IntSet(file, "OwnedBus",0);
            dini_IntSet(file, "HasOwner",0);
            GivePlayerMoney(playerid,dini_Int(file, "Cost")/2);
            SendClientMessage(playerid,Green,"You have sold your business and recieved 50 percent of the price.");
        }
        return 1;
    }
    return 0;
}

Administration system dialogresponse:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
    {
        switch(dialogid)
        {
            case GARAZAS_DIALOG :
            {
                switch (listitem)
                {
                    if(GetPlayerBusinessID(playerid) == 1)return 0;
                    new busid, file[128];
                    format(file,sizeof(file),"Business/%i.ini",cpid[playerid]);
                    if(GetPlayerBusinessID(playerid) > -1)return SendClientMessage(playerid,Red,"Jыs jau turite garaюа");
                    if(dini_Int(file,"Cost") > GetPlayerMoney(playerid))return SendClientMessage(playerid,Red,"You do not have enough cash to buy this business.");
                    GivePlayerMoney(playerid, -dini_Int(file,"Cost"));
                    GetPlayerName(playerid,Name,sizeof(Name));
                    dini_Set(file, "Name", Name);
                    dini_Set(file, "Owner",Name);
                    dini_IntSet(file, "OwnedBus",1);
                    dini_IntSet(file, "HasOwner",1);
                    format(Label, sizeof(Label), "{ccccff}%s's business\n\n{999999}%s\n{00BC00}Cost: {999999}$%i\n{00BC00}ID: {999999}%i",Name,dini_Get(file, "Owner"),dini_Int(file, "Cost"),busid);
                    Update3DTextLabelText(BusinessInfo[cpid[playerid]][bLabel],White,Label);
                    format(String,sizeof(String),"You have successfully purchased the %s.",dini_Get(file, "Name"));
                    SendClientMessage(playerid,Green,String);
                }
                return 1;
            }
            case PASLAUGOS_DIALOG :
            {
                switch (listitem)
                {
                    case 0 : ShowPlayerDialog( playerid, PASLAUGOS_DIALOG+1, DIALOG_STYLE_MSGBOX, ""orange"Taрkш keitimas б VIP", ""white"VIP paslauga kainuoja 100 юaidimo taрkш\nЮaidimo taрkus gaunate kas 10 minuиiш\n"red"Visi taрkai sekami, todлl praрome neapgaudinлti"white"\n\n---\n\nNorлdami iрsikeisti 100 ЮT б VIP:\n1. Spauskite mygtukа SUTINKU apaиioje\n2. "orange"(REKOMENDUOJAMA) "white"Perkrauti юaidimа\n3. Prisijungus patikrinkite komandas (/VKomandos)", "Sutinku", "Iрeiti");
                    case 1 : ShowPlayerDialog( playerid, PASLAUGOS_DIALOG+2, DIALOG_STYLE_MSGBOX, ""red"Taрkш keitimas б 1LVL Admin", ""white"Admin paslauga kainuoja 250 юaidimo taрkш\nЮaidimo taрkus gaunate kas 10 minuиiш\n"red"Visi taрkai sekami, todлl praрome neapgaudinлti"white"\n\n---\n\nNorлdami iрsikeisti 250 ЮT б Admin:\n1. Spauskite mygtukа SUTINKU apaиioje\n2. "orange"(REKOMENDUOJAMA) "white"Perkrauti юaidimа\n3. Prisijungus patikrinkite komandas (/AKomandos)", "Sutinku", "Iрeiti");
                    case 2 : ShowPlayerDialog( playerid, PASLAUGOS_DIALOG+3, DIALOG_STYLE_MSGBOX, ""green"Garaюai", ""orange"Apie garaюш sistemа:\n"white"Surinkus 300 юaidimo taрkш, jыs turлsite galimybж бsigyti vienа iр\n12-os serverio garaюш. Nusipirkж garaюа bыsite бtrauktas б garaюш\nsavininkш sаraрa, bei gausite papildomus ЮT uю savo garaюа.\nGaraюe galлsite tiuninguoti papildomas transporto dalis.\nSpauskite nusikelti, norлdami atsirasti garaюuose", "Nusikelti", "Iрeiti");
                }
                return 1;
            }
etc.............
    return 0;
}
Reply


Messages In This Thread
Dialog not responding - by ixesas - 04.06.2013, 14:40
Re: Dialog not responding - by SimpalK - 04.06.2013, 14:50
AW: Dialog not responding - by Blackazur - 04.06.2013, 14:56
Re: Dialog not responding - by ixesas - 04.06.2013, 15:02
Re: Dialog not responding - by arakuta - 04.06.2013, 15:04
Re: Dialog not responding - by ixesas - 04.06.2013, 15:05
Re: Dialog not responding - by [Ro]DuReX - 04.06.2013, 15:08
Re: Dialog not responding - by ixesas - 04.06.2013, 15:10
Re: Dialog not responding - by NvidiaForTheWin - 04.06.2013, 17:20
Re: Dialog not responding - by ixesas - 05.06.2013, 14:43

Forum Jump:


Users browsing this thread: 1 Guest(s)